1. 01 8月, 2013 1 次提交
    • J
      usb: xhci: add missing dma-mapping.h includes · 008eb957
      James Hogan 提交于
      A randconfig build hit the following build errors because xhci.c and
      xhci-mem.c use dma mapping functions but don't include
      <linux/dma-mapping.h>. Add the missing includes to fix the build errors.
      
      drivers/usb/host/xhci.c In function 'xhci_gen_setup':
      drivers/usb/host/xhci.c +4872 : error: implicit declaration of function 'dma_set_mask'
      drivers/usb/host/xhci.c +4872 : error: implicit declaration of function 'DMA_BIT_MASK'
      
      drivers/usb/host/xhci-mem.c In function 'xhci_free_stream_ctx':
      drivers/usb/host/xhci-mem.c +435 : error: implicit declaration of function 'dma_free_coherent'
      drivers/usb/host/xhci-mem.c In function 'xhci_alloc_stream_ctx':
      drivers/usb/host/xhci-mem.c +463 : error: implicit declaration of function 'dma_alloc_coherent'
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      008eb957
  2. 25 7月, 2013 3 次提交
    • G
      usb: host: xhci: Enable XHCI_SPURIOUS_SUCCESS for all controllers with xhci 1.0 · 07f3cb7c
      George Cherian 提交于
      Xhci controllers with hci_version > 0.96 gives spurious success
      events on short packet completion. During webcam capture the
      "ERROR Transfer event TRB DMA ptr not part of current TD" was observed.
      The same application works fine with synopsis controllers hci_version 0.96.
      The same issue is seen with Intel Pantherpoint xhci controller. So enabling
      this quirk in xhci_gen_setup if controller verion is greater than 0.96.
      For xhci-pci move the quirk to much generic place xhci_gen_setup.
      
      Note from Sarah:
      
      The xHCI 1.0 spec changed how hardware handles short packets.  The HW
      will notify SW of the TRB where the short packet occurred, and it will
      also give a successful status for the last TRB in a TD (the one with the
      IOC flag set).  On the second successful status, that warning will be
      triggered in the driver.
      
      Software is now supposed to not assume the TD is not completed until it
      gets that last successful status.  That means we have a slight race
      condition, although it should have little practical impact.  This patch
      papers over that issue.
      
      It's on my long-term to-do list to fix this race condition, but it is a
      much more involved patch that will probably be too big for stable.  This
      patch is needed for stable to avoid serious log spam.
      
      This patch should be backported to kernels as old as 3.0, that
      contain the commit ad808333 "Intel xhci:
      Ignore spurious successful event."
      
      The patch will have to be modified for kernels older than 3.2, since
      that kernel added the xhci_gen_setup function for xhci platform devices.
      The correct conflict resolution for kernels older than 3.2 is to set
      XHCI_SPURIOUS_SUCCESS in xhci_pci_quirks for all xHCI 1.0 hosts.
      Signed-off-by: NGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      07f3cb7c
    • O
      usb: xhci: Mark two functions __maybe_unused · d5c82feb
      Olof Johansson 提交于
      Resolves the following build warnings:
      drivers/usb/host/xhci.c:332:13: warning: 'xhci_msix_sync_irqs' defined but not used [-Wunused-function]
      drivers/usb/host/xhci.c:3901:12: warning: 'xhci_change_max_exit_latency' defined but not used [-Wunused-function]
      
      These functions are not always used, and since they're marked static
      they will produce build warnings:
      - xhci_msix_sync_irqs is only used with CONFIG_PCI.
      - xhci_change_max_exit_latency is a little more complicated with
        dependencies on CONFIG_PM and CONFIG_PM_RUNTIME.
      
      Instead of building a bigger maze of ifdefs in this code, I've just
      marked both with __maybe_unused.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      d5c82feb
    • S
      xhci: Avoid NULL pointer deref when host dies. · 203a8661
      Sarah Sharp 提交于
      When the host controller fails to respond to an Enable Slot command, and
      the host fails to respond to the register write to abort the command
      ring, the xHCI driver will assume the host is dead, and call
      usb_hc_died().
      
      The USB device's slot_id is still set to zero, and the pointer stored at
      xhci->devs[0] will always be NULL.  The call to xhci_check_args in
      xhci_free_dev should have caught the NULL virt_dev pointer.
      
      However, xhci_free_dev is designed to free the xhci_virt_device
      structures, even if the host is dead, so that we don't leak kernel
      memory.  xhci_free_dev checks the return value from the generic
      xhci_check_args function.  If the return value is -ENODEV, it carries on
      trying to free the virtual device.
      
      The issue is that xhci_check_args looks at the host controller state
      before it looks at the xhci_virt_device pointer.  It will return -ENIVAL
      because the host is dead, and xhci_free_dev will ignore the return
      value, and happily dereference the NULL xhci_virt_device pointer.
      
      The fix is to make sure that xhci_check_args checks the xhci_virt_device
      pointer before it checks the host state.
      
      See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1203453 for
      further details.  This patch doesn't solve the underlying issue, but
      will ensure we don't see any more NULL pointer dereferences because of
      the issue.
      
      This patch should be backported to kernels as old as 3.1, that
      contain the commit 7bd89b40 "xhci: Don't
      submit commands or URBs to halted hosts."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NVincent Thiele <vincentthiele@gmail.com>
      Cc: stable@vger.kernel.org
      203a8661
  3. 26 6月, 2013 1 次提交
  4. 15 6月, 2013 1 次提交
  5. 06 6月, 2013 6 次提交
  6. 25 5月, 2013 2 次提交
    • S
      xhci: Disable D3cold for buggy TI redrivers. · c3897aa5
      Sarah Sharp 提交于
      Some xHCI hosts contain a "redriver" from TI that silently drops port
      status connect changes if the port slips into Compliance Mode.  If the
      port slips into compliance mode while the host is in D0, there will not
      be a port status change event.  If the port slips into compliance mode
      while the host is in D3, the host will not send a PME.  This includes
      when the system is suspended (S3) or hibernated (S4).
      
      If this happens when the system is in S3/S4, there is nothing software
      can do.  Other port status change events that would normally cause the
      host to wake the system from S3/S4 may also be lost.  This includes
      remote wakeup, disconnects and connects on other ports, and overrcurrent
      events.  A decision was made to _NOT_ disable system suspend/hibernate
      on these systems, since users are unlikely to enable wakeup from S3/S4
      for the xHCI host.
      
      Software can deal with this issue when the system is in S0.  A work
      around was put in to poll the port status registers for Compliance Mode.
      The xHCI driver will continue to poll the registers while the host is
      runtime suspended.  Unfortunately, that means we can't allow the PCI
      device to go into D3cold, because power will be removed from the host,
      and the config space will read as all Fs.
      
      Disable D3cold in the xHCI PCI runtime suspend function.
      
      This patch should be backported to kernels as old as 3.2, that
      contain the commit 71c731a2 "usb: host:
      xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: stable@vger.kernel.org
      c3897aa5
    • T
      xhci - correct comp_mode_recovery_timer on return from hibernate · 77df9e0b
      Tony Camuso 提交于
      Commit 71c731a2 (usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP
      Hardware) was a workaround for systems using the SN65LVPE502CP,
      controller, but it introduced a bug in resume from hibernate.
      
      The fix created a timer, comp_mode_recovery_timer, which is deleted from
      a timer list when xhci_suspend() is called. However, the hibernate image,
      including the timer list containing the comp_mode_recovery_timer, had
      already been saved before the timer was deleted.
      
      Upon resume from hibernate, the list containing the comp_mode_recovery_timer
      is restored from the image saved to disk, and xhci_resume(), assuming that
      the timer had been deleted by xhci_suspend(), makes a call to
      compliance_mode_recoery_timer_init(), which creates a new instance of the
      comp_mode_recovery_timer and attempts to place it into the same list in which
      it is already active, thus corrupting the list during the list_add() call.
      
      At this point, a call trace is emitted indicating the list corruption.
      Soon afterward, the system locks up, the watchdog times out, and the
      ensuing NMI crashes the system.
      
      The problem did not occur when resuming from suspend. In suspend, the
      image in RAM remains exactly as it was when xhci_suspend() deleted the
      comp_mode_recovery_timer, so there is no problem when xhci_resume()
      creates a new instance of this timer and places it in the still empty
      list.
      
      This patch avoids the problem by deleting the timer in xhci_resume()
      when resuming from hibernate. Now xhci_resume() can safely make the
      call to create a new instance of this timer, whether returning from
      suspend or hibernate.
      
      Thanks to Alan Stern for his help with understanding the problem.
      
      [Sarah reworked this patch to cover the case where the xHCI restore
      register operation fails, and (temp & STS_SRE) is true (and we re-init
      the host, including re-init for the compliance mode), but hibernate is
      false.  The original patch would have caused list corruption in this
      case.]
      
      This patch should be backported to kernels as old as 3.2, that
      contain the commit 71c731a2 "usb: host:
      xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
      Signed-off-by: NTony Camuso <tcamuso@redhat.com>
      Tested-by: NTony Camuso <tcamuso@redhat.com>
      Acked-by: NDon Zickus <dzickus@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      77df9e0b
  7. 08 4月, 2013 1 次提交
  8. 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
  9. 26 3月, 2013 1 次提交
    • L
      usb: add find_raw_port_number callback to struct hc_driver() · 3f5eb141
      Lan Tianyu 提交于
      xhci driver divides the root hub into two logical hubs which work
      respectively for usb 2.0 and usb 3.0 devices. They are independent
      devices in the usb core. But in the ACPI table, it's one device node
      and all usb2.0 and usb3.0 ports are under it. Binding usb port with
      its acpi node needs the raw port number which is reflected in the xhci
      extended capabilities table. This patch is to add find_raw_port_number
      callback to struct hc_driver(), fill it with xhci_find_raw_port_number()
      which will return raw port number and add a wrap usb_hcd_find_raw_port_number().
      
      Otherwise, refactor xhci_find_real_port_number(). Using
      xhci_find_raw_port_number() to get real index in the HW port status
      registers instead of scanning through the xHCI roothub port array.
      This can help to speed up.
      
      All addresses in xhci->usb2_ports and xhci->usb3_ports array are
      kown good ports and don't include following bad ports in the extended
      capabilities talbe.
           (1) root port that doesn't have an entry
           (2) root port with unknown speed
           (3) root port that is listed twice and with different speeds.
      
      So xhci_find_raw_port_number() will only return port num of good ones
      and never touch bad ports above.
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      3f5eb141
  10. 16 3月, 2013 1 次提交
  11. 04 1月, 2013 1 次提交
    • 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
  12. 13 11月, 2012 4 次提交
  13. 26 10月, 2012 2 次提交
  14. 24 10月, 2012 2 次提交
  15. 18 10月, 2012 1 次提交
  16. 25 9月, 2012 2 次提交
  17. 14 9月, 2012 4 次提交
    • F
      usb: host: xhci: sparse fixes · ed384bd3
      Felipe Balbi 提交于
      drivers/usb/host/xhci.c:1826:14: warning: symbol 'xhci_get_block_size' was not declared. Should it be static?
      drivers/usb/host/xhci.c:1844:14: warning: symbol 'xhci_get_largest_overhead' was not declared. Should it be static?
      drivers/usb/host/xhci-ring.c:2304:36: warning: context imbalance in 'handle_tx_event' - unexpected unlock
      drivers/usb/host/xhci-hub.c:425:6: warning: symbol 'xhci_set_remote_wake_mask' was not declared. Should it be static?
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      ed384bd3
    • E
      xHCI: cancel command after command timeout · 6e4468b9
      Elric Fu 提交于
      The patch is used to cancel command when the command isn't
      acknowledged and a timeout occurs.
      
      This patch should be backported to kernels as old as 3.0, that contain
      the commit 7ed603ec "xhci: Add an
      assertion to check for virt_dev=0 bug." That commit papers over a NULL
      pointer dereference, and this patch fixes the underlying issue that
      caused the NULL pointer dereference.
      Signed-off-by: NElric Fu <elricfu1@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NMiroslav Sabljic <miroslav.sabljic@avl.com>
      Cc: stable@vger.kernel.org
      6e4468b9
    • E
      xHCI: add aborting command ring function · b92cc66c
      Elric Fu 提交于
      Software have to abort command ring and cancel command
      when a command is failed or hang. Otherwise, the command
      ring will hang up and can't handle the others. An example
      of a command that may hang is the Address Device Command,
      because waiting for a SET_ADDRESS request to be acknowledged
      by a USB device is outside of the xHC's ability to control.
      
      To cancel a command, software will initialize a command
      descriptor for the cancel command, and add it into a
      cancel_cmd_list of xhci.
      
      Sarah: Fixed missing newline on "Have the command ring been stopped?"
      debugging statement.
      
      This patch should be backported to kernels as old as 3.0, that contain
      the commit 7ed603ec "xhci: Add an
      assertion to check for virt_dev=0 bug." That commit papers over a NULL
      pointer dereference, and this patch fixes the underlying issue that
      caused the NULL pointer dereference.
      Signed-off-by: NElric Fu <elricfu1@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NMiroslav Sabljic <miroslav.sabljic@avl.com>
      Cc: stable@vger.kernel.org
      b92cc66c
    • E
      xHCI: add cmd_ring_state · c181bc5b
      Elric Fu 提交于
      Adding cmd_ring_state for command ring. It helps to verify
      the current command ring state for controlling the command
      ring operations.
      
      This patch should be backported to kernels as old as 3.0.  The commit
      7ed603ec "xhci: Add an assertion to
      check for virt_dev=0 bug." papers over the NULL pointer dereference that
      I now believe is related to a timed out Set Address command.  This (and
      the four patches that follow it) contain the real fix that also allows
      VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug
      stress tests.
      Signed-off-by: NElric Fu <elricfu1@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NMiroslav Sabljic <miroslav.sabljic@avl.com>
      Cc: stable@vger.kernel.org
      c181bc5b
  18. 06 9月, 2012 2 次提交
    • 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
    • D
      xhci: Fix a logical vs bitwise AND bug · 052c7f9f
      Dan Carpenter 提交于
      The intent was to test whether the flag was set.
      
      This patch should be backported to stable kernels as old as 3.0, since
      it fixes a bug in commit e95829f4 "xhci:
      Switch PPT ports to EHCI on shutdown.", which was marked for stable.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      052c7f9f
  19. 10 8月, 2012 1 次提交
    • S
      xhci: Switch PPT ports to EHCI on shutdown. · e95829f4
      Sarah Sharp 提交于
      The Intel desktop boards DH77EB and DH77DF have a hardware issue that
      can be worked around by BIOS.  If the USB ports are switched to xHCI on
      shutdown, the xHCI host will send a spurious interrupt, which will wake
      the system.  Some BIOS will work around this, but not all.
      
      The bug can be avoided if the USB ports are switched back to EHCI on
      shutdown.  The Intel Windows driver switches the ports back to EHCI, so
      change the Linux xHCI driver to do the same.
      
      Unfortunately, we can't tell the two effected boards apart from other
      working motherboards, because the vendors will change the DMI strings
      for the DH77EB and DH77DF boards to their own custom names.  One example
      is Compulab's mini-desktop, the Intense-PC.  Instead, key off the
      Panther Point xHCI host PCI vendor and device ID, and switch the ports
      over for all PPT xHCI hosts.
      
      The only impact this will have on non-effected boards is to add a couple
      hundred milliseconds delay on boot when the BIOS has to switch the ports
      over from EHCI to xHCI.
      
      This patch should be backported to kernels as old as 3.0, that contain
      the commit 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NDenis Turischev <denis@compulab.co.il>
      Tested-by: NDenis Turischev <denis@compulab.co.il>
      Cc: stable@vger.kernel.org
      e95829f4
  20. 08 8月, 2012 1 次提交
  21. 07 7月, 2012 1 次提交
    • H
      usbdevfs: Add a USBDEVFS_GET_CAPABILITIES ioctl · 19181bc5
      Hans de Goede 提交于
      There are a few (new) usbdevfs capabilities which an application cannot
      discover in any other way then checking the kernel version. There are 3
      problems with this:
      1) It is just not very pretty.
      2) Given the tendency of enterprise distros to backport stuff it is not
      reliable.
      3) As discussed in length on the mailinglist, USBDEVFS_URB_BULK_CONTINUATION
      does not work as it should when combined with USBDEVFS_URB_SHORT_NOT_OK
      (which is its intended use) on devices attached to an XHCI controller.
      So the availability of these features can be host controller dependent,
      making depending on them based on the kernel version not a good idea.
      
      This patch besides adding the new ioctl also adds flags for the following
      existing capabilities:
      
      USBDEVFS_CAP_ZERO_PACKET,        available since 2.6.31
      USBDEVFS_CAP_BULK_CONTINUATION,  available since 2.6.32, except for XHCI
      USBDEVFS_CAP_NO_PACKET_SIZE_LIM, available since 3.3
      
      Note that this patch only does not advertise the USBDEVFS_URB_BULK_CONTINUATION
      cap for XHCI controllers, bulk transfers with this flag set will still be
      accepted when submitted to XHCI controllers.
      
      Returning -EINVAL for them would break existing apps, and in most cases the
      troublesome scenario wrt USBDEVFS_URB_SHORT_NOT_OK urbs on XHCI controllers
      will never get hit, so this would break working use cases.
      
      The disadvantage of not returning -EINVAL is that cases were it is causing
      real trouble may go undetected / the cause of the trouble may be unclear,
      but this is the best we can do.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19181bc5
  22. 14 6月, 2012 1 次提交
    • A
      xHCI: Increase the timeout for controller save/restore state operation · 622eb783
      Andiry Xu 提交于
      When system software decides to power down the xHC with the intent of
      resuming operation at a later time, it will ask xHC to save the internal
      state and restore it when resume to correctly recover from a power event.
      Two bits are used to enable this operation: Save State and Restore State.
      
      xHCI spec 4.23.2 says software should "Set the Controller Save/Restore
      State flag in the USBCMD register and wait for the Save/Restore State
      Status flag in the USBSTS register to transition to '0'". However, it does
      not define how long software should wait for the SSS/RSS bit to transition
      to 0.
      
      Currently the timeout is set to 1ms. There is bug report
      (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1002697)
      indicates that the timeout is too short for ASMedia ASM1042 host controller
      to save/restore the state successfully. Increase the timeout to 10ms helps to
      resolve the issue.
      
      This patch should be backported to stable kernels as old as 2.6.37, that
      contain the commit 5535b1d5 "USB: xHCI:
      PCI power management implementation"
      Signed-off-by: NAndiry Xu <andiry.xu@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: stable@vger.kernel.org
      622eb783