[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] net accel: Fix double-probe of accelerator on suspend_cancel



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202723725 0
# Node ID c71467ad40d13477cf06c809d59ce58e64abdfda
# Parent  9dcb40286ad4fa5e3e376e280a176655d52f9fe5
net accel: Fix double-probe of accelerator on suspend_cancel

Fixes a bug in the network acceleration stuff where an accelerator
could get probed with the same interface twice on a suspend-cancel -
once manually in the suspend_cancel handler, and once when the watch
on the accel configuration option fired after being reinstated.

Signed-off-by: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
---
 drivers/xen/netfront/accel.c |   31 +++++--------------------------
 1 files changed, 5 insertions(+), 26 deletions(-)

diff -r 9dcb40286ad4 -r c71467ad40d1 drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Mon Feb 11 09:52:49 2008 +0000
+++ b/drivers/xen/netfront/accel.c      Mon Feb 11 09:55:25 2008 +0000
@@ -693,32 +693,11 @@ int netfront_accelerator_suspend_cancel(
 int netfront_accelerator_suspend_cancel(struct netfront_info *np,
                                        struct xenbus_device *dev)
 {
-       struct netfront_accel_vif_state *accel_vif_state = NULL;
- 
-       mutex_lock(&accelerator_mutex);
-
-       /* Check that we've got a device that was accelerated */
-       if (np->accelerator == NULL)
-               goto out;
-
-       /* Find the vif_state from the accelerator's list */
-       list_for_each_entry(accel_vif_state, &np->accelerator->vif_states,
-                           link) {
-               if (accel_vif_state->dev == dev) {
-                       BUG_ON(accel_vif_state != &np->accel_vif_state);
- 
-                       /*
-                        * Kick things off again to restore
-                        * acceleration as it was before suspend 
-                        */
-                       accelerator_probe_new_vif(np, dev, np->accelerator);
- 
-                       break;
-               }
-       }
-       
- out:
-       mutex_unlock(&accelerator_mutex);
+       /* 
+        * Setting the watch will cause it to fire and probe the
+        * accelerator, so no need to call accelerator_probe_new_vif()
+        * directly here
+        */
        netfront_accelerator_add_watch(np);
        return 0;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.