1. 27 2月, 2012 1 次提交
  2. 13 2月, 2012 1 次提交
  3. 26 1月, 2012 1 次提交
  4. 25 1月, 2012 5 次提交
  5. 20 1月, 2012 2 次提交
  6. 16 1月, 2012 1 次提交
  7. 13 1月, 2012 1 次提交
  8. 11 1月, 2012 1 次提交
    • S
      xhci: Fix USB 3.0 device restart on resume. · d0cd5d48
      Sarah Sharp 提交于
      The xHCI hub port code gets passed a zero-based port number by the USB
      core.  It then adds one to in order to find a device slot by port number
      and device speed by calling xhci_find_slot_id_by_port.  That function
      clearly states it requires a one-based port number.  The xHCI port
      status change event handler was using a zero-based port number that it
      got from find_faked_portnum_from_hw_portnum, not a one-based port
      number.  This lead to the doorbells never being rung for a device after
      a resume, or worse, a different device with the same speed having its
      doorbell rung (which could lead to bad power management in the xHCI host
      controller).
      
      This patch should be backported to kernels as old as 2.6.39.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      d0cd5d48
  9. 05 1月, 2012 4 次提交
    • S
      xhci: Clean up 32-bit build warnings. · e910b440
      Sarah Sharp 提交于
      Randy Dunlap points out that commit 9258c0b2 "xhci: Better debugging for
      critical host errors." introduces some new build warnings on 32-bit
      builds:
      
      drivers/usb/host/xhci-ring.c:1936:3: warning: format '%016llx' expects type 'long long unsigned int', but argument 3 has type 'dma_addr_t'
      drivers/usb/host/xhci-ring.c:1958:3: warning: format '%016llx' expects type 'long long unsigned int', but argument 3 has type 'dma_addr_t'
      
      Cast the results of xhci_trb_virt_to_dma() from a dma_addr_t to an
      unsigned long long.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NRandy Dunlap <rdunlap@xenotime.net>
      e910b440
    • J
      drivers/usb/host/isp1760-if.c: introduce missing kfree · 30a0dee7
      Julia Lawall 提交于
      drvdata needds to be freed before leaving the function in an error case.
      
      A simplified version of the semantic match that finds the problem is as
      follows: (http://coccinelle.lip6.fr)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      identifier f1;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      x->f1
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      30a0dee7
    • F
      usb: ch9: fix up MaxStreams helper · 18b7ede5
      Felipe Balbi 提交于
      According to USB 3.0 Specification Table 9-22, if
      bmAttributes [4:0] are set to zero, it means "no
      streams supported", but the way this helper was
      defined on Linux, we will *always* have one stream
      which might cause several problems.
      
      For example on DWC3, we would tell the controller
      endpoint has streams enabled and yet start transfers
      with Stream ID set to 0, which would goof up the host
      side.
      
      While doing that, convert the macro to an inline
      function due to the different checks we now need.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      18b7ede5
    • H
      xhci: Properly handle COMP_2ND_BW_ERR · 71d85724
      Hans de Goede 提交于
      I encountered a result of COMP_2ND_BW_ERR while improving how the pwc
      webcam driver handles not having the full usb1 bandwidth available to
      itself.
      
      I created the following test setup, a NEC xhci controller with a
      single TT USB 2 hub plugged into it, with a usb keyboard and a pwc webcam
      plugged into the usb2 hub. This caused the following to show up in dmesg
      when trying to stream from the pwc camera at its highest alt setting:
      
      xhci_hcd 0000:01:00.0: ERROR: unexpected command completion code 0x23.
      usb 6-2.1: Not enough bandwidth for altsetting 9
      
      And usb_set_interface returned -EINVAL, which caused my pwc code to not
      do the right thing as it expected -ENOSPC.
      
      This patch makes the xhci driver properly handle COMP_2ND_BW_ERR and makes
      usb_set_interface return -ENOSPC as expected.
      
      This should be backported to stable kernels as old as 2.6.32.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      71d85724
  10. 03 1月, 2012 1 次提交
    • S
      xhci: Better debugging for critical host errors. · 9258c0b2
      Sarah Sharp 提交于
      When a host controller gives a bad event TRB, we should print out the
      contents of the TRB as a warning so that users don't have to recompile
      their kernel to get information about what went wrong.  Also, print out
      the event ring if they have xHCI debugging turned on, since previous
      events can often explain what happened before the bad TRB occurred.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      9258c0b2
  11. 23 12月, 2011 9 次提交
  12. 22 12月, 2011 1 次提交
    • D
      USB: Fix usb/isp1760 build on sparc · abf058e1
      David Miller 提交于
      This commit:
      
      commit 8f5d6215
      Author: Joachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Date:   Mon Oct 10 18:06:54 2011 +0200
      
          usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
      
          To be able to use the driver on other OF-aware architectures, too.
          And add necessary OF related #includes to fix compilation error.
      Signed-off-by: NJoachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      enabled the build on all CONFIG_OF architectures, but it cannot do
      this.
      
      This driver depends upon CONFIG_OF_IRQ but not all CONFIG_OF platforms
      support that infrastructure, in particular Sparc does not so the
      build fails.
      
      Please push a patch like the following to Linus so that this code only
      gets built where it actually should.
      
      --------------------
      usb/isp1760: Add missing CONFIG_OF_IRQ dependency on OF code.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      abf058e1
  13. 20 12月, 2011 1 次提交
  14. 16 12月, 2011 1 次提交
  15. 14 12月, 2011 1 次提交
  16. 10 12月, 2011 4 次提交
    • T
      USB: pxa168: Fix compilation error · 35657c4d
      Tanmay Upadhyay 提交于
      After commit c430131a (Support
      controllers with big endian capability regs), HC_LENGTH takes
      two arguments. This patch fixes following compilation error:
      
      In file included from drivers/usb/host/ehci-hcd.c:1323:
      drivers/usb/host/ehci-pxa168.c:302:54: error: macro "HC_LENGTH" requires 2 arguments, but only 1 given
      In file included from drivers/usb/host/ehci-hcd.c:1323:
      drivers/usb/host/ehci-pxa168.c: In function 'ehci_pxa168_drv_probe':
      drivers/usb/host/ehci-pxa168.c:302: error: 'HC_LENGTH' undeclared (first use in this function)
      drivers/usb/host/ehci-pxa168.c:302: error: (Each undeclared identifier is reported only once
      drivers/usb/host/ehci-pxa168.c:302: error: for each function it appears in.)
      Signed-off-by: NTanmay Upadhyay <tanmay.upadhyay@einfochips.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      35657c4d
    • C
      usb: fix number of mapped SG DMA entries · bc677d5b
      Clemens Ladisch 提交于
      Add a new field num_mapped_sgs to struct urb so that we have a place to
      store the number of mapped entries and can also retain the original
      value of entries in num_sgs.  Previously, usb_hcd_map_urb_for_dma()
      would overwrite this with the number of mapped entries, which would
      break dma_unmap_sg() because it requires the original number of entries.
      
      This fixes warnings like the following when using USB storage devices:
       ------------[ cut here ]------------
       WARNING: at lib/dma-debug.c:902 check_unmap+0x4e4/0x695()
       ehci_hcd 0000:00:12.2: DMA-API: device driver frees DMA sg list with different entry count [map count=4] [unmap count=1]
       Modules linked in: ohci_hcd ehci_hcd
       Pid: 0, comm: kworker/0:1 Not tainted 3.2.0-rc2+ #319
       Call Trace:
        <IRQ>  [<ffffffff81036d3b>] warn_slowpath_common+0x80/0x98
        [<ffffffff81036de7>] warn_slowpath_fmt+0x41/0x43
        [<ffffffff811fa5ae>] check_unmap+0x4e4/0x695
        [<ffffffff8105e92c>] ? trace_hardirqs_off+0xd/0xf
        [<ffffffff8147208b>] ? _raw_spin_unlock_irqrestore+0x33/0x50
        [<ffffffff811fa84a>] debug_dma_unmap_sg+0xeb/0x117
        [<ffffffff8137b02f>] usb_hcd_unmap_urb_for_dma+0x71/0x188
        [<ffffffff8137b166>] unmap_urb_for_dma+0x20/0x22
        [<ffffffff8137b1c5>] usb_hcd_giveback_urb+0x5d/0xc0
        [<ffffffffa0000d02>] ehci_urb_done+0xf7/0x10c [ehci_hcd]
        [<ffffffffa0001140>] qh_completions+0x429/0x4bd [ehci_hcd]
        [<ffffffffa000340a>] ehci_work+0x95/0x9c0 [ehci_hcd]
        ...
       ---[ end trace f29ac88a5a48c580 ]---
       Mapped at:
        [<ffffffff811faac4>] debug_dma_map_sg+0x45/0x139
        [<ffffffff8137bc0b>] usb_hcd_map_urb_for_dma+0x22e/0x478
        [<ffffffff8137c494>] usb_hcd_submit_urb+0x63f/0x6fa
        [<ffffffff8137d01c>] usb_submit_urb+0x2c7/0x2de
        [<ffffffff8137dcd4>] usb_sg_wait+0x55/0x161
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bc677d5b
    • D
      USB: isp1760: Fix endianness-sensitivity in of_isp1760_probe() · 8ad028bd
      Dave Martin 提交于
      Data read direct from device tree properties will be in the device
      tree's native endianness (i.e., big-endian).
      
      This patch uses of_property_read_u32() to read the bus-width
      property in host byte order instead.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NPawel Moll <pawel.moll@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8ad028bd
    • G
      usb: PS3 EHCI QH read work-around · aaa0ef28
      Geoff Levand 提交于
      PS3 EHCI HC errata fix 244.  The SCC EHCI HC will not correctly perform QH
      reads that occur near or span a micro-frame boundry.  This is due to a problem
      in the Nak Count Reload Control logic (EHCI Specification 1.0 Section 4.9.1).
      
      The work-around for this problem is for the HC driver to set I=1 (inactive) for
      QHs with H=1 (list head).
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      aaa0ef28
  17. 09 12月, 2011 3 次提交
    • G
      usb: Fix PS3 EHCI suspend · df7c1ca2
      Geoff Levand 提交于
      The EHCI USB controller of the Cell Super Companion Chip used in the PS3
      will stop the root hub after all root hub ports are suspended.  When in
      this condition the ehci-hcd handshake routine will return -ETIMEDOUT and
      the USB runtime suspend sequence will fail.  The STS_HLT bit will not be
      set, so inspection of the frame index is used to test for the condition.
      
      Add a new routine handshake_for_broken_root_hub() that is called after
      an unsuccessful -ETIMEDOUT handshake.  On PS3 handshake_for_broken_root_hub()
      will test for the condition, and if found will return success to allow the
      USB suspend to complete.  For all other platforms
      handshake_for_broken_root_hub() will return -ETIMEDOUT
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      df7c1ca2
    • G
      usb: PS3 EHCI HC reset work-around · 9187bef2
      Geoff Levand 提交于
      PS3 EHCI HC errata fix 316 - The PS3 EHCI HC will reset its
      internal INSNREGXX setup regs back to the chip default values
      on Host Controller Reset (CMD_RESET) or Light Host Controller
      Reset (CMD_LRESET).  The work-around for this is for the HC
      driver to re-initialise these regs when ever the HC is reset.
      
      Adds a new helper routine ps3_ehci_setup_insnreg() which is
      called from ps3_ehci_hc_reset().
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      9187bef2
    • G
      usb: Remove ehci_reset call from ehci_run · 876e0df9
      Geoff Levand 提交于
      Remove the ehci_reset() call done in the ehci_run() routine of the
      USB EHCI host controller driver and add an ehci_reset() call to the
      probe processing of all EHCI platform drivers that do not already call
      ehci_reset().
      
      The call to ehci_reset() from ehci_run() was problematic for several
      platform drivers, and unnecessary for others.  This change moves the
      decision to call ehci_reset() at driver startup to the platform
      driver code.
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      876e0df9
  18. 08 12月, 2011 2 次提交