Timing issue when doing local migration + cleanup
PATCH 1/1 Timing issue when doing local migration + cleanup
When doing local migration, a timing-related problem occurred due to the frontend switching to the Closed state, which could end up having the .remove function being called after the backend has shut down. This now fixes the problem by switching to the Closing state.
The other part of the patch cleans up freeing of memory.
Signed-off-by Stefan Berger <[email protected]>
xen-unstable.hg/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c +1 -1
@@ -416,7 +416,7 @@ static int tpmfront_suspend(struct xenbu*/ interruptible_sleep_on_timeout (&tp->wait_q,100 ); } -xenbus_switch_state (dev, XenbusStateClosed); +xenbus_switch_state (dev, XenbusStateClosing);if (atomic_read (&tp->tx_busy)) {/*
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c +1 -1
@@ -150,7 +150,7 @@ static void frontend_changed(struct xenbbreak ;case XenbusStateClosing: -xenbus_switch_state (dev, XenbusStateClosing); + be->tpmif->tpm_instance =-1 ;break ;case XenbusStateClosed:
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h +0 -2
@@ -45,8 +45,6 @@ typedef struct tpmif_st {long int tpm_instance;unsigned long mmap_vstart; -struct work_struct work; -grant_handle_t shmem_handle;grant_ref_t shmem_ref;struct page *pagerange;
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c +1 -9
@@ -152,10 +152,8 @@ int tpmif_map(tpmif_t *tpmif, unsigned lreturn 0 ; } -static void __tpmif_disconnect_complete (void *arg) +void tpmif_disconnect_complete (tpmif_t *tpmif) { -tpmif_t *tpmif = (tpmif_t *) arg; -if (tpmif->irq)unbind_from_irqhandler (tpmif->irq, tpmif);
@@ -167,12 +165,6 @@ static void __tpmif_disconnect_complete(free_tpmif (tpmif); } -void tpmif_disconnect_complete (tpmif_t * tpmif) -{ -INIT_WORK (&tpmif->work, __tpmif_disconnect_complete, (void *)tpmif); -schedule_work (&tpmif->work); -} -void __init tpmif_interface_init (void ) { tpmif_cachep = kmem_cache_create("tpmif_cache", sizeof (tpmif_t),
xen-unstable.hg/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c +1 -1
@@ -1063,7 +1063,7 @@ static int __init tpmback_init(void)module_init (tpmback_init); -static void __exit tpmback_exit(void) +void __exit tpmback_exit(void) {vtpm_release_packets (NULL ,0 );tpmif_xenbus_exit ();
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel