WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix double-probe of accelerator on suspend_cancel

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix double-probe of accelerator on suspend_cancel
From: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
Date: Fri, 08 Feb 2008 14:27:11 +0000
Delivery-date: Fri, 08 Feb 2008 06:27:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I just fixed 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.
This patch fixes it.

diff -r 0c1a374e9fcb drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c
+++ b/drivers/xen/netfront/accel.c
@@ -696,32 +696,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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>