From 4dd405a4b0969bfec4dc9959050b46d818b6549b Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 18 Mar 2013 12:05:08 -0400 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-hub.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/usb/host/ehci-hub.c') diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 4d3b294f203..576b735f49b 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) u32 mask; int ports, i, retval = 1; unsigned long flags; - u32 ppcd = 0; + u32 ppcd = ~0; /* init status to no-changes */ buf [0] = 0; @@ -628,9 +628,10 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf) for (i = 0; i < ports; i++) { /* leverage per-port change bits feature */ - if (ehci->has_ppcd && !(ppcd & (1 << i))) - continue; - temp = ehci_readl(ehci, &ehci->regs->port_status [i]); + if (ppcd & (1 << i)) + temp = ehci_readl(ehci, &ehci->regs->port_status[i]); + else + temp = 0; /* * Return status information even for ports with OWNER set. -- cgit v1.2.3-70-g09d2