]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
USB: improve port transitions when EHCI starts up
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 28 Mar 2013 19:04:45 +0000 (15:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 21:45:57 +0000 (14:45 -0700)
commit05768918b9a122ce21bd55950df5054ff6c57f28
tree5acd91bdea7290599050fac5de27f06cf61d41bc
parent4e9c8e5c5883c910926296e699c2f4e4d9f847cb
USB: improve port transitions when EHCI starts up

It seems to be getting more common recently for EHCI host controllers
to be probed after their companion UHCI or OHCI controllers.  This may
be caused partly by splitting the ehci-pci driver out from ehci-hcd,
or it may be caused by changes in the way the kernel does driver
probing.

Regardless, it has a tendency to cause problems.  When an EHCI
controller is initialized, it takes ownership of all the ports away
from the companions.  In effect, it forcefully disconnects all the USB
devices that may already be using a companion controller.

This patch (as1672b) tries to make the transition more orderly by
deconfiguring the root hubs for all the companion controllers before
initializing the EHCI controller, and reconfiguring them afterward.
The result is a soft disconnect rather than a hard one.

Internally, the patch refactors the code involved in associating EHCI
controllers with their companions.  The old approach, in which a
single function is called with an argument telling it what to do (the
companion_action enum), has been replaced with a scheme using multiple
callback functions, each performing a single task.

This patch won't solve all the problems people encounter when their
EHCI controllers start up, but it will at least reduce the number of
error messages generated by the unexpected disconnections.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Jenya Y <jy.gerstmaier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd-pci.c