1. 07 3月, 2015 2 次提交
    • M
      xhci: Workaround for PME stuck issues in Intel xhci · b8cb91e0
      Mathias Nyman 提交于
      The xhci in Intel Sunrisepoint and Cherryview platforms need a driver
      workaround for a Stuck PME that might either block PME events in suspend,
      or create spurious PME events preventing runtime suspend.
      
      Workaround is to clear a internal PME flag, BIT(28) in a vendor specific
      PMCTRL register at offset 0x80a4, in both suspend resume callbacks
      
      Without this, xhci connected usb devices might never be able to wake up the
      system from suspend, or prevent device from going to suspend (xhci d3)
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8cb91e0
    • A
      xhci: fix reporting of 0-sized URBs in control endpoint · 45ba2154
      Aleksander Morgado 提交于
      When a control transfer has a short data stage, the xHCI controller generates
      two transfer events: a COMP_SHORT_TX event that specifies the untransferred
      amount, and a COMP_SUCCESS event. But when the data stage is not short, only the
      COMP_SUCCESS event occurs. Therefore, xhci-hcd must set urb->actual_length to
      urb->transfer_buffer_length while processing the COMP_SUCCESS event, unless
      urb->actual_length was set already by a previous COMP_SHORT_TX event.
      
      The driver checks this by seeing whether urb->actual_length == 0, but this alone
      is the wrong test, as it is entirely possible for a short transfer to have an
      urb->actual_length = 0.
      
      This patch changes the xhci driver to rely on a new td->urb_length_set flag,
      which is set to true when a COMP_SHORT_TX event is received and the URB length
      updated at that stage.
      
      This fixes a bug which affected the HSO plugin, which relies on URBs with
      urb->actual_length == 0 to halt re-submitting the RX URB in the control
      endpoint.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45ba2154
  2. 25 2月, 2015 2 次提交
  3. 25 1月, 2015 1 次提交
  4. 10 1月, 2015 2 次提交
  5. 03 12月, 2014 2 次提交
  6. 22 11月, 2014 1 次提交
  7. 04 10月, 2014 3 次提交
  8. 24 9月, 2014 2 次提交
  9. 02 8月, 2014 1 次提交
    • H
      xhci: Blacklist using streams on the Etron EJ168 controller · 8f873c1f
      Hans de Goede 提交于
      Streams on the EJ168 do not work as they should. I've spend 2 days trying
      to get them to work, but without success.
      
      The first problem is that when ever you ring the stream-ring doorbell, the
      controller starts executing trbs at the beginning of the first ring segment,
      event if it ended somewhere else previously. This can be worked around by
      allowing enqueing only one td (not a problem with how streams are typically
      used) and then resetting our copies of the enqueueing en dequeueing pointers
      on a td completion to match what the controller seems to be doing.
      
      This way things seem to start working with uas and instead of being able
      to complete only the very first scsi command, the scsi core can probe the disk.
      
      But then things break later on when td-s get enqueued with more then one
      trb. The controller does seem to increase its dequeue pointer while executing
      a stream-ring (data transfer events I inserted for debugging do trigger).
      However execution seems to stop at the final normal trb of a multi trb td,
      even if there is a data transfer event inserted after the final trb.
      
      The first problem alone is a serious deviation from the spec, and esp.
      dealing with cancellation would have been very tricky if not outright
      impossible, but the second problem simply is a deal breaker altogether,
      so this patch simply disables streams.
      
      Note this will cause the usb-storage + uas driver pair to automatically switch
      to using usb-storage instead of uas on these devices, essentially reverting
      to the 3.14 and earlier behavior when uas was marked CONFIG_BROKEN.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1121288
      https://bugzilla.kernel.org/show_bug.cgi?id=80101
      
      Cc: stable@vger.kernel.org # 3.15
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f873c1f
  10. 28 5月, 2014 1 次提交
  11. 20 5月, 2014 5 次提交
    • 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: Add a global command queue · c9aa1a2d
      Mathias Nyman 提交于
      Create a list to store command structures, add a structure to it every time
      a command is submitted, and remove it from the list once we get a
      command completion event matching the command.
      
      Callers that wait for completion will free their command structures themselves.
      The other command structures are freed in the command completion event handler.
      
      Also add a check that prevents queuing commands if host is dying
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c9aa1a2d
    • 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
    • F
      usb: xhci: Use IS_ENABLED() macro · 961b3d0a
      Fabio Estevam 提交于
      Using the IS_ENABLED() macro can make the code shorter and easier to read.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      961b3d0a
  12. 26 4月, 2014 1 次提交
    • J
      usb: xhci: Prefer endpoint context dequeue pointer over stopped_trb · 1f81b6d2
      Julius Werner 提交于
      We have observed a rare cycle state desync bug after Set TR Dequeue
      Pointer commands on Intel LynxPoint xHCs (resulting in an endpoint that
      doesn't fetch new TRBs and thus an unresponsive USB device). It always
      triggers when a previous Set TR Dequeue Pointer command has set the
      pointer to the final Link TRB of a segment, and then another URB gets
      enqueued and cancelled again before it can be completed. Further
      investigation showed that the xHC had returned the Link TRB in the TRB
      Pointer field of the Transfer Event (CC == Stopped -- Length Invalid),
      but when xhci_find_new_dequeue_state() later accesses the Endpoint
      Context's TR Dequeue Pointer field it is set to the first TRB of the
      next segment.
      
      The driver expects those two values to be the same in this situation,
      and uses the cycle state of the latter together with the address of the
      former. This should be fine according to the XHCI specification, since
      the endpoint ring should be stopped when returning the Transfer Event
      and thus should not advance over the Link TRB before it gets restarted.
      However, real-world XHCI implementations apparently don't really care
      that much about these details, so the driver should follow a more
      defensive approach to try to work around HC spec violations.
      
      This patch removes the stopped_trb variable that had been used to store
      the TRB Pointer from the last Transfer Event of a stopped TRB. Instead,
      xhci_find_new_dequeue_state() now relies only on the Endpoint Context,
      requiring a small amount of additional processing to find the virtual
      address corresponding to the TR Dequeue Pointer. Some other parts of the
      function were slightly rearranged to better fit into this model.
      
      This patch should be backported to kernels as old as 2.6.31 that contain
      the commit ae636747 "USB: xhci: URB
      cancellation support."
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f81b6d2
  13. 05 3月, 2014 3 次提交
    • H
      xhci: For streams the dequeue ptr must be read from the stream ctx · 9aad95e2
      Hans de Goede 提交于
      This fixes TR dequeue validation failing on Intel XHCI controllers with the
      following warning:
      
      Mismatch between completed Set TR Deq Ptr command & xHCI internal state.
      
      Interestingly enough reading the deq ptr from the ep ctx after a
      TR Deq Ptr command does work on a Nec XHCI controller, it seems the Nec
      writes the ptr to both the ep and stream contexts when streams are used.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      9aad95e2
    • H
      xhci: Set SCT field for Set TR dequeue on streams · 95241dbd
      Hans de Goede 提交于
      Nec XHCI controllers don't seem to care, but without this Intel XHCI
      controllers reject Set TR dequeue commands with a COMP_TRB_ERR, leading
      to the following warning:
      
      WARN Set TR Deq Ptr cmd invalid because of stream ID configuration
      
      And very shortly after this the system completely freezes.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      95241dbd
    • G
      xhci: fix usb3 streams · 15341303
      Gerd Hoffmann 提交于
      xhci maintains a radix tree for each stream endpoint because it must
      be able to map a trb address to the stream ring.  Each ring segment
      must be added to the ring for this to work.  Currently xhci sticks
      only the first segment of each stream ring into the radix tree.
      
      Result is that things work initially, but as soon as the first segment
      is full xhci can't map the trb address from the completion event to the
      stream ring any more -> BOOM.  You'll find this message in the logs:
      
        ERROR Transfer event for disabled endpoint or incorrect stream ring
      
      This patch adds a helper function to update the radix tree, and a
      function to remove ring segments from the tree.  Both functions loop
      over the segment list and handles all segments instead of just the
      first.
      
      [Note: Sarah changed this patch to add radix_tree_maybe_preload() and
      radix_tree_preload_end() calls around the radix tree insert, since we
      can now insert entries in interrupt context.  There are now two helper
      functions to make the code cleaner, and those functions are moved to
      make them static.]
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      15341303
  14. 08 2月, 2014 1 次提交
  15. 31 1月, 2014 1 次提交
  16. 30 1月, 2014 1 次提交
    • S
      Revert "xhci: replace xhci_write_64() with writeq()" · 477632df
      Sarah Sharp 提交于
      This reverts commit 7dd09a1a.
      
      Many xHCI host controllers can only handle 32-bit addresses, and writing
      64-bits at a time causes them to fail.  Rafał reports that USB devices
      simply do not enumerate, and reverting this patch helps.  Branimir
      reports that his host controller doesn't respond to an Enable Slot
      command and dies:
      
      [   75.576160] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   88.991634] xhci_hcd 0000:03:00.0: Stopped the command ring failed, maybe the host is dead
      [   88.991748] xhci_hcd 0000:03:00.0: Abort command ring failed
      [   88.991845] xhci_hcd 0000:03:00.0: HC died; cleaning up
      [   93.985489] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   93.985494] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead.
      [   98.982586] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   98.982591] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead.
      [  103.979696] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [  103.979702] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Reported-by: NRafał Miłecki <zajec5@gmail.com>
      Reported-by: NBranimir Maksimovic <branimir.maksimovic@gmail.com>
      Cc: Xenia Ragiadakou <burzalodowa@gmail.com>
      477632df
  17. 09 1月, 2014 1 次提交
    • S
      xhci: Set scatter-gather limit to avoid failed block writes. · f2d9b991
      Sarah Sharp 提交于
      Commit 35773dac "usb: xhci: Link TRB
      must not occur within a USB payload burst" attempted to fix an issue
      found with USB ethernet adapters, and inadvertently broke USB storage
      devices.  The patch attempts to ensure that transfers never span a
      segment, and rejects transfers that have more than 63 entries (or
      possibly less, if some entries cross 64KB boundaries).
      
      usb-storage limits the maximum transfer size to 120K, and we had assumed
      the block layer would pass a scatter-gather list of 4K entries,
      resulting in no more than 31 sglist entries:
      
      http://marc.info/?l=linux-usb&m=138498190419312&w=2
      
      That assumption was wrong, since we've seen the driver reject a write
      that was 218 sectors long (of probably 512 bytes each):
      
      Jan  1 07:04:49 jidanni5 kernel: [  559.624704] xhci_hcd 0000:00:14.0: Too many fragments 79, max 63
      ...
      Jan  1 07:04:58 jidanni5 kernel: [  568.622583] Write(10): 2a 00 00 06 85 0e 00 00 da 00
      
      Limit the number of scatter-gather entries to half a ring segment.  That
      should be margin enough in case some entries cross 64KB boundaries.
      Increase the number of TRBs per segment from 64 to 256, which should
      result in ring segments fitting on a 4K page.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: jidanni@jidanni.org
      References: http://bugs.debian.org/733907
      Fixes: 35773dac ('usb: xhci: Link TRB must not occur within a USB payload burst')
      Cc: stable <stable@vger.kernel.org> # 3.12
      f2d9b991
  18. 11 12月, 2013 1 次提交
    • D
      usb: xhci: change enumeration scheme to 'new scheme' by default · 48fc7dbd
      Dan Williams 提交于
      Change the default enumeration scheme for xhci attached non-SuperSpeed
      devices from:
      
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(8)
         GetDescriptor(18)
      
      ...to:
      
         Reset
         [xhci address-device BSR = 1]
         GetDescriptor(64)
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(18)
      
      ...as some devices misbehave when encountering a SetAddress command
      prior to GetDescriptor.  There are known legacy devices that require
      this scheme, but testing has found at least one USB3 device that fails
      enumeration when presented with this ordering.  For now, follow the ehci
      case and enable 'new scheme' by default for non-SuperSpeed devices.
      
      To support this enumeration scheme on xhci the AddressDevice operation
      needs to be performed twice.  The first instance of the command enables
      the HC's device and slot context info for the device, but omits sending
      the device a SetAddress command (BSR == block set address request).
      Then, after GetDescriptor completes, follow up with the full
      AddressDevice+SetAddress operation.
      
      As mentioned before, this ordering of events with USB3 devices causes an
      extra state transition to be exposed to xhci.  Previously USB3 devices
      would transition directly from 'enabled' to 'addressed' and never need
      to underrun responses to 'get descriptor'. We do see the 64-byte
      descriptor fetch the correct data, but the following 18-byte descriptor
      read after the reset gets:
      
      bLength            = 0
      bDescriptorType    = 0
      bcdUSB             = 0
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      instead of:
      
      bLength            = 12
      bDescriptorType    = 1
      bcdUSB             = 300
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      which results in the discovery process looping until falling back to
      'old scheme' enumeration.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NDavid Moore <david.moore@gmail.com>
      Suggested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      48fc7dbd
  19. 03 12月, 2013 5 次提交
    • X
      xhci: replace xhci_write_64() with writeq() · 7dd09a1a
      Xenia Ragiadakou 提交于
      Function xhci_write_64() is used to write 64bit xHC registers residing in MMIO.
      On 32bit systems, xHC registers need to be written with 32bit accesses by
      writing first the lower 32bits and then the higher 32bits. The header file
      asm-generic/io-64-nonatomic-lo-hi.h ensures that on 32bit systems writeq() will
      will write 64bit registers in 32bit chunks with low-high order.
      
      Replace all calls to xhci_write_64() with calls to writeq().
      
      This is done to reduce code duplication since 64bit low-high write logic
      is already implemented and to take advantage of inherent "atomic" 64bit
      write operations on 64bit systems.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      7dd09a1a
    • X
      xhci: replace xhci_read_64() with readq() · e8b37332
      Xenia Ragiadakou 提交于
      Function xhci_read_64() is used to read 64bit xHC registers residing in MMIO.
      On 32bit systems, xHC registers need to be read with 32bit accesses by
      reading first the lower 32bits and then the higher 32bits.
      
      Replace all calls to xhci_read_64() with calls to readq() and include
      asm-generic/io-64-nonatomic-lo-hi.h header file, so that if the system
      is not 64bit, readq() will read registers in 32bit chunks with low-high order.
      
      This is done to reduce code duplication since 64bit low-high read logic
      is already implemented and to take advantage of inherent "atomic" 64bit
      read operations on 64bit systems.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      e8b37332
    • 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
    • X
      xhci: fix SCT_FOR_CTX(p) macro · 63a67a72
      Xenia Ragiadakou 提交于
      SCT_FOR_CTX(p) is defined as (((p) << 1) & 0x7) in which case if we want
      to set the stream context type to SCT_SSA_256 i.e 0x7 (although secondary
      stream arrays are not yet supported) using this macro definition we will
      get actually 0x6 which is not what we want.
      
      This patch fixes the above issue by defining the SCT_FOR_CTX(p) macro as
      (((p) & 0x7) << 1)
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      63a67a72
  20. 17 10月, 2013 2 次提交
    • D
      usb: xhci: remove the unused ->address field · a2cdc343
      Dan Williams 提交于
      Only used for debug output, so we don't need to save it.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      a2cdc343
    • S
      xhci: Set L1 device slot on USB2 LPM enable/disable. · 58e21f73
      Sarah Sharp 提交于
      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: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      58e21f73
  21. 10 10月, 2013 2 次提交
    • T
      xhci: Fix spurious wakeups after S5 on Haswell · 638298dc
      Takashi Iwai 提交于
      Haswell LynxPoint and LynxPoint-LP with the recent Intel BIOS show
      mysterious wakeups after shutdown occasionally.  After discussing with
      BIOS engineers, they explained that the new BIOS expects that the
      wakeup sources are cleared and set to D3 for all wakeup devices when
      the system is going to sleep or power off, but the current xhci driver
      doesn't do this properly (partly intentionally).
      
      This patch introduces a new quirk, XHCI_SPURIOUS_WAKEUP, for
      fixing the spurious wakeups at S5 by calling xhci_reset() in the xhci
      shutdown ops as done in xhci_stop(), and setting the device to PCI D3
      at shutdown and remove ops.
      
      The PCI D3 call is based on the initial fix patch by Oliver Neukum.
      
      [Note: Sarah changed the quirk name from XHCI_HSW_SPURIOUS_WAKEUP to
      XHCI_SPURIOUS_WAKEUP, since none of the other quirks have system names
      in them.  Sarah also fixed a collision with a quirk submitted around the
      same time, by changing the xhci->quirks bit from 17 to 18.]
      
      This patch should be backported to kernels as old as 3.0, that
      contain the commit 1c12443a "xhci: Add
      Lynx Point to list of Intel switchable hosts."
      
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      638298dc
    • O
      xhci: quirk for extra long delay for S4 · 455f5892
      Oliver Neukum 提交于
      It has been reported that this chipset really cannot
      sleep without this extraordinary delay.
      
      This patch should be backported, in order to ensure this host functions
      under stable kernels.  The last quirk for Fresco Logic hosts (commit
      bba18e33 "xhci: Extend Fresco Logic MSI
      quirk.") was backported to stable kernels as old as 2.6.36.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      455f5892