On Tue, Nov 30, 2010 at 11:32:56AM -0500, Alan Stern wrote: > On Mon, 29 Nov 2010, Sarah Sharp wrote: > > > This patch requires changes in both the USB core and the xHCI host > > controller driver to allow two roothubs (usb_hcd structures) to be > > allocated for one xHCI PCI device. There are really three functional > > changes included in this (rather long) patch, but there's no way to break > > them up without breaking git-bisect: > > > > 1. Changes to the USB PCI code to allocate two usb_hcd structures, and > > corresponding changes to the xHCI initialization and shutdown code. > > The only really tricky bit is ensuring that the host controller doesn't > > start kicking khubd in response to port status changes before both > > usb_hcd structures are registered. xhci_run() only starts the xHC > > running once it has been called with the USB 2.0 roothub. > > > > 2. Changes to the USB roothub emulation code to return the proper speed > > and hub descriptors for each usb_hcd in the roothub pair. > > > > 3. Changes to the xHCI roothub emulation code to lookup the proper port > > address in the two roothub port arrays, based on which usb_hcd is > > passed in. There are also changes in the xHCI port status change > > event handler. It needs to map the internal hardware port index into > > the proper usb_hcd to kick khubd for. It indexes into an array of > > port protocol versions to do this. > > > > When there's an issue that halts the xHCI host controller, we need to set > > the hcd->state to HC_STATE_HALT for both shared roothubs (and possibly let > > the USB core know *both* died). > > I haven't looked carefully at this, but it seems bigger than necessary. Do you mean that the patch should be split into a couple of patches, or that overall the changes seem too big? This patch is my "monster patch" but I think I can break it up into a couple patches. > For example, when deciding whether a particular hcd is USB-2 or USB-3, > you shouldn't need to check whether it is the "main" hcd of a pair. > Just look at the HCD_MASK part of the flags. You mean usb_hcd->driver->flags? I'm not sure how that helps me here. The flags are always set to HCD_USB3 by the xHCI driver. What I'm trying to do with usb_hcd_is_main_hcd() is find out whether the usb_hcd I'm dealing with is the USB 2.0 roothub under xHCI, or the USB 3.0 roothub under xHCI. I can't do that by using HCD_MASK because the driver pointer is always the same, and therefore the flags are always the same. Perhaps the function needs a better name, but I'm not sure what. :) Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html