usb: ehci: change order of register cleanup during shutdown
authorMarc Ohlf <ohlf@mkt-sys.de>
Wed, 3 Aug 2016 09:51:54 +0000 (11:51 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Wed, 31 Aug 2016 23:21:09 +0000 (19:21 -0400)
commit5bd6b61399ab2a4c024389fd64c02b099c8fff95
treedf94f6e92a4e8541c145db9db01c088afc1b1243
parentfdcdf5bac083b93871d4762feeae99caf85bf325
usb: ehci: change order of register cleanup during shutdown

[ Upstream commit bc337b51508beb2d039aff5074a76cfe1c212030 ]

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: Marc Ohlf <ohlf@mkt-sys.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/usb/host/ehci-hcd.c