mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
USB: ehci: phy low power mode bug fixing
1. There are two msleep calls inside two spin lock sections, need to unlock and lock again after msleep. 2. Save a extra status reg setting. Signed-off-by: Alek Du <alek.du@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6feb63b69f
commit
b9df794258
1 changed files with 8 additions and 5 deletions
|
@ -196,7 +196,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
|
||||||
if (hostpc_reg) {
|
if (hostpc_reg) {
|
||||||
u32 t3;
|
u32 t3;
|
||||||
|
|
||||||
|
spin_unlock_irq(&ehci->lock);
|
||||||
msleep(5);/* 5ms for HCD enter low pwr mode */
|
msleep(5);/* 5ms for HCD enter low pwr mode */
|
||||||
|
spin_lock_irq(&ehci->lock);
|
||||||
t3 = ehci_readl(ehci, hostpc_reg);
|
t3 = ehci_readl(ehci, hostpc_reg);
|
||||||
ehci_writel(ehci, t3 | HOSTPC_PHCD, hostpc_reg);
|
ehci_writel(ehci, t3 | HOSTPC_PHCD, hostpc_reg);
|
||||||
t3 = ehci_readl(ehci, hostpc_reg);
|
t3 = ehci_readl(ehci, hostpc_reg);
|
||||||
|
@ -904,17 +906,18 @@ static int ehci_hub_control (
|
||||||
if ((temp & PORT_PE) == 0
|
if ((temp & PORT_PE) == 0
|
||||||
|| (temp & PORT_RESET) != 0)
|
|| (temp & PORT_RESET) != 0)
|
||||||
goto error;
|
goto error;
|
||||||
ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
|
|
||||||
/* After above check the port must be connected.
|
/* After above check the port must be connected.
|
||||||
* Set appropriate bit thus could put phy into low power
|
* Set appropriate bit thus could put phy into low power
|
||||||
* mode if we have hostpc feature
|
* mode if we have hostpc feature
|
||||||
*/
|
*/
|
||||||
if (hostpc_reg) {
|
|
||||||
temp &= ~PORT_WKCONN_E;
|
temp &= ~PORT_WKCONN_E;
|
||||||
temp |= (PORT_WKDISC_E | PORT_WKOC_E);
|
temp |= PORT_WKDISC_E | PORT_WKOC_E;
|
||||||
ehci_writel(ehci, temp | PORT_SUSPEND,
|
ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
|
||||||
status_reg);
|
if (hostpc_reg) {
|
||||||
|
spin_unlock_irqrestore(&ehci->lock, flags);
|
||||||
msleep(5);/* 5ms for HCD enter low pwr mode */
|
msleep(5);/* 5ms for HCD enter low pwr mode */
|
||||||
|
spin_lock_irqsave(&ehci->lock, flags);
|
||||||
temp1 = ehci_readl(ehci, hostpc_reg);
|
temp1 = ehci_readl(ehci, hostpc_reg);
|
||||||
ehci_writel(ehci, temp1 | HOSTPC_PHCD,
|
ehci_writel(ehci, temp1 | HOSTPC_PHCD,
|
||||||
hostpc_reg);
|
hostpc_reg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue