Skip to content

Commit

Permalink
USB: Don't use EHCI port sempahore for USB 3.0 hubs.
Browse files Browse the repository at this point in the history
[This is upstream commit 0fe51aa.
It needs to be backported to kernels as old as 3.2, because it fixes the
buggy commit 9dbcaec "USB: Handle warm
reset failure on empty port."]

The EHCI host controller needs to prevent EHCI initialization when the
UHCI or OHCI companion controller is in the middle of a port reset.  It
uses ehci_cf_port_reset_rwsem to do this.  USB 3.0 hubs can't be under
an EHCI host controller, so it makes no sense to down the semaphore for
USB 3.0 hubs.  It also makes the warm port reset code more complex.

Don't down ehci_cf_port_reset_rwsem for USB 3.0 hubs.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Mar 14, 2013
1 parent d2c96b7 commit ac79dc9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,17 +2330,16 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
{
int i, status;

if (!warm) {
/* Block EHCI CF initialization during the port reset.
* Some companion controllers don't like it when they mix.
*/
down_read(&ehci_cf_port_reset_rwsem);
} else {
if (!hub_is_superspeed(hub->hdev)) {
if (!hub_is_superspeed(hub->hdev)) {
if (warm) {
dev_err(hub->intfdev, "only USB3 hub support "
"warm reset\n");
return -EINVAL;
}
/* Block EHCI CF initialization during the port reset.
* Some companion controllers don't like it when they mix.
*/
down_read(&ehci_cf_port_reset_rwsem);
}

/* Reset the port */
Expand Down Expand Up @@ -2378,7 +2377,7 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
port1);

done:
if (!warm)
if (!hub_is_superspeed(hub->hdev))
up_read(&ehci_cf_port_reset_rwsem);

return status;
Expand Down

0 comments on commit ac79dc9

Please sign in to comment.