1. 10 7月, 2014 19 次提交
  2. 01 7月, 2014 1 次提交
  3. 25 6月, 2014 5 次提交
    • J
      usb: xhci: Correct last context entry calculation for Configure Endpoint · d6759133
      Julius Werner 提交于
      The current XHCI driver recalculates the Context Entries field in the
      Slot Context on every add_endpoint() and drop_endpoint() call. In the
      case of drop_endpoint(), it seems to assume that the add_flags will
      always contain every endpoint for the new configuration, which is not
      necessarily correct if you don't make assumptions about how the USB core
      uses the add_endpoint/drop_endpoint interface (add_flags only contains
      endpoints that are new additions in the new configuration).
      
      Furthermore, EP0_FLAG is not consistently set in add_flags throughout
      the lifetime of a device. This means that when all endpoints are
      dropped, the Context Entries field can be set to 0 (which is invalid and
      may cause a Parameter Error) or -1 (which is interpreted as 31 and
      causes the driver to keep using the old, incorrect value).
      
      The only surefire way to set this field right is to also take all
      existing endpoints into account, and to force the value to 1 (meaning
      only EP0 is active) if no other endpoint is found. This patch implements
      that as a single step in the final check_bandwidth() call and removes
      the intermediary calculations from add_endpoint() and drop_endpoint().
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6759133
    • W
      xhci: Fix runtime suspended xhci from blocking system suspend. · d6236f6d
      Wang, Yu 提交于
      The system suspend flow as following:
      1, Freeze all user processes and kenrel threads.
      
      2, Try to suspend all devices.
      
      2.1, If pci device is in RPM suspended state, then pci driver will try
      to resume it to RPM active state in the prepare stage.
      
      2.2, xhci_resume function calls usb_hcd_resume_root_hub to queue two
      workqueue items to resume usb2&usb3 roothub devices.
      
      2.3, Call suspend callbacks of devices.
      
      2.3.1, All suspend callbacks of all hcd's children, including
      roothub devices are called.
      
      2.3.2, Finally, hcd_pci_suspend callback is called.
      
      Due to workqueue threads were already frozen in step 1, the workqueue
      items can't be scheduled, and the roothub devices can't be resumed in
      this flow. The HCD_FLAG_WAKEUP_PENDING flag which is set in
      usb_hcd_resume_root_hub won't be cleared. Finally,
      hcd_pci_suspend will return -EBUSY, and system suspend fails.
      
      The reason why this issue doesn't show up very often is due to that
      choose_wakeup will be called in step 2.3.1. In step 2.3.1, if
      udev->do_remote_wakeup is not equal to device_may_wakeup(&udev->dev), then
      udev will resume to RPM active for changing the wakeup settings. This
      has been a lucky hit which hides this issue.
      
      For some special xHCI controllers which have no USB2 port, then roothub
      will not match hub driver due to probe failed. Then its
      do_remote_wakeup will be set to zero, and we won't be as lucky.
      
      xhci driver doesn't need to resume roothub devices everytime like in
      the above case. It's only needed when there are pending event TRBs.
      
      This patch should be back-ported to kernels as old as 3.2, that
      contains the commit f69e3120
      "USB: XHCI: resume root hubs when the controller resumes"
      
      Cc: stable@vger.kernel.org # 3.2
      Signed-off-by: NWang, Yu <yu.y.wang@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      [use readl() instead of removed xhci_readl(), reword commit message -Mathias]
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6236f6d
    • L
      xhci: clear root port wake on bits if controller isn't wake-up capable · ff8cbf25
      Lu Baolu 提交于
      When xHCI PCI host is suspended, if do_wakeup is false in xhci_pci_suspend,
      xhci_bus_suspend needs to clear all root port wake on bits. Otherwise some Intel
      platforms may get a spurious wakeup, even if PCI PME# is disabled.
      
      This patch should be back-ported to kernels as old as 2.6.37, that
      contains the commit 9777e3ce
      "USB: xHCI: bus power management implementation".
      
      Cc: stable@vger.kernel.org # 2.6.37
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ff8cbf25
    • M
      xhci: correct burst count field for isoc transfers on 1.0 xhci hosts · 3213b151
      Mathias Nyman 提交于
      The transfer burst count (TBC) field in xhci 1.0 hosts should be set
      to the number of bursts needed to transfer all packets in a isoc TD.
      Supported values are 0-2 (1 to 3 bursts per service interval).
      
      Formula for TBC calculation is given in xhci spec section 4.11.2.3:
      TBC = roundup( Transfer Descriptor Packet Count / Max Burst Size +1 ) - 1
      
      This patch should be applied to stable kernels since 3.0 that contain
      the commit 5cd43e33
      "xhci 1.0: Set transfer burst count field."
      
      Cc: stable@vger.kernel.org # 3.0
      Suggested-by: NShiChun Ma <masc2008@qq.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3213b151
    • M
      xhci: Use correct SLOT ID when handling a reset device command · 6fcfb0d6
      Mathias Nyman 提交于
      Command completion events normally include command completion status,
      SLOT_ID, and a pointer to the original command. Reset device command
      completion SLOT_ID may be zero according to xhci specs 4.6.11.
      
      VIA controllers set the SLOT_ID to zero, triggering a WARN_ON in the
      command completion handler.
      
      Use the SLOT ID found from the original command instead.
      
      This patch should be applied to stable kernels since 3.13 that contain
      the commit 20e7acb1
      "xhci: use completion event's slot id rather than dig it out of command"
      
      Cc: stable@vger.kernel.org # 3.13
      Reported-by: NSaran Neti <sarannmr@gmail.com>
      Tested-by: NSaran Neti <sarannmr@gmail.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fcfb0d6
  4. 18 6月, 2014 2 次提交
  5. 30 5月, 2014 3 次提交
  6. 29 5月, 2014 5 次提交
  7. 28 5月, 2014 5 次提交