From: Sarah Sharp Date: Tue, 8 Apr 2008 21:30:18 +0000 (-0700) Subject: USB: ehci shutdown refactored X-Git-Tag: v2.6.26-rc1~1061^2~31 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21da84a89312dd8d014ca3352d1ab5c2279ec548;p=pandora-kernel.git USB: ehci shutdown refactored This patch refactors some shutdown code so it can be shared between ehci_stop() and ehci_shutdown(). This also fixes a couple potential bugs: - ehci_shutdown() was not locking ehci->lock before halting the HC. - ehci_shutdown() didn't disable the watchdog and IAA timers. - ehci_stop() was resetting the host controller when it may have been running, which the EHCI spec says "may result in undefined behavior". ehci_stop() was calling port_power() to turn off the ports, which waited 20ms after applying the port change. The msleep was for the case where the HC might take 20ms to turn the ports on; since we're shutting them off, we can avoid the msleep and just use ehci_turn_off_ports(). ehci_stop() doesn't need to clear the intr_enable register or revert ownership of the companion controllers to the BIOS, because the host controller reset should have done that. There might be a buggy host controller that doesn't follow the reset rules, but for now we assume it's redundant code and remove it. [ A subsequent patch will cancel the timers later ... this version carries forward existing bugs where timers could get re-armed after they're canceled. ] Signed-off-by: Sarah Sharp Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed