# HG changeset patch # User Brendan Cully # Date 1238529727 25200 # Node ID 9db4499b35f048f4fac6323d8ca73de9779e6447 # Parent ed51e0ec7b8c08b1f191af7f89e53302f855f7d7 Only rebuild netfront accelerator xenstore watch on resume. The suspend_cancel function could take 2 seconds doing this. diff --git a/drivers/xen/netfront/accel.c b/drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c +++ b/drivers/xen/netfront/accel.c @@ -678,8 +678,6 @@ unsigned long flags; int rc = 0; - netfront_accelerator_remove_watch(np); - mutex_lock(&accelerator_mutex); /* Check that we've got a device that was accelerated */ @@ -701,20 +699,6 @@ } -int netfront_accelerator_suspend_cancel(struct netfront_info *np, - struct xenbus_device *dev) -{ - /* - * Setting the watch will cause it to fire and probe the - * accelerator, so no need to call accelerator_probe_new_vif() - * directly here - */ - if (dev->state == XenbusStateConnected) - netfront_accelerator_add_watch(np); - return 0; -} - - void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev) { @@ -722,6 +706,8 @@ spinlock_t *vif_states_lock; unsigned long flags; + netfront_accelerator_remove_watch(np); + mutex_lock(&accelerator_mutex); /* Check that we've got a device that was accelerated */ diff --git a/drivers/xen/netfront/netfront.c b/drivers/xen/netfront/netfront.c --- a/drivers/xen/netfront/netfront.c +++ b/drivers/xen/netfront/netfront.c @@ -311,13 +311,6 @@ } -static int netfront_suspend_cancel(struct xenbus_device *dev) -{ - struct netfront_info *info = dev->dev.driver_data; - return netfront_accelerator_suspend_cancel(info, dev); -} - - /** * We are reconnecting to the backend, due to a suspend/resume, or a backend * driver restart. We tear down our netif structure and recreate it, but @@ -2191,7 +2184,6 @@ .probe = netfront_probe, .remove = __devexit_p(netfront_remove), .suspend = netfront_suspend, - .suspend_cancel = netfront_suspend_cancel, .resume = netfront_resume, .otherend_changed = backend_changed, }; diff --git a/drivers/xen/netfront/netfront.h b/drivers/xen/netfront/netfront.h --- a/drivers/xen/netfront/netfront.h +++ b/drivers/xen/netfront/netfront.h @@ -249,9 +249,6 @@ int netfront_accelerator_suspend(struct netfront_info *np, struct xenbus_device *dev); extern -int netfront_accelerator_suspend_cancel(struct netfront_info *np, - struct xenbus_device *dev); -extern void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev); extern