1. 14 3月, 2011 2 次提交
    • S
      xhci: Rename variables and reduce register reads. · 518e848e
      Sarah Sharp 提交于
      The xhci_bus_suspend() and xhci_bus_resume() functions are a bit hard to
      read, because they have an ambiguously named variable "port".  Rename it
      to "port_index".  Introduce a new temporary variable, "max_ports" that
      holds the maximum number of roothub ports the host controller supports.
      This will reduce the number of register reads, and make it easy to change
      the maximum number of ports when there are two roothubs.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      518e848e
    • S
      xhci: Remove old no-op test. · 0b8ca72a
      Sarah Sharp 提交于
      The test of placing a number of command no-ops on the command ring and
      counting the number of no-op events that were generated was only used
      during the initial xHCI driver bring up.  This test is no longer used, so
      delete it.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      0b8ca72a
  2. 15 1月, 2011 7 次提交
  3. 12 11月, 2010 1 次提交
    • S
      xhci: Remove excessive printks with shared IRQs. · 241b652f
      Sarah Sharp 提交于
      If the xHCI host controller shares an interrupt line with another device,
      the xHCI driver needs to check if the interrupt was generated by its
      hardware.  Unfortunately, the user will see a ton of "Spurious interrupt."
      lines if the other hardware interrupts often.  Lawrence found his dmesg
      output cluttered with this output when the xHCI host shared an interrupt
      with his i915 hardware.
      
      Remove the warning, as sharing an interrupt is a normal thing.
      
      This should be applied to the 2.6.36 stable tree.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NLawrence Rust <lvr@softsystem.co.uk>
      Cc: stable@kernel.org
      241b652f
  4. 23 10月, 2010 2 次提交
    • A
      USB: xHCI: port remote wakeup implementation · 56192531
      Andiry Xu 提交于
      This commit implements port remote wakeup.
      
      When a port is in U3 state and resume signaling is detected from a device,
      the port transitions to the Resume state, and the xHC generates a Port Status
      Change Event.
      
      For USB3 port, software write a '0' to the PLS field to complete the resume
      signaling. For USB2 port, the resume should be signaling for at least 20ms,
      irq handler set a timer for port remote wakeup, and then finishes process in
      hub_control GetPortStatus.
      
      Some codes are borrowed from EHCI code.
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      56192531
    • A
      USB: xHCI: port power management implementation · be88fe4f
      Andiry Xu 提交于
      Add software trigger USB device suspend resume function hook.
      Do port suspend & resume in terms of xHCI spec.
      
      Port Suspend:
      Stop all endpoints via Stop Endpoint Command with Suspend (SP) flag set.
      Place individual ports into suspend mode by writing '3' for Port Link State
      (PLS) field into PORTSC register. This can only be done when the port is in
      Enabled state. When writing, the Port Link State Write Strobe (LWS) bit shall
      be set to '1'.
      Allocate an xhci_command and stash it in xhci_virt_device to wait completion for
      the last Stop Endpoint Command.  Use the Suspend bit in TRB to indicate the Stop
      Endpoint Command is for port suspend. Based on Sarah's suggestion.
      
      Port Resume:
      Write '0' in PLS field, device will transition to running state.
      Ring an endpoints' doorbell to restart it.
      
      Ref: USB device remote wake need another patch to implement. For details of
      how USB subsystem do power management, please see:
          Documentation/usb/power-management.txt
      Signed-off-by: NCrane Cai <crane.cai@amd.com>
      Signed-off-by: NLibin Yang <libin.yang@amd.com>
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      be88fe4f
  5. 24 8月, 2010 2 次提交
  6. 11 8月, 2010 17 次提交
  7. 27 7月, 2010 1 次提交
    • S
      USB: xHCI: Fix another bug in link TRB activation change. · d1dc908a
      Sarah Sharp 提交于
      Commit 6c12db90 also seems to have
      introduced a bug that is triggered when the command ring is about to wrap.
      The inc_enq() function will not have moved the enqueue pointer past the
      link TRB.  It is supposed to be moved past the link TRB in prepare_ring(),
      which should be called before a TD is enqueued.  However, the
      queue_command() function never calls the prepare_ring() function because
      prepare_ring() is only supposed to be used for endpoint rings.  That means
      the enqueue pointer will not be moved past the link TRB, and will get
      overwritten.
      
      The fix is to make queue_command() call prepare_ring() with a fake
      endpoint status (set to running).  Then the enqueue pointer will get moved
      past the link TRB.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d1dc908a
  8. 30 6月, 2010 1 次提交
    • S
      USB: xHCI: Fix bug in link TRB activation change. · 6cc30d85
      Sarah Sharp 提交于
      Commit 6c12db90 introduced a bug for
      control transfers.  The patch was supposed to change when the link TRBs at
      the end of each ring segment were given to the hardware.  If a transfer
      descriptor (TD) ended just before the link TRB, the code wouldn't give
      back the link TRB to the hardware; instead it would be given back in
      prepare_ring() just before the next TD was enqueued at the top of the
      ring.
      
      Unfortunately, the code relied on checking the chain bit of the TRB to
      determine whether the TD ended just before the link TRB.  It assumed that
      the ring enqueuing code would call prepare_ring() before enqueuing the
      next TD.  However, control transfers are made of multiple TDs, and
      prepare_ring() is only called once before enqueuing two or three TDs.
      
      If the first or second TD of the control transfer ended just before the
      link TRB, then the code in inc_enq() would not move the enqueue pointer
      past the link TRB, and the link TRB would get overwritten.  This would
      cause the xHCI driver to start writing to memory past the ring segment,
      and eventually the system would crash or hang.
      
      The fix is to add a flag to inc_enq() that says whether the caller will
      enqueue more TDs before calling prepare_ring().  If the chain bit is
      cleared (meaning this is the last TRB in a TD), and the caller will not
      enqueue more TDs, then we defer giving back the link TRB.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6cc30d85
  9. 05 6月, 2010 1 次提交
    • S
      USB: xhci: Print NEC firmware version. · 0238634d
      Sarah Sharp 提交于
      The NEC xHCI host controller firmware version can be found by putting a
      vendor-specific command on the command ring and extracting the BCD
      encoded-version out of the vendor-specific event TRB.
      
      The firmware version debug line in dmesg will look like:
      
      xhci_hcd 0000:05:00.0: NEC firmware version 30.21
      
      (NEC merged with Renesas Technologies and became Renesas Electronics on
      April 1, 2010.  I have their OK to merge this vendor-specific code.)
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Satoshi Otani <satoshi.otani.xm@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0238634d
  10. 21 5月, 2010 6 次提交