1. 18 6月, 2014 1 次提交
  2. 20 5月, 2014 3 次提交
    • M
      xhci: rework command timeout and cancellation, · c311e391
      Mathias Nyman 提交于
      Use one timer to control command timeout.
      
      start/kick the timer every time a command is completed and a
      new command is waiting, or a new command is added to a empty list.
      
      If the timer runs out, then tag the current command as "aborted", and
      start the xhci command abortion process.
      
      Previously each function that submitted a command had its own timer.
      If that command timed out, a new command structure for the
      command was created and it was put on a cancel_cmd_list list,
      then a pci write to abort the command ring was issued.
      
      when the ring was aborted, it checked if the current command
      was the one to be canceled, later when the ring was stopped the
      driver got ownership of the TRBs in the command ring,
      compared then to the TRBs in the cancel_cmd_list,
      and turned them into No-ops.
      
      Now, instead, at timeout we tag the status of the command in the
      command queue to be aborted, and start the ring abortion.
      Ring abortion stops the command ring and gives control of the
      commands to us.
      All the aborted commands are now turned into No-ops.
      
      If the ring is already stopped when the command times outs its not possible
      to start the ring abortion, in this case the command is turnd to No-op
      right away.
      
      All these changes allows us to remove the entire cancel_cmd_list code.
      
      The functions waiting for a command to finish no longer have their own timeouts.
      They will wait either until the command completes normally,
      or until the whole command abortion is done.
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c311e391
    • M
      xhci: Use completion and status in global command queue · 9ea1833e
      Mathias Nyman 提交于
      Remove the per-device command list and handle_cmd_in_cmd_wait_list()
      and use the completion and status variables found in the
      command structure in the global command list.
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ea1833e
    • M
      xhci: Use command structures when queuing commands on the command ring · ddba5cd0
      Mathias Nyman 提交于
      To create a global command queue we require that each command put on the
      command ring is submitted with a command structure.
      
      Functions that queue commands and wait for completion need to allocate a command
      before submitting it, and free it once completed. The following command queuing
      functions need to be modified.
      
      xhci_configure_endpoint()
      xhci_address_device()
      xhci_queue_slot_control()
      xhci_queue_stop_endpoint()
      xhci_queue_new_dequeue_state()
      xhci_queue_reset_ep()
      xhci_configure_endpoint()
      
      xhci_configure_endpoint() could already be called with a command structure,
      and only xhci_check_maxpacket and xhci_check_bandwidth did not do so. These
      are changed and a command structure is now required. This change also simplifies
      the configure endpoint command completion handling and the "goto bandwidth_change"
      handling code can be removed.
      
      In some cases the command queuing function is called in interrupt context.
      These commands needs to be allocated atomically, and they can't wait for
      completion. These commands will in this patch be freed directly after queuing,
      but freeing will be moved to the command completion event handler in a later
      patch once we get the global command queue up.(Just so that we won't leak
      memory in the middle of the patch set)
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ddba5cd0
  3. 05 3月, 2014 1 次提交
    • S
      usb/xhci: Change how we indicate a host supports Link PM. · 25cd2882
      Sarah Sharp 提交于
      The xHCI driver currently uses a USB core internal field,
      udev->lpm_capable, to indicate the xHCI driver knows how to calculate
      the LPM timeout values.  If this value is set for the host controller
      udev, it means Link PM can be enabled for child devices under that host.
      
      Change the code so the xHCI driver isn't mucking with USB core internal
      fields.  Instead, indicate the xHCI driver doesn't support Link PM on
      this host by clearing the U1 and U2 exit latencies in the roothub
      SuperSpeed Extended Capabilities BOS descriptor.
      
      The code to check for the roothub setting U1 and U2 exit latencies to
      zero will also disable LPM for external devices that do that same.  This
      was already effectively done with commit
      ae8963ad "usb: Don't enable LPM if the
      exit latency is zero."  Leave that code in place, so that if a device
      sets one exit latency value to zero, but the other is set to a valid
      value, LPM is only enabled for the U1 or U2 state that had the valid
      value.  This is the same behavior the code had before.
      
      Also, change messages about missing Link PM information from warning
      level to info level.  Only print a warning about the first device that
      doesn't support LPM, to avoid log spam.  Further, cleanup some
      unnecessary line breaks to help people to grep for the error messages.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      25cd2882
  4. 03 12月, 2013 2 次提交
    • X
      xhci: replace xhci_writel() with writel() · 204b7793
      Xenia Ragiadakou 提交于
      Function xhci_writel() is used to write a 32bit value in xHC registers residing
      in MMIO address space. It takes as first argument a pointer to the xhci_hcd
      although it does not use it. xhci_writel() internally simply calls writel().
      This creates an illusion that xhci_writel() is an xhci specific function that
      has to be called in a context where a pointer to xhci_hcd is available.
      
      Remove xhci_writel() wrapper function and replace its calls with calls to
      writel() to make the code more straight-forward.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      204b7793
    • X
      xhci: replace xhci_readl() with readl() · b0ba9720
      Xenia Ragiadakou 提交于
      Function xhci_readl() is used to read 32bit xHC registers residing in MMIO
      address space. It takes as first argument a pointer to the xhci_hcd although
      it does not use it. xhci_readl() internally simply calls readl(). This creates
      an illusion that xhci_readl() is an xhci specific function that has to be
      called in a context where a pointer to xhci_hcd is available.
      
      Remove the unnecessary xhci_readl() wrapper function and replace its calls to
      with calls to readl() to make the code more straightforward.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      b0ba9720
  5. 17 10月, 2013 2 次提交
  6. 10 10月, 2013 1 次提交
    • S
      xhci: Don't enable/disable RWE on bus suspend/resume. · f217c980
      Sarah Sharp 提交于
      The RWE bit of the USB 2.0 PORTPMSC register is supposed to enable
      remote wakeup for devices in the lower power link state L1.  It has
      nothing to do with the device suspend remote wakeup from L2.  The RWE
      bit is designed to be set once (when USB 2.0 LPM is enabled for the
      port) and cleared only when USB 2.0 LPM is disabled for the port.
      
      The xHCI bus suspend method was setting the RWE bit erroneously, and the
      bus resume method was clearing it.  The xHCI 1.0 specification with
      errata up to Aug 12, 2012 says in section 4.23.5.1.1.1 "Hardware
      Controlled LPM":
      
      "While Hardware USB2 LPM is enabled, software shall not modify the
      HIRDBESL or RWE fields of the USB2 PORTPMSC register..."
      
      If we have previously enabled USB 2.0 LPM for a device, that means when
      the USB 2.0 bus is resumed, we violate the xHCI specification by
      clearing RWE.  It also means that after a bus resume, the host would
      think remote wakeup is disabled from L1 for ports with USB 2.0 Link PM
      enabled, which is not what we want.
      
      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 kernel that supported USB 2.0
      Link PM.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      f217c980
  7. 24 9月, 2013 2 次提交
    • S
      usb: Fix xHCI host issues on remote wakeup. · 8b3d4570
      Sarah Sharp 提交于
      When a device signals remote wakeup on a roothub, and the suspend change
      bit is set, the host controller driver must not give control back to the
      USB core until the port goes back into the active state.
      
      EHCI accomplishes this by waiting in the get port status function until
      the PORT_RESUME bit is cleared:
      
                              /* stop resume signaling */
                              temp &= ~(PORT_RWC_BITS | PORT_SUSPEND | PORT_RESUME);
                              ehci_writel(ehci, temp, status_reg);
                              clear_bit(wIndex, &ehci->resuming_ports);
                              retval = ehci_handshake(ehci, status_reg,
                                              PORT_RESUME, 0, 2000 /* 2msec */);
      
      Similarly, the xHCI host should wait until the port goes into U0, before
      passing control up to the USB core.  When the port transitions from the
      RExit state to U0, the xHCI driver will get a port status change event.
      We need to wait for that event before passing control up to the USB
      core.
      
      After the port transitions to the active state, the USB core should time
      a recovery interval before it talks to the device.  The length of that
      recovery interval is TRSMRCY, 10 ms, mentioned in the USB 2.0 spec,
      section 7.1.7.7.  The previous xHCI code (which did not wait for the
      port to go into U0) would cause the USB core to violate that recovery
      interval.
      
      This bug caused numerous USB device disconnects on remote wakeup under
      ChromeOS and a Lynx Point LP xHCI host that takes up to 20 ms to move
      from RExit to U0.  ChromeOS is very aggressive about power savings, and
      sets the autosuspend_delay to 100 ms, and disables USB persist.
      
      I attempted to replicate this bug with Ubuntu 12.04, but could not.  I
      used Ubuntu 12.04 on the same platform, with the same BIOS that the bug
      was triggered on ChromeOS with.  I also changed the USB sysfs settings
      as described above, but still could not reproduce the bug under Ubuntu.
      It may be that ChromeOS userspace triggers this bug through additional
      settings.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      8b3d4570
    • M
      xhci: Ensure a command structure points to the correct trb on the command ring · ec7e43e2
      Mathias Nyman 提交于
      If a command on the command ring needs to be cancelled before it is handled
      it can be turned to a no-op operation when the ring is stopped.
      We want to store the command ring enqueue pointer in the command structure
      when the command in enqueued for the cancellation case.
      
      Some commands used to store the command ring dequeue pointers instead of enqueue
      (these often worked because enqueue happends to equal dequeue quite often)
      
      Other commands correctly used the enqueue pointer but did not check if it pointed
      to a valid trb or a link trb, this caused for example stop endpoint command to timeout in
      xhci_stop_device() in about 2% of suspend/resume cases.
      
      This should also solve some weird behavior happening in command cancellation cases.
      
      This patch is based on a patch submitted by Sarah Sharp to linux-usb, but
      then forgotten:
          http://marc.info/?l=linux-usb&m=136269803207465&w=2
      
      This patch should be backported to kernels as old as 3.7, that contain
      the commit b92cc66c "xHCI: add aborting
      command ring function"
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      ec7e43e2
  8. 14 8月, 2013 1 次提交
  9. 24 7月, 2013 2 次提交
    • S
      xhci: Report USB 2.1 link status for L1 · 063ebeb4
      Sarah Sharp 提交于
      USB 2.1 devices can go into a lower power link state, L1.  When they are
      active, they are in the L0 state.  The L1 transition can be purely
      driven by software, or some USB host controllers (including some xHCI
      1.0 hosts) allow the host hardware to track idleness and automatically
      place a port into L1.
      
      The USB 2.1 Link Power Management ECN gives a way for USB 2.1 hubs that
      support LPM to report that a port is in L1.  The port status bit 5 will
      be set when the port is in L1.  The xHCI host reports the root port as
      being in 'U2' when the devices is in L1, and as being in 'U0' when the
      port is active (in L0).
      
      Translate the xHCI USB 2.1 link status into the format external hubs
      use, and pass the L1 status up to the USB core and tools like lsusb.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      063ebeb4
    • S
      xhci: Refactor port status into a new function. · eae5b176
      Sarah Sharp 提交于
      The hub control function is *way* too long.  Refactor it into a new
      function, and document the side effects of calling that function.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      eae5b176
  10. 06 6月, 2013 1 次提交
  11. 29 3月, 2013 1 次提交
    • A
      USB: remove CONFIG_USB_SUSPEND option · 84ebc102
      Alan Stern 提交于
      This patch (as1675) removes the CONFIG_USB_SUSPEND option, essentially
      replacing it everywhere with CONFIG_PM_RUNTIME (except for one place
      in hub.c, where it is replaced with CONFIG_PM because the code needs
      to be used in both runtime and system PM).  The net result is code
      shrinkage and simplification.
      
      There's very little point in keeping CONFIG_USB_SUSPEND because almost
      everybody enables it.  The few that don't will find that the usbcore
      module has gotten somewhat bigger and they will have to take active
      measures if they want to prevent hubs from being runtime suspended.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Peter Chen <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84ebc102
  12. 04 1月, 2013 2 次提交
    • S
      xhci: Avoid "dead ports", add roothub port polling. · c52804a4
      Sarah Sharp 提交于
      The USB core hub thread (khubd) is designed with external USB hubs in
      mind.  It expects that if a port status change bit is set, the hub will
      continue to send a notification through the hub status data transfer.
      Basically, it expects hub notifications to be level-triggered.
      
      The xHCI host controller is designed to be edge-triggered on the logical
      'OR' of all the port status change bits.  When all port status change
      bits are clear, and a new change bit is set, the xHC will generate a
      Port Status Change Event.  If another change bit is set in the same port
      status register before the first bit is cleared, it will not send
      another event.
      
      This means that the hub code may lose port status changes because of
      race conditions between clearing change bits.  The user sees this as a
      "dead port" that doesn't react to device connects.
      
      The fix is to turn on port polling whenever a new change bit is set.
      Once the USB core issues a hub status request that shows that no change
      bits are set in any USB ports, turn off port polling.
      
      We can't allow the USB core to poll the roothub for port events during
      host suspend because if the PCI host is in D3cold, the port registers
      will be all f's.  Instead, stop the port polling timer, and
      unconditionally restart it when the host resumes.  If there are no port
      change bits set after the resume, the first call to hub_status_data will
      disable polling.
      
      This patch should be backported to stable kernels with the first xHCI
      support, 2.6.31 and newer, that include the commit
      0f2a7930 "USB: xhci: Root hub support."
      There will be merge conflicts because the check for HC_STATE_SUSPENDED
      was moved into xhci_suspend in 3.8.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable@vger.kernel.org
      c52804a4
    • S
      USB: Allow USB 3.0 ports to be disabled. · 41e7e056
      Sarah Sharp 提交于
      If hot and warm reset fails, or a port remains in the Compliance Mode,
      the USB core needs to be able to disable a USB 3.0 port.  Unlike USB 2.0
      ports, once the port is placed into the Disabled link state, it will not
      report any new device connects.  To get device connect notifications, we
      need to put the link into the Disabled state, and then the RxDetect
      state.
      
      The xHCI driver needs to atomically clear all change bits on USB 3.0
      port disable, so that we get Port Status Change Events for future port
      changes.  We could technically do this in the USB core instead of in the
      xHCI roothub code, since the port state machine can't advance out of the
      disabled state until we set the link state to RxDetect.  However,
      external USB 3.0 hubs don't need this code.  They are level-triggered,
      not edge-triggered like xHCI, so they will continue to send interrupt
      events when any change bit is set.  Therefore it doesn't make sense to
      put this code in the USB core.
      
      This patch is part of a series to fix several reports of infinite loops
      on device enumeration failure.  This includes John, when he boots with
      a USB 3.0 device (Roseweil eusb3 enclosure) attached to his NEC 0.96
      host controller.  The fix requires warm reset support, so it does not
      make sense to backport this patch to stable kernels without warm reset
      support.
      
      This patch should be backported to kernels as old as 3.2, contain the
      commit ID 75d7cf72 "usbcore: refine warm
      reset logic"
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NJohn Covici <covici@ccs.covici.com>
      Cc: stable@vger.kernel.org
      41e7e056
  13. 23 10月, 2012 2 次提交
  14. 14 9月, 2012 2 次提交
  15. 11 9月, 2012 2 次提交
  16. 06 9月, 2012 1 次提交
    • A
      usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP Hardware · 71c731a2
      Alexis R. Cortes 提交于
      This patch is intended to work around a known issue on the
      SN65LVPE502CP USB3.0 re-driver that can delay the negotiation
      between a device and the host past the usual handshake timeout.
      
      If that happens on the first insertion, the host controller
      port will enter in Compliance Mode and NO port status event will
      be generated (as per xHCI Spec) making impossible to detect this
      event by software. The port will remain in compliance mode until
      a warm reset is applied to it.
      
      As a result of this, the port will seem "dead" to the user and no
      device connections or disconnections will be detected.
      
      For solving this, the patch creates a timer which polls every 2
      seconds the link state of each host controller's port (this
      by reading the PORTSC register) and recovers the port by issuing a
      Warm reset every time Compliance mode is detected.
      
      If a xHC USB3.0 port has previously entered to U0, the compliance
      mode issue will NOT occur only until system resumes from
      sleep/hibernate, therefore, the compliance mode timer is stopped
      when all xHC USB 3.0 ports have entered U0. The timer is initialized
      again after each system resume.
      
      Since the issue is being caused by a piece of hardware, the timer
      will be enabled ONLY on those systems that have the SN65LVPE502CP
      installed (this patch uses DMI strings for detecting those systems)
      therefore making this patch to act as a quirk (XHCI_COMP_MODE_QUIRK
      has been added to the xhci stack).
      
      This patch applies for these systems:
      Vendor: Hewlett-Packard. System Models: Z420, Z620 and Z820.
      
      This patch should be backported to kernels as old as 3.2, as that was
      the first kernel to support warm reset.  The kernels will need to
      contain both commit 10d674a8 "USB: When
      hot reset for USB3 fails, try warm reset" and commit
      8bea2bd3 "usb: Add support for root hub
      port status CAS".  The first patch add warm reset support, and the
      second patch modifies the USB core to issue a warm reset when the port
      is in compliance mode.
      Signed-off-by: NAlexis R. Cortes <alexis.cortes@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      71c731a2
  17. 11 7月, 2012 1 次提交
    • S
      xhci: Export Latency Tolerance Messaging capabilities. · af3a23ef
      Sarah Sharp 提交于
      Some xHCI host controllers may have optional support for Latency
      Tolerance Messaging (LTM).  This allows USB 3.0 devices that support LTM
      to pass information about how much latency they can tolerate to the xHC.
      A PCI xHCI host will use this information to update the PCI Latency
      Tolerance Request (LTR) info.  The goal of this is to gather latency
      information for the system, to enable hardware-driven C states, and the
      shutting down of PLLs.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      af3a23ef
  18. 03 7月, 2012 1 次提交
    • S
      usb: Add support for root hub port status CAS · 8bea2bd3
      Stanislaw Ledwon 提交于
      The host controller port status register supports CAS (Cold Attach
      Status) bit. This bit could be set when USB3.0 device is connected
      when system is in Sx state. When the system wakes to S0 this port
      status with CAS bit is reported and this port can't be used by any
      device.
      
      When CAS bit is set the port should be reset by warm reset. This
      was not supported by xhci driver.
      
      The issue was found when pendrive was connected to suspended
      platform. The link state of "Compliance Mode" was reported together
      with CAS bit. This link state was also not supported by xhci and
      core/hub.c.
      
      The CAS bit is defined only for xhci root hub port and it is
      not supported on regular hubs. The link status is used to force
      warm reset on port. Make the USB core issue a warm reset when port
      is in ether the 'inactive' or 'compliance mode'. Change the xHCI driver
      to report 'compliance mode' when the CAS is set. This force warm reset
      on the root hub port.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 10d674a8 "USB: When
      hot reset for USB3 fails, try warm reset."
      Signed-off-by: NStanislaw Ledwon <staszek.ledwon@linux.intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      8bea2bd3
  19. 19 5月, 2012 1 次提交
    • S
      xhci: Add roothub code to set U1/U2 timeouts. · 797b0ca5
      Sarah Sharp 提交于
      USB 3.0 hubs can be put into a mode where the hub can automatically
      request that the link go into a deeper link power state after the link
      has been idle for a specified amount of time.  Each of the new USB 3.0
      link states (U1 and U2) have their own timeout that can be programmed
      per port.
      
      Change the xHCI roothub emulation code to handle the request to set the
      U1 and U2 timeouts.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      797b0ca5
  20. 04 5月, 2012 1 次提交
    • A
      xHCI: keep track of ports being resumed and indicate in hub_status_data · f370b996
      Andiry Xu 提交于
      This commit adds a bit-array to xhci bus_state for keeping track of
      which ports are undergoing a resume transition. If any of the bits
      are set when xhci_hub_status_data() is called, the routine will return
      a non-zero value even if no ports have any status changes pending.
      This will allow usbcore to handle races between root-hub suspend and
      port wakeup.
      
      This patch should be backported to kernels as old as 3.4, that contain
      the commit 879d38e6 "USB: fix race
      between root-hub suspend and remote wakeup".
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: stable@vger.kernel.org
      f370b996
  21. 15 2月, 2012 1 次提交
    • S
      USB/xHCI: Enable USB 3.0 hub remote wakeup. · 4296c70a
      Sarah Sharp 提交于
      USB 3.0 hubs have a different remote wakeup policy than USB 2.0 hubs.
      USB 2.0 hubs, once they have remote wakeup enabled, will always send
      remote wakes when anything changes on a port.
      
      However, USB 3.0 hubs have a per-port remote wake up policy that is off
      by default.  The Set Feature remote wake mask can be changed for any
      port, enabling remote wakeup for a connect, disconnect, or overcurrent
      event, much like EHCI and xHCI host controller "wake on" port status
      bits.  The bits are cleared to zero on the initial hub power on, or
      after the hub has been reset.
      
      Without this patch, when a USB 3.0 hub gets suspended, it will not send
      a remote wakeup on device connect or disconnect.  This would show up to
      the user as "dead ports" unless they ran lsusb -v (since newer versions
      of lsusb use the sysfs files, rather than sending control transfers).
      
      Change the hub driver's suspend method to enable remote wake up for
      disconnect, connect, and overcurrent for all ports on the hub.  Modify
      the xHCI driver's roothub code to handle that request, and set the "wake
      on" bits in the port status registers accordingly.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      4296c70a
  22. 11 2月, 2012 1 次提交
    • S
      xhci: Fix oops caused by more USB2 ports than USB3 ports. · 3278a55a
      Sarah Sharp 提交于
      The code to set the device removable bits in the USB 2.0 roothub
      descriptor was accidentally looking at the USB 3.0 port registers
      instead of the USB 2.0 registers.  This can cause an oops if there are
      more USB 2.0 registers than USB 3.0 registers.
      
      This should be backported to kernels as old as 2.6.39, that contain the
      commit 4bbb0ace "xhci: Return a USB 3.0
      hub descriptor for USB3 roothub."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      3278a55a
  23. 27 11月, 2011 1 次提交
  24. 01 11月, 2011 1 次提交
  25. 19 10月, 2011 1 次提交
    • S
      xHCI/USB: Make xHCI driver have a BOS descriptor. · 48e82361
      Sarah Sharp 提交于
      To add USB 3.0 link power management (LPM), we need to know what the U1
      and U2 exit latencies are for the xHCI host controller.  External USB 3.0
      hubs report these values through the SuperSpeed Capabilities descriptor in
      the BOS descriptor.  Make the USB 3.0 roothub for the xHCI host behave
      like an external hub and return the BOS descriptors.
      
      The U1 and U2 exit latencies will vary across each host controller, so we
      need to dynamically fill those values in by reading the exit latencies out
      of the xHC registers.  Make the roothub code in the USB core handle
      hub_control() returning the length of the data copied.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      48e82361
  26. 27 9月, 2011 3 次提交
  27. 20 9月, 2011 1 次提交
    • G
      USB: xhci: Set change bit when warm reset change is set. · 44f4c3ed
      Greg KH 提交于
      Sometimes, when a USB 3.0 device is disconnected, the Intel Panther
      Point xHCI host controller will report a link state change with the
      state set to "SS.Inactive".  This causes the xHCI host controller to
      issue a warm port reset, which doesn't finish before the USB core times
      out while waiting for it to complete.
      
      When the warm port reset does complete, and the xHC gives back a port
      status change event, the xHCI driver kicks khubd.  However, it fails to
      set the bit indicating there is a change event for that port because the
      logic in xhci-hub.c doesn't check for the warm port reset bit.
      
      After that, the warm port status change bit is never cleared by the USB
      core, and the xHC stops reporting port status change bits.  (The xHCI
      spec says it shouldn't report more port events until all change bits are
      cleared.) This means any port changes when a new device is connected
      will never be reported, and the port will seem "dead" until the xHCI
      driver is unloaded and reloaded, or the computer is rebooted.  Fix this
      by making the xHCI driver set the port change bit when a warm port reset
      change bit is set.
      
      A better solution would be to make the USB core handle warm port reset
      in differently, merging the current code with the standard port reset
      code that does an incremental backoff on the timeout, and tries to
      complete the port reset two more times before giving up.  That more
      complicated fix will be merged next window, and this fix will be
      backported to stable.
      
      This should be backported to kernels as old as 3.0, since that was the
      first kernel with commit a11496eb ("xHCI: warm reset support").
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      44f4c3ed
  28. 10 9月, 2011 1 次提交