Skip to content

Commit

Permalink
usb: wusbcore: send keepalives to unauthenticated devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Pugliese authored and Greg Kroah-Hartman committed Dec 2, 2013
1 parent 2bf308d commit f4042c0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/wusbcore/devconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,6 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc,
/*
* Refresh the list of keep alives to emit in the MMC
*
* Some devices don't respond to keep alives unless they've been
* authenticated, so skip unauthenticated devices.
*
* We only publish the first four devices that have a coming timeout
* condition. Then when we are done processing those, we go for the
* next ones. We ignore the ones that have timed out already (they'll
Expand Down Expand Up @@ -448,7 +445,7 @@ static void __wusbhc_keep_alive(struct wusbhc *wusbhc)

if (wusb_dev == NULL)
continue;
if (wusb_dev->usb_dev == NULL || !wusb_dev->usb_dev->authenticated)
if (wusb_dev->usb_dev == NULL)
continue;

if (time_after(jiffies, wusb_dev->entry_ts + tt)) {
Expand Down

0 comments on commit f4042c0

Please sign in to comment.