diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2013-03-18 12:05:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:05:58 -0400 |
commit | 24b90814fb133bb7971aef8ea5e642d9f9bc4b0b (patch) | |
tree | 5f557865c88022d9d13718165ba9d44435ef4369 /drivers/usb/host/ehci-hub.c | |
parent | 60fd4aa742a0c4f01dafeb0d125fed54e91e3657 (diff) |
USB: EHCI: don't turn on PORT_SUSPEND during port resume
This patch (as1637) cleans up the way ehci-hcd handles end-of-resume
port signalling. When the PORT_RESUME bit in the port's status and
control register is cleared, we shouldn't be setting the PORT_SUSPEND
bit at the same time. Not doing this doesn't seem to have hurt so
far, but we might as well do the right thing.
Also, the patch replaces an estimated value for what the port status
should be following a resume with the actual register value.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 576b735f49b6..0df45d933a10 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -464,7 +464,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) | |||
464 | while (i--) { | 464 | while (i--) { |
465 | temp = ehci_readl(ehci, &ehci->regs->port_status [i]); | 465 | temp = ehci_readl(ehci, &ehci->regs->port_status [i]); |
466 | if (test_bit(i, &resume_needed)) { | 466 | if (test_bit(i, &resume_needed)) { |
467 | temp &= ~(PORT_RWC_BITS | PORT_RESUME); | 467 | temp &= ~(PORT_RWC_BITS | PORT_SUSPEND | PORT_RESUME); |
468 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); | 468 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); |
469 | ehci_vdbg (ehci, "resumed port %d\n", i + 1); | 469 | ehci_vdbg (ehci, "resumed port %d\n", i + 1); |
470 | } | 470 | } |
@@ -871,10 +871,9 @@ static int ehci_hub_control ( | |||
871 | usb_hcd_end_port_resume(&hcd->self, wIndex); | 871 | usb_hcd_end_port_resume(&hcd->self, wIndex); |
872 | 872 | ||
873 | /* stop resume signaling */ | 873 | /* stop resume signaling */ |
874 | temp = ehci_readl(ehci, status_reg); | 874 | temp &= ~(PORT_RWC_BITS | |
875 | ehci_writel(ehci, | 875 | PORT_SUSPEND | PORT_RESUME); |
876 | temp & ~(PORT_RWC_BITS | PORT_RESUME), | 876 | ehci_writel(ehci, temp, status_reg); |
877 | status_reg); | ||
878 | clear_bit(wIndex, &ehci->resuming_ports); | 877 | clear_bit(wIndex, &ehci->resuming_ports); |
879 | retval = handshake(ehci, status_reg, | 878 | retval = handshake(ehci, status_reg, |
880 | PORT_RESUME, 0, 2000 /* 2msec */); | 879 | PORT_RESUME, 0, 2000 /* 2msec */); |
@@ -884,7 +883,7 @@ static int ehci_hub_control ( | |||
884 | wIndex + 1, retval); | 883 | wIndex + 1, retval); |
885 | goto error; | 884 | goto error; |
886 | } | 885 | } |
887 | temp &= ~(PORT_SUSPEND|PORT_RESUME|(3<<10)); | 886 | temp = ehci_readl(ehci, status_reg); |
888 | } | 887 | } |
889 | } | 888 | } |
890 | 889 | ||