USB: EHCI: fix up locking
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 11 Jul 2012 15:23:10 +0000 (11:23 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 23:56:48 +0000 (16:56 -0700)
commitc4f3476436f7452b97c8accb5dd7d53219a11a3f
tree95711a24bb4357dab53d4641aae5a09292974fb8
parentf42890782241a60d107f23d08089a4a12b507a11
USB: EHCI: fix up locking

This patch (as1588) adjusts the locking in ehci-hcd's various halt,
shutdown, and suspend/resume pathways.  We want to hold the spinlock
while writing device registers and accessing shared variables, but not
while polling in a loop.

In addition, there's no need to call ehci_work() at times when no URBs
can be active, i.e., in ehci_stop() and ehci_bus_suspend().

Finally, ehci_adjust_port_wakeup_flags() is called only in situations
where interrupts are enabled; therefore it can use spin_lock_irq
rather than spin_lock_irqsave.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci-tegra.c