summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/if_usb.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-07-15 23:48:00 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-07-17 15:11:37 -0400
commit9ef9dbeaa53978042bf6ba67f88b15ad09959941 (patch)
tree746b66a00e1442105fdbe998001541f8bb8c7cbd /drivers/net/wireless/libertas/if_usb.c
parent9c3099f7cb02adf5a3554bdef96bdc24a3d468e7 (diff)
libertas USB: don't set surpriseremoved flag
We found a deadlock in the handling of command failures/reset conditions. For example: 1. Two commands are in the queue. 2. The first command is sent, but causes a timeout, which kicks off an asynchronous device reset 3. The second command is queued (but not yet sent to the hardware) 4. The device reset kicks in, causing the if_usb disconnect handler to set the "surprise removed" flag to be set as the device disappears from the bus. This causes lbs_thread to stop processing things ("adapter removed; waiting to die"), not processing any further commands, leaving the second queued command "in the air", causing a deadlock. Fix this by removing the surpriseremoved flag setting in if_usb. I can't see any reason why this needs to be done so early. lbs_remove_card will set this flag at an appropriate time - i.e. after all pending commands have been completed or cancelled, avoiding this deadlock. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/if_usb.c')
-rw-r--r--drivers/net/wireless/libertas/if_usb.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index cd3b0d400618..92b6885d49a2 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -309,7 +309,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
cardp->surprise_removed = 1;
if (priv) {
- priv->surpriseremoved = 1;
lbs_stop_card(priv);
lbs_remove_card(priv);
}