Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235341
b: refs/heads/master
c: 294d95f
h: refs/heads/master
i:
  235339: 54e6847
v: v3
  • Loading branch information
Matthew Garrett authored and Greg Kroah-Hartman committed Feb 25, 2011
1 parent 5b1415e commit 1b73757
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0fd857ae09c455f0036bf548fb6ec26b3049f5de
refs/heads/master: 294d95f2cbc2aef5346258f216cd9df570e271a5
23 changes: 22 additions & 1 deletion trunk/drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci)
ehci->owned_ports = 0;
}

static int ehci_port_change(struct ehci_hcd *ehci)
{
int i = HCS_N_PORTS(ehci->hcs_params);

/* First check if the controller indicates a change event */

if (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)
return 1;

/*
* Not all controllers appear to update this while going from D3 to D0,
* so check the individual port status registers as well
*/

while (i--)
if (ehci_readl(ehci, &ehci->regs->port_status[i]) & PORT_CSC)
return 1;

return 0;
}

static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
bool suspending, bool do_wakeup)
{
Expand Down Expand Up @@ -173,7 +194,7 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
}

/* Does the root hub have a port wakeup pending? */
if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD))
if (!suspending && ehci_port_change(ehci))
usb_hcd_resume_root_hub(ehci_to_hcd(ehci));

spin_unlock_irqrestore(&ehci->lock, flags);
Expand Down

0 comments on commit 1b73757

Please sign in to comment.