1. 16 Oct, 2013 3 commits
    • Sarah Sharp's avatar
      usb: Don't enable USB 2.0 Link PM by default. · de68bab4
      Sarah Sharp authored
      How it's supposed to work:
      --------------------------
      
      USB 2.0 Link PM is a lower power state that some newer USB 2.0 devices
      support.  USB 3.0 devices certified by the USB-IF are required to
      support it if they are plugged into a USB 2.0 only port, or a USB 2.0
      cable is used.  USB 2.0 Link PM requires both a USB device and a host
      controller that supports USB 2.0 hardware-enabled LPM.
      
      USB 2.0 Link PM is designed to be enabled once by software, and the host
      hardware handles transitions to the L1 state automatically.  The premise
      of USB 2.0 Link PM is to be able to put the device into a lower power
      link state when the bus is idle or the device NAKs USB IN transfers for
      a specified amount of time.
      
      ...but hardware is broken:
      --------------------------
      
      It turns out many USB 3.0 devices claim to support USB 2.0 Link PM (by
      setting the LPM bit in their USB 2.0 BOS descriptor), but they don't
      actually implement it correctly.  This manifests as the USB device
      refusing to respond to transfers when it is plugged into a USB 2.0 only
      port under the Haswell-ULT/Lynx Point LP xHCI host.
      
      These devices pass the xHCI driver's simple test to enable USB 2.0 Link
      PM, wait for the port to enter L1, and then bring it back into L0.  They
      only start to break when L1 entry is interleaved with transfers.
      
      Some devices then fail to respond to the next control transfer (usually
      a Set Configuration).  This results in devices never enumerating.
      
      Other mass storage devices (such as a later model Western Digital My
      Passport USB 3.0 hard drive) respond fine to going into L1 between
      control transfers.  They ACK the entry, come out of L1 when the host
      needs to send a control transfer, and respond properly to those control
      transfers.  However, when the first READ10 SCSI command is sent, the
      device NAKs the data phase while it's reading from the spinning disk.
      Eventually, the host requests to put the link into L1, and the device
      ACKs that request.  Then it never responds to the data phase of the
      READ10 command.  This results in not being able to read from the drive.
      
      Some mass storage devices (like the Corsair Survivor USB 3.0 flash
      drive) are well behaved.  They ACK the entry into L1 during control
      transfers, and when SCSI commands start coming in, they NAK the requests
      to go into L1, because they need to be at full power.
      
      Not all USB 3.0 devices advertise USB 2.0 link PM support.  My Point
      Grey USB 3.0 webcam advertises itself as a USB 2.1 device, but doesn't
      have a USB 2.0 BOS descriptor, so we don't enable USB 2.0 Link PM.  I
      suspect that means the device isn't certified.
      
      What do we do about it?
      -----------------------
      
      There's really no good way for the kernel to test these devices.
      Therefore, the kernel needs to disable USB 2.0 Link PM by default, and
      distros will have to enable it by writing 1 to the sysfs file
      /sys/bus/usb/devices/../power/usb2_hardware_lpm.  Rip out the xHCI Link
      PM test, since it's not sufficient to detect these buggy devices, and
      don't automatically enable LPM after the device is addressed.
      
      This patch should be backported to kernels as old as 3.11, that
      contain the commit a558ccdc "usb: xhci:
      add USB2 Link power management BESL support".  Without this fix, some
      USB 3.0 devices will not enumerate or work properly under USB 2.0 ports
      on Haswell-ULT systems.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      de68bab4
    • Sarah Sharp's avatar
      xhci: Set L1 device slot on USB2 LPM enable/disable. · 58e21f73
      Sarah Sharp authored
      To enable USB 2.0 Link Power Management (LPM), the xHCI host controller
      needs the device slot ID to generate the device address used in L1 entry
      tokens.  That information is set in the L1 device slot ID field of the
      USB 2.0 LPM registers.
      
      Currently, the L1 device slot ID is overwritten when the xHCI driver
      initiates the software test of USB 2.0 Link PM in
      xhci_usb2_software_lpm_test.  It is never cleared when USB 2.0 Link PM
      is disabled for the device.  That should be harmless, because the
      Hardware LPM Enable (HLE) bit is cleared when USB 2.0 Link PM is
      disabled, so the host should not pay attention to the slot ID.
      
      This patch should have no effect on host behavior, but since
      xhci_usb2_software_lpm_test is going away in an upcoming bug fix patch,
      we need to move that code to the function that enables and disables USB
      2.0 Link PM.
      
      This patch should be backported to kernels as old as 3.11, that contain
      the commit a558ccdc "usb: xhci: add USB2
      Link power management BESL support".  The upcoming bug fix patch is also
      marked for that stable kernel.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      58e21f73
    • Sarah Sharp's avatar
      usb: Disable USB 2.0 Link PM before device reset. · dcc01c08
      Sarah Sharp authored
      Before the USB core resets a device, we need to disable the L1 timeout
      for the roothub, if USB 2.0 Link PM is enabled.  Otherwise the port may
      transition into L1 in between descriptor fetches, before we know if the
      USB device descriptors changed.  LPM will be re-enabled after the
      full device descriptors are fetched, and we can confirm the device still
      supports USB 2.0 LPM after the reset.
      
      We don't need to wait for the USB device to exit L1 before resetting the
      device, since the xHCI roothub port diagrams show a transition to the
      Reset state from any of the Ux states (see Figure 34 in the 2012-08-14
      xHCI specification update).
      
      This patch should be backported to kernels as old as 3.2, that contain
      the commit 65580b43 "xHCI: set USB2
      hardware LPM".  That was the first commit to enable USB 2.0
      hardware-driven Link Power Management.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      dcc01c08
  2. 14 Oct, 2013 11 commits
    • Jingoo Han's avatar
      USB: ohci-exynos: Remove non-DT support · c00809d3
      Jingoo Han authored
      The non-DT for EXYNOS SoCs is not supported from v3.11.
      Thus, there is no need to support non-DT for Exynos OHCI driver.
      
      The 'include/linux/platform_data/usb-ohci-exynos.h' file has been
      used for non-DT support. Thus, the 'usb-ohci-exynos.h' file can
      be removed.
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c00809d3
    • Michael Opdenacker's avatar
      usb/hcd: remove unnecessary local_irq_save · 88ed9fd5
      Michael Opdenacker authored
      Remove the use of local_irq_save() and IRQF_DISABLED, no longer needed since
      interrupt handlers are always run with interrupts disabled on the
      current CPU.
      
      Tested successfully with 3.12.0-rc4 on my PC. Didn't find
      any issue because of this change.
      Signed-off-by: default avatarMichael Opdenacker <michael.opdenacker@free-electrons.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      88ed9fd5
    • Alan Stern's avatar
      USB: EHCI: start new isochronous streams ASAP · a393a807
      Alan Stern authored
      This patch changes the initial delay before the startup of a newly
      scheduled isochronous stream.  Currently the stream doesn't start
      for at least 5 ms (40 microframes).  This value is just an estimate;
      it has no real justification.
      
      Instead, we can start the stream as soon as possible after the
      scheduling computations are complete.  Essentially this requires
      nothing more than reading the frame counter after the stream is
      scheduled, instead of before.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a393a807
    • Alan Stern's avatar
      USB: EHCI: create per-TT bandwidth tables · b35c5009
      Alan Stern authored
      This patch continues the scheduling changes in ehci-hcd by adding a
      table to store the bandwidth allocation below each TT.  This will
      speed up the scheduling code, as it will no longer need to read
      through the entire schedule to compute the bandwidth currently in use.
      
      Properly speaking, the FS/LS budget calculations should be done in
      terms of full-speed bytes per microframe, as described in the USB-2
      spec.  However the driver currently uses microseconds per microframe,
      and the scheduling code isn't robust enough at this point to change
      over.  For the time being, we leave the calculations as they are.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b35c5009
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle OHCI controller suspend" · ca1ad0ff
      Greg Kroah-Hartman authored
      This reverts commit 476e4bf9.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      ca1ad0ff
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-at91 suspend" · 118cb990
      Greg Kroah-Hartman authored
      This reverts commit 056ca85d.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      118cb990
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-s3c2410 suspend" · ba8d400e
      Greg Kroah-Hartman authored
      This reverts commit 19d33943.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      ba8d400e
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-da8xx suspend" · 5d931288
      Greg Kroah-Hartman authored
      This reverts commit 86a63f10.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      5d931288
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-ep93xx suspend" · 848b5b5e
      Greg Kroah-Hartman authored
      This reverts commit 018258b4.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      848b5b5e
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-exynos suspend" · 066ba8e0
      Greg Kroah-Hartman authored
      This reverts commit fea0896f.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      066ba8e0
    • Greg Kroah-Hartman's avatar
      Revert "USB: OHCI: Properly handle ohci-spear suspend" · 3de80bfc
      Greg Kroah-Hartman authored
      This reverts commit 36a87587.
      
      Manjunath is no longer at Linaro, the email address bounces.  Given
      that, and the fact that others have reported problems with these
      patches, I'm reverting them until someone from Linaro who can SUPPORT
      THEM submits them.
      
      I will no longer accept patches from linaro.com developers unless a
      senior Linaro developer has signed off on them, which did not happen
      with this patch set.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Cc: Manjunath Goudar <manjunath.goudar@linaro.org>
      Cc: Manjunath Goudar <csmanjuvijay@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      3de80bfc
  3. 12 Oct, 2013 7 commits
  4. 11 Oct, 2013 19 commits