Commit dd4dd19e authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: Make device reset stop retrying after disconnect

This patch (as898) changes the port reset code in the hub driver.  If
a connect change occurs, it is reported the same way as a disconnect
(which of course is what it really is).

It also changes usb_reset_device(), to prevent the routine from futilely
retrying the reset after a disconnect has occurred.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3c519b84
...@@ -1539,9 +1539,9 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, ...@@ -1539,9 +1539,9 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
if (!(portstatus & USB_PORT_STAT_CONNECTION)) if (!(portstatus & USB_PORT_STAT_CONNECTION))
return -ENOTCONN; return -ENOTCONN;
/* bomb out completely if something weird happened */ /* bomb out completely if the connection bounced */
if ((portchange & USB_PORT_STAT_C_CONNECTION)) if ((portchange & USB_PORT_STAT_C_CONNECTION))
return -EINVAL; return -ENOTCONN;
/* if we`ve finished resetting, then break out of the loop */ /* if we`ve finished resetting, then break out of the loop */
if (!(portstatus & USB_PORT_STAT_RESET) && if (!(portstatus & USB_PORT_STAT_RESET) &&
...@@ -2974,7 +2974,7 @@ int usb_reset_device(struct usb_device *udev) ...@@ -2974,7 +2974,7 @@ int usb_reset_device(struct usb_device *udev)
* Other endpoints will be handled by re-enumeration. */ * Other endpoints will be handled by re-enumeration. */
ep0_reinit(udev); ep0_reinit(udev);
ret = hub_port_init(parent_hub, udev, port1, i); ret = hub_port_init(parent_hub, udev, port1, i);
if (ret >= 0) if (ret >= 0 || ret == -ENOTCONN || ret == -ENODEV)
break; break;
} }
clear_bit(port1, parent_hub->busy_bits); clear_bit(port1, parent_hub->busy_bits);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment