aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 796ea0c8900f..8a515f0d5988 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -111,6 +111,7 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
111{ 111{
112 int port; 112 int port;
113 u32 temp; 113 u32 temp;
114 unsigned long flags;
114 115
115 /* If remote wakeup is enabled for the root hub but disabled 116 /* If remote wakeup is enabled for the root hub but disabled
116 * for the controller, we must adjust all the port wakeup flags 117 * for the controller, we must adjust all the port wakeup flags
@@ -120,6 +121,8 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
120 if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || do_wakeup) 121 if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || do_wakeup)
121 return; 122 return;
122 123
124 spin_lock_irqsave(&ehci->lock, flags);
125
123 /* clear phy low-power mode before changing wakeup flags */ 126 /* clear phy low-power mode before changing wakeup flags */
124 if (ehci->has_hostpc) { 127 if (ehci->has_hostpc) {
125 port = HCS_N_PORTS(ehci->hcs_params); 128 port = HCS_N_PORTS(ehci->hcs_params);
@@ -131,7 +134,9 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
131 temp = ehci_readl(ehci, hostpc_reg); 134 temp = ehci_readl(ehci, hostpc_reg);
132 ehci_writel(ehci, temp & ~HOSTPC_PHCD, hostpc_reg); 135 ehci_writel(ehci, temp & ~HOSTPC_PHCD, hostpc_reg);
133 } 136 }
137 spin_unlock_irqrestore(&ehci->lock, flags);
134 msleep(5); 138 msleep(5);
139 spin_lock_irqsave(&ehci->lock, flags);
135 } 140 }
136 141
137 port = HCS_N_PORTS(ehci->hcs_params); 142 port = HCS_N_PORTS(ehci->hcs_params);
@@ -170,6 +175,8 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
170 /* Does the root hub have a port wakeup pending? */ 175 /* Does the root hub have a port wakeup pending? */
171 if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)) 176 if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD))
172 usb_hcd_resume_root_hub(ehci_to_hcd(ehci)); 177 usb_hcd_resume_root_hub(ehci_to_hcd(ehci));
178
179 spin_unlock_irqrestore(&ehci->lock, flags);
173} 180}
174 181
175static int ehci_bus_suspend (struct usb_hcd *hcd) 182static int ehci_bus_suspend (struct usb_hcd *hcd)