vxge: hotplug stall
authorJon Mason <jon.mason@exar.com>
Fri, 10 Dec 2010 14:03:00 +0000 (14:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Dec 2010 00:08:23 +0000 (16:08 -0800)
When hot-unplugging a vxge adapter while running, the driver's remove
routine prints warning and then stalls the calling thread.  This is due
to vxge_remove calling vxge_device_unregister to unregister the netdev
before calling flush_scheduled_work clear any pending work.  Swapping
the order of these two functions resolves the issue.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxge/vxge-main.c

index 3ec80684cd5fcd3752f8a712ff7bac40546be655..b771e4b2ca9e8be1c25e5a3f741127e6bcedf124 100644 (file)
@@ -3439,11 +3439,11 @@ static void vxge_device_unregister(struct __vxge_hw_device *hldev)
 
        strncpy(buf, dev->name, IFNAMSIZ);
 
+       flush_scheduled_work();
+
        /* in 2.6 will call stop() if device is up */
        unregister_netdev(dev);
 
-       flush_scheduled_work();
-
        vxge_debug_init(vdev->level_trace, "%s: ethernet device unregistered",
                        buf);
        vxge_debug_entryexit(vdev->level_trace, "%s: %s:%d  Exiting...", buf,