aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-03-18 12:05:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-18 19:05:58 -0400
commit4dd405a4b0969bfec4dc9959050b46d818b6549b (patch)
tree122109c425f0e8b18b32c289711b450091f7c2d4 /drivers/usb/host/ehci-hub.c
parent6d5df8976266d8e40603601f7695537f9f3dc9e2 (diff)
USB: EHCI: improve use of per-port status-change bits
This patch (as1634) simplifies some of the code associated with the per-port change bits added in EHCI-1.1, and in particular it fixes a bug in the logic of ehci_hub_status_data(). Even if the change bit doesn't indicate anything happened on a particular port, we still have to notify the core about changes to the suspend or reset status. 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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 4d3b294f203e..576b735f49b6 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -590,7 +590,7 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
590 u32 mask; 590 u32 mask;
591 int ports, i, retval = 1; 591 int ports, i, retval = 1;
592 unsigned long flags; 592 unsigned long flags;
593 u32 ppcd = 0; 593 u32 ppcd = ~0;
594 594
595 /* init status to no-changes */ 595 /* init status to no-changes */
596 buf [0] = 0; 596 buf [0] = 0;
@@ -628,9 +628,10 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
628 628
629 for (i = 0; i < ports; i++) { 629 for (i = 0; i < ports; i++) {
630 /* leverage per-port change bits feature */ 630 /* leverage per-port change bits feature */
631 if (ehci->has_ppcd && !(ppcd & (1 << i))) 631 if (ppcd & (1 << i))
632 continue; 632 temp = ehci_readl(ehci, &ehci->regs->port_status[i]);
633 temp = ehci_readl(ehci, &ehci->regs->port_status [i]); 633 else
634 temp = 0;
634 635
635 /* 636 /*
636 * Return status information even for ports with OWNER set. 637 * Return status information even for ports with OWNER set.