EHCI: only power off port if over-current is active
commit81da73dccac71cbbd5949f87a7cacf2925f01e44
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Wed, 6 Jul 2011 19:19:38 +0000 (6 23:19 +0400)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:55:02 +0000 (1 13:55 -0700)
treee30c2cd40cd3d8b4e68aff216506c6b323bc0d40
parent8f8d6bc6ec9510a3bd8d97e011c7dc6008a7355d
EHCI: only power off port if over-current is active

[ upstream commit 81463c1d707186adbbe534016cd1249edeab0dac ]

MAX4967 USB power supply chip we use on our boards signals over-current when
power is not enabled; once it's enabled, over-current signal returns to normal.
That unfortunately caused the endless stream of "over-current change on port"
messages. The EHCI root hub code reacts on every over-current signal change
with powering off the port -- such change event is generated the moment the
port power is enabled, so once enabled the power is immediately cut off.
I think we should only cut off power when we're seeing the active over-current
signal, so I'm adding such check to that code. I also think that the fact that
we've cut off the port power should be reflected in the result of GetPortStatus
request immediately, hence I'm adding a PORTSCn register readback after write...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: stable@kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/usb/host/ehci-hub.c