[RFC v3 00/23] xHCI split roothub and USB 3.0 hub support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is the third revision of the patchset to add USB 3.0 hub support,
and make the xHCI host controller have two roothubs: a USB 2.0 roothub
and a USB 3.0 roothub.  The original patchset can be found here:

	http://marc.info/?l=linux-usb&m=129375137520460&w=2

Changes since v2:

 - Fix various bugs, including the device resume_done issue I had
   (http://marc.info/?l=linux-usb&m=129504238230270&w=2)  Turns out it
   was an issue with the xHCI driver not using the correct index, and
   Andiry was correct that the patch mentioned in that link is not
   needed.

 usb: Store bus type in usb_hcd, not in driver flags.
  - Rename usb_hcd->bcdUSB to usb_hcd->speed (the commit message needs
    to get updated, sorry).

 xhci: Register second xHCI roothub.
  - The xHCI driver now registers a PCI probe function, which calls the
    USB core's PCI probe function, and then registers a second roothub
    with calls to usb_create_shared_hcd() and usb_add_hcd().  This
    avoids mucking up the USB PCI core with xHCI specific code, and
    allows future host controller drivers to easily register more than
    two shared host controllers.
  - Register the USB 2.0 roothub first, to avoid resume issues.

 USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol.
  - change the portspeed() routine to accept a pointer to the hub
    structure in order to avoid printk statement duplication.

 USB: Disable auto-suspend for USB 3.0 hubs.
  - Only disable auto-suspend for external USB 3.0 hubs.  Allow
    autosuspend to be enabled for USB 3.0 roothubs.  Otherwise the host
    controller doesn't get suspended when there are no USB 3.0 devices
    attached to the system and all USB 2.0 devices are suspended.

 Overall, I tried to reduce the use of usb_hcd->shared_hcd, since Alan
 objected that it was probably redundant.  The xHCI driver stores the
 shared_hcd pointer in its xhci_hcd structure instead.  There are still
 a few places that the flag is used, and all of them are now in the USB
 core:

core/hcd-pci.c: if (hcd->shared_hcd) {
core/hcd-pci.c:         hcd = hcd->shared_hcd;
core/hcd-pci.c:         if (do_wakeup && hcd->shared_hcd &&
core/hcd-pci.c:                         HCD_WAKEUP_PENDING(hcd->shared_hcd))
core/hcd-pci.c:                         (retval == 0 && do_wakeup && hcd->shared_hcd &&
core/hcd-pci.c:                          HCD_WAKEUP_PENDING(hcd->shared_hcd))) {
core/hcd-pci.c:                 (hcd->shared_hcd &&
core/hcd-pci.c:                  hcd->shared_hcd->state != HC_STATE_SUSPENDED)) {
core/hcd-pci.c: if (hcd->shared_hcd)
core/hcd-pci.c:         clear_bit(HCD_FLAG_SAW_IRQ, &hcd->shared_hcd->flags);
core/hcd-pci.c:                 if (hcd->shared_hcd)
core/hcd-pci.c:                         usb_hc_died(hcd->shared_hcd);
core/hcd-pci.c: if (!hcd->shared_hcd) {
core/hcd-pci.c:                         hcd->shared_hcd->state == HC_STATE_HALT)
core/hcd.c:             if (hcd->shared_hcd)
core/hcd.c:                     set_bit(HCD_FLAG_SAW_IRQ, &hcd->shared_hcd->flags);
core/hcd.c:             if (hcd->shared_hcd)
core/hcd.c:                     set_bit(HCD_FLAG_SAW_IRQ, &hcd->shared_hcd->flags);
core/hcd.c:             hcd->shared_hcd = primary_hcd;
core/hcd.c:             primary_hcd->shared_hcd = hcd;
core/hcd.c:     if (hcd->shared_hcd)
core/hcd.c:             hcd->shared_hcd->shared_hcd = NULL;

 I think they will be trivial to remove later, but I need Alan's help
 with patching the references out.  The biggest issue is probably that
 hcd->shared_hcd is being used as a reference count for the
 bandwidth_mutex that is shared between the split roothubs.  I think
 this optimization can be done after the patches get merged and it's
 easier for other people to hack on them.


There are still a few things that need to be done, but I want feedback
on the overall architecture first.

Todo:
 - rebase against usb-next
 - rebase against Alan's hcd->state patch
 - remove the SAW_IRQ flag from the USB core
 - fix a crash on module unload with a USB mouse plugged in
 - Update commit message for "usb: Store bus type in usb_hcd, not in
   driver flags."
 - There's a couple of checkpatch.pl warnings for lines over 80
   characters (yes, I know about them).  There's also this warning:
       __packed is preferred over __attribute__((packed))
   I'm not sure what to make of that, since it's in John's hub patch.


John Youn (1):
  USB 3.0 Hub Changes

Sarah Sharp (22):
  USB: Clear "warm" port reset change.
  usb: Make USB 3.0 roothub have a SS EP comp descriptor.
  xhci: Modify check for TT info.
  xhci: Always use usb_hcd in URB instead of converting xhci_hcd.
  xhci: Change hcd_priv into a pointer.
  usb: Make usb_hcd_pci_probe labels more descriptive.
  usb: Refactor irq enabling out of usb_add_hcd()
  usb: Change usb_hcd->bandwidth_mutex to a pointer.
  usb: Store bus type in usb_hcd, not in driver flags.
  usb: Make core allocate resources per PCI-device.
  USB: Set usb_hcd->state and flags for shared roothubs.
  xhci: Index with a port array instead of PORTSC addresses.
  xhci: Refactor bus suspend state into a struct.
  xhci: Change xhci_find_slot_id_by_port() API.
  xhci: Register second xHCI roothub.
  xhci: Return a USB 3.0 hub descriptor for USB3 roothub.
  xhci: Limit roothub ports to 15 USB3 & 31 USB2 ports.
  xhci: Make roothub functions deal with device removal.
  xhci: Fix re-init on power loss after resume.
  xhci: Fixes for suspend/resume of shared HCDs.
  USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol.
  USB: Disable auto-suspend for USB 3.0 hubs.

 drivers/staging/usbip/vhci_hcd.c |    4 +-
 drivers/usb/core/hcd-pci.c       |   67 ++++++--
 drivers/usb/core/hcd.c           |  177 ++++++++++++++-----
 drivers/usb/core/hub.c           |  125 +++++++++----
 drivers/usb/core/message.c       |   22 ++--
 drivers/usb/gadget/dummy_hcd.c   |    4 +-
 drivers/usb/host/ehci-hub.c      |    4 +-
 drivers/usb/host/imx21-hcd.c     |    4 +-
 drivers/usb/host/isp116x-hcd.c   |    4 +-
 drivers/usb/host/isp1362-hcd.c   |    4 +-
 drivers/usb/host/isp1760-hcd.c   |    4 +-
 drivers/usb/host/ohci-hub.c      |   11 +-
 drivers/usb/host/oxu210hp-hcd.c  |    4 +-
 drivers/usb/host/r8a66597-hcd.c  |    5 +-
 drivers/usb/host/sl811-hcd.c     |    4 +-
 drivers/usb/host/u132-hcd.c      |   11 +-
 drivers/usb/host/xhci-hub.c      |  363 +++++++++++++++++++++++++++-----------
 drivers/usb/host/xhci-mem.c      |   93 +++++++++-
 drivers/usb/host/xhci-pci.c      |  113 +++++++++++-
 drivers/usb/host/xhci-ring.c     |  117 +++++++++++--
 drivers/usb/host/xhci.c          |  107 +++++++++---
 drivers/usb/host/xhci.h          |   38 +++--
 drivers/usb/musb/musb_virthub.c  |    4 +-
 drivers/usb/wusbcore/rh.c        |    4 +-
 include/linux/usb/ch11.h         |   42 ++++-
 include/linux/usb/hcd.h          |   13 ++-
 26 files changed, 1029 insertions(+), 319 deletions(-)

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux