[PATCH v3 00/10] Just the essential port power control fixes for 3.14

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

 



Alan, Sarah,

This revision boils down the port power control fixes to the
bare minimum to get the implementation functional and reliable.
Data structure changes are constrained to struct usb_port and
gone are the clumsier attempts at wider reworks from v1 [1] and
v2 [2].  No device model changes to consider or changes to the
meaning of 'runtime_status' for port devices.  Three disconnect
bugs are fixed:

1/ Superspeed devices downgrade to their hi-speed connection: fix this by
   preventing superspeed poweroff until the peer port is suspended.  See
   patch 5.

2/ khubd taking disconnect action on ports that are in the process of
   being recovered: khubd now ignores ports in the pm-runtime-suspended
   state.  Alan, per your comment [3] this effectively uses the pm_usage
   counter and state as a lock against khubd.  See patch 7.

3/ Superspeed devices fail to reconnect: Seen during repeated toggles of
   the port power state.  Fixed by forcing a full recovery cycle of the
   device before allowing the next suspend, and blocking khubd while the
   resume is in progress.  See patch 9.

Patch overview:
    [PATCH 01/10] usb: assign default peer ports for root hubs
    [PATCH 02/10] usb: find external hub port peers
    [PATCH 03/10] usb: find internal hub tier mismatch via acpi
    [PATCH 04/10] usb: sysfs link peer ports
    * Per our discussions of v1 these patches implement a
      simple algorithm for associating peer ports across
      internal and external hubs.
    
    [PATCH 05/10] usb: defer suspension of superspeed port while peer is powered
    * Fix case 1
    
    [PATCH 06/10] usb: gate clearing FEAT_C_ENABLE to usb2 hubs
    * Cleanup misuse of ClearPortFeature(PORT_C_ENABLE)
    
    [PATCH 07/10] usb: synchronize port poweroff and khubd
    * Fix case 2
    
    [PATCH 08/10] usb: cleanup straggling C_PORT_RESET C_PORT_LINK_STATE notifications
    * Handle some unexpected hub events encountered during testing
    
    [PATCH 09/10] usb: make khubd and subsequent suspension wait for port recovery
    * Fix case 3
    
    [PATCH 10/10] usb: documentation for usb port power off mechanisms

These patches were tested by repeatedly power toggling all
35 ports in the following topology:
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=ax88179_178a, 5000M
        |__ Port 2: Dev 4, If 0, Class=stor., Driver=usb-storage, 5000M
        |__ Port 4: Dev 5, If 0, Class=stor., Driver=usb-storage, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 4, If 0, Class=HID, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 5, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 2: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M

Each iteration of the test verifies that no disconnects occur and that
all ports reach the 'suspended' state.  To force device suspension
interface drivers are unbound for power-off and then rebound.  Note that
since the hub drivers are never unbound their parent ports remain active
due to ->do_remote_wakeup for the hub device, but the the 30 other ports
reliably suspend and resume now with these patches.  The proposed warm
reset changes [4] do not appear to be required as long as superspeed hub
parent ports remain powered.

[1] http://marc.info/?l=linux-usb&m=138260013707007&w=2
[2] http://marc.info/?l=linux-usb&m=138511124910669&w=2
[3] http://marc.info/?l=linux-usb&m=138775577717546&w=2
[4] http://marc.info/?l=linux-usb&m=138759482824618&w=2

---

Dan Williams (9):
      usb: assign default peer ports for root hubs
      usb: find external hub port peers
      usb: find internal hub tier mismatch via acpi
      usb: sysfs link peer ports
      usb: don't suspend port while peer is powered
      usb: gate clearing FEAT_C_ENABLE to usb2 hubs
      usb: synchronize port poweroff and khubd
      usb: cleanup straggling C_PORT_RESET C_PORT_LINK_STATE notifications
      usb: make khubd and subsequent suspension wait for port recovery

Lan Tianyu (1):
      USB: Documentation for USB port power off mechanisms


 Documentation/usb/power-management.txt |  210 +++++++++++++++++++++++++++
 drivers/usb/core/hub.c                 |  112 ++++++++++----
 drivers/usb/core/hub.h                 |   14 ++
 drivers/usb/core/port.c                |  252 +++++++++++++++++++++++++++++++-
 drivers/usb/core/usb-acpi.c            |   35 ++++
 drivers/usb/core/usb.h                 |    2 
 6 files changed, 574 insertions(+), 51 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