1. 22 11月, 2012 6 次提交
  2. 16 11月, 2012 7 次提交
  3. 15 11月, 2012 6 次提交
  4. 14 11月, 2012 4 次提交
  5. 13 11月, 2012 7 次提交
    • F
      usb: host: xhci: move HC_STATE_SUSPENDED check to xhci_suspend() · 77b84767
      Felipe Balbi 提交于
      that check will have to be done by all users
      of xhci_suspend() so it sounds a lot better to
      move the check to xhci_suspend() in order to
      avoid code duplication.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      77b84767
    • A
      usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch · b0e4e606
      Alexis R. Cortes 提交于
      This minor patch creates a more stricter conditional for the Z1 sytems for applying
      the Compliance Mode Patch, this to avoid the quirk to be applied to models that
      contain a "Z1" in their dmi product string but are different from Z1 systems.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 71c731a2 "usb: host:
      xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
      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
      b0e4e606
    • S
      xhci: Extend Fresco Logic MSI quirk. · bba18e33
      Sarah Sharp 提交于
      Ali reports that plugging a device into the Fresco Logic xHCI host with
      PCI device ID 1400 produces an IRQ error:
      
       do_IRQ: 3.176 No irq handler for vector (irq -1)
      
      Other early Fresco Logic host revisions don't support MSI, even though
      their PCI config space claims they do.  Extend the quirk to disabling
      MSI to this chipset revision.  Also enable the short transfer quirk,
      since it's likely this revision also has that quirk, and it should be
      harmless to enable.
      
      04:00.0 0c03: 1b73:1400 (rev 01) (prog-if 30 [XHCI])
              Subsystem: 1d5c:1000
              Physical Slot: 3
              Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
              Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
              Latency: 0, Cache Line Size: 64 bytes
              Interrupt: pin A routed to IRQ 51
              Region 0: Memory at d4600000 (32-bit, non-prefetchable) [size=64K]
              Capabilities: [50] Power Management version 3
                      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
              Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
                      Address: 00000000feeff00c  Data: 41b1
              Capabilities: [80] Express (v1) Endpoint, MSI 00
                      DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <2us, L1 <32us
                              ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                      DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                              RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                              MaxPayload 128 bytes, MaxReadReq 512 bytes
                      DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                      LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                              ClockPM- Surprise- LLActRep- BwNot-
                      LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                              ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                      LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
              Kernel driver in use: xhci_hcd
      
      This patch should be backported to stable kernels as old as 2.6.36, that
      contain the commit f5182b41 "xhci:
      Disable MSI for some Fresco Logic hosts."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NA Sh <smr.ash1991@gmail.com>
      Tested-by: NA Sh <smr.ash1991@gmail.com>
      Cc: stable@vger.kernel.org
      bba18e33
    • J
      xhci: fix null-pointer dereference when destroying half-built segment rings · 68e5254a
      Julius Werner 提交于
      xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
      the tail to head at the end (forming a ring). When it bails out for OOM
      reasons half-way through, it tries to destroy its half-built list with
      xhci_free_segments_for_ring(), even though it is not a ring yet. This
      causes a null-pointer dereference upon hitting the last element.
      
      Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
      the output parameters to be valid upon this kind of OOM failure, and
      calls xhci_ring_free() on them. Since the (incomplete) list/ring should
      already be destroyed in that case, this would lead to a use after free.
      
      This patch fixes those issues by having xhci_alloc_segments_for_ring()
      destroy its half-built, non-circular list manually and destroying the
      invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().
      
      This patch should be backported to kernels as old as 2.6.31, that
      contains the commit 0ebbab37 "USB: xhci:
      Ring allocation and initialization."
      
      A separate patch will need to be developed for kernels older than 3.4,
      since the ring allocation code was refactored in that kernel.
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      68e5254a
    • S
      xHCI: Fix TD Size calculation on 1.0 hosts. · 4525c0a1
      Sarah Sharp 提交于
      The xHCI 1.0 specification made a change to the TD Size field in TRBs.
      The value is now the number of packets that remain to be sent in the TD,
      not including this TRB.  The TD Size value for the last TRB in a TD must
      always be zero.
      
      The xHCI function xhci_v1_0_td_remainder() attempts to calculate this,
      but it gets it wrong.  First, it erroneously reuses the old
      xhci_td_remainder function, which will right shift the value by 10.  The
      xHCI 1.0 spec as of June 2011 says nothing about right shifting by 10.
      Second, it does not set the TD size for the last TRB in a TD to zero.
      
      Third, it uses roundup instead of DIV_ROUND_UP.  The total packet count
      is supposed to be the total number of bytes in this TD, divided by the
      max packet size, rounded up.  DIV_ROUND_UP is the right function to use
      in that case.
      
      With the old code, a TD on an endpoint with max packet size 1024 would
      be set up like so:
      TRB 1, TRB length = 600 bytes, TD size = 0
      TRB 1, TRB length = 200 bytes, TD size = 0
      TRB 1, TRB length = 100 bytes, TD size = 0
      
      With the new code, the TD would be set up like this:
      TRB 1, TRB length = 600 bytes, TD size = 1
      TRB 1, TRB length = 200 bytes, TD size = 1
      TRB 1, TRB length = 100 bytes, TD size = 0
      
      This commit should be backported to kernels as old as 3.0, that contain
      the commit 4da6e6f2 "xhci 1.0: Update TD
      size field format."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NChintan Mehta <chintan.mehta@sibridgetech.com>
      Reported-by: NShimmer Huang <shimmering.h@gmail.com>
      Tested-by: NBhavik Kothari <bhavik.kothari@sibridgetech.com>
      Tested-by: NShimmer Huang <shimmering.h@gmail.com>
      Cc: stable@vger.kernel.org
      4525c0a1
    • S
      xhci: Fix conditional check in bandwidth calculation. · 392a07ae
      Sarah Sharp 提交于
      David reports that at drivers/usb/host/xhci.c:2257:
      
      static bool xhci_is_sync_in_ep(unsigned int ep_type)
      {
          return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
      }
      
      The static analyser cppcheck says
      
      [linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true.
      
      Maybe the original programmer intention was something like
      
      static bool xhci_is_sync_in_ep(unsigned int ep_type)
      {
          return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
      }
      
      Fix this.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 2b698999 "xhci: USB
      3.0 BW checking."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Cc: stable@vger.kernel.org
      392a07ae
    • S
      xhci: Avoid global symbol pollution with handshake. · 2611bd18
      Sarah Sharp 提交于
      Non-static xHCI driver symbols should start with the "xhci_" prefix, in
      order to avoid namespace pollution.  Rename the "handshake" function to
      "xhci_handshake".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NBen Hutchings <ben@decadent.org.uk>
      2611bd18
  6. 12 11月, 2012 4 次提交
    • A
      USB: report submission of active URBs · 2f02bc8a
      Alan Stern 提交于
      This patch (as1633) changes slightly the way usbcore handled
      submissions of URBs that are already active.  It will now return
      -EBUSY rather than -EINVAL, and it will call WARN_ONCE to draw
      people's attention to the bug.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f02bc8a
    • A
      USB: EHCI: bugfix: urb->hcpriv should not be NULL · 2656a9ab
      Alan Stern 提交于
      This patch (as1632b) fixes a bug in ehci-hcd.  The USB core uses
      urb->hcpriv to determine whether or not an URB is active; host
      controller drivers are supposed to set this pointer to a non-NULL
      value when an URB is queued.  However ehci-hcd sets it to NULL for
      isochronous URBs, which defeats the check in usbcore.
      
      In itself this isn't a big deal.  But people have recently found that
      certain sequences of actions will cause the snd-usb-audio driver to
      reuse URBs without waiting for them to complete.  In the absence of
      proper checking by usbcore, the URBs get added to their endpoint list
      twice.  This leads to list corruption and a system freeze.
      
      The patch makes ehci-hcd assign a meaningful value to urb->hcpriv for
      isochronous URBs.  Improving robustness always helps.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NArtem S. Tashkinov <t.artem@lycos.com>
      Reported-by: NChristof Meerwald <cmeerw@cmeerw.org>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2656a9ab
    • A
      USB: EHCI: miscellaneous cleanups for the library conversion · 1b36810e
      Alan Stern 提交于
      This patch (as1630) cleans up a few minor items resulting from the
      split-up of the ehci-hcd driver:
      
      	Remove the product_desc string from the ehci_driver_overrides
      	structure.  All drivers will use the generic "EHCI Host
      	Controller" string.  (This was requested by Felipe Balbi.)
      
      	Allow drivers to pass a NULL pointer to ehci_init_driver()
      	if they don't have to override any settings.
      
      	Remove a #define symbol that is no longer used from the
      	ChipIdea host driver.
      
      	Rename overrides to pci_overrides in ehci-pci.c, for
      	consistency with ehci-platform.c.
      
      	Mark the *_overrides structures as __initdata.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1b36810e
    • A
      USB: fix endpoint-disabling for failed config changes · 36caff5d
      Alan Stern 提交于
      This patch (as1631) fixes a bug that shows up when a config change
      fails for a device under an xHCI controller.  The controller needs to
      be told to disable the endpoints that have been enabled for the new
      config.  The existing code does this, but before storing the
      information about which endpoints were enabled!  As a result, any
      second attempt to install the new config is doomed to fail because
      xhci-hcd will refuse to enable an endpoint that is already enabled.
      
      The patch optimistically initializes the new endpoints' device
      structures before asking the device to switch to the new config.  If
      the request fails then the endpoint information is already stored, so
      we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
      trouble.  The rest of the error path is slightly more complex now; we
      have to disable the new interfaces and call put_device() rather than
      simply deallocating them.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NMatthias Schniedermeyer <ms@citd.de>
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36caff5d
  7. 09 11月, 2012 1 次提交
  8. 08 11月, 2012 5 次提交