aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2013-12-02 16:39:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-02 18:21:03 -0500
commitf4042c068ae53625e4a9f39543c2693d07a4e14c (patch)
tree8522bec12f38c35813ccd834e2f3148c61e6e281
parent2bf308d7bc5e8cdd69672199f59532f35339133c (diff)
usb: wusbcore: send keepalives to unauthenticated devices
This patch modifies the WUSB device disconnect timer code to send keepalives to all connected devices even if they are not authenticated. This fixes a problem where unauthenticated devices that lose their connection before they are authenticated will stay in the device tree forever. More importantly, devices in this situation will never relinquish their port on the root hub so eventually all root ports will be taken up and no other devices can connect. A comment in the existing code states that there are some devices that may not respond to keepalives if they have not been authenticated. That comment is about 5 years old and I don't know of any WUSB devices that act that way. Either way, any buggy devices that may still be around will continue to work as long as they can transition to the authenticated state within the WUSB LOA timeout of 4s, which is not unreasonable to expect. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/wusbcore/devconnect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c
index e538b72c4e3a..d1af4e89111e 100644
--- a/drivers/usb/wusbcore/devconnect.c
+++ b/drivers/usb/wusbcore/devconnect.c
@@ -411,9 +411,6 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc,
411/* 411/*
412 * Refresh the list of keep alives to emit in the MMC 412 * Refresh the list of keep alives to emit in the MMC
413 * 413 *
414 * Some devices don't respond to keep alives unless they've been
415 * authenticated, so skip unauthenticated devices.
416 *
417 * We only publish the first four devices that have a coming timeout 414 * We only publish the first four devices that have a coming timeout
418 * condition. Then when we are done processing those, we go for the 415 * condition. Then when we are done processing those, we go for the
419 * next ones. We ignore the ones that have timed out already (they'll 416 * next ones. We ignore the ones that have timed out already (they'll
@@ -448,7 +445,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc)
448 445
449 if (wusb_dev == NULL) 446 if (wusb_dev == NULL)
450 continue; 447 continue;
451 if (wusb_dev->usb_dev == NULL || !wusb_dev->usb_dev->authenticated) 448 if (wusb_dev->usb_dev == NULL)
452 continue; 449 continue;
453 450
454 if (time_after(jiffies, wusb_dev->entry_ts + tt)) { 451 if (time_after(jiffies, wusb_dev->entry_ts + tt)) {