提交 bc337b51 编写于 作者: M Marc Ohlf 提交者: Greg Kroah-Hartman

usb: ehci: change order of register cleanup during shutdown

In ehci_turn_off_all_ports() all EHCI port registers are cleared to zero.
On some hardware, this can lead to an system hang,
when ehci_port_power() accesses the already cleared registers.

This patch changes the order of cleanup.
First call ehci_port_power() which respects the current bits in
port status registers
and afterwards cleanup the hard way by setting everything to zero.
Signed-off-by: NMarc Ohlf <ohlf@mkt-sys.de>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
CC: <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 aed9d65a
...@@ -332,11 +332,11 @@ static void ehci_turn_off_all_ports(struct ehci_hcd *ehci) ...@@ -332,11 +332,11 @@ static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
int port = HCS_N_PORTS(ehci->hcs_params); int port = HCS_N_PORTS(ehci->hcs_params);
while (port--) { while (port--) {
ehci_writel(ehci, PORT_RWC_BITS,
&ehci->regs->port_status[port]);
spin_unlock_irq(&ehci->lock); spin_unlock_irq(&ehci->lock);
ehci_port_power(ehci, port, false); ehci_port_power(ehci, port, false);
spin_lock_irq(&ehci->lock); spin_lock_irq(&ehci->lock);
ehci_writel(ehci, PORT_RWC_BITS,
&ehci->regs->port_status[port]);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册