1. 22 2月, 2012 2 次提交
    • S
      xhci: Fix encoding for HS bulk/control NAK rate. · 340a3504
      Sarah Sharp 提交于
      The xHCI 0.96 spec says that HS bulk and control endpoint NAK rate must
      be encoded as an exponent of two number of microframes.  The endpoint
      descriptor has the NAK rate encoded in number of microframes.  We were
      just copying the value from the endpoint descriptor into the endpoint
      context interval field, which was not correct.  This lead to the VIA
      host rejecting the add of a bulk OUT endpoint from any USB 2.0 mass
      storage device.
      
      The fix is to use the correct encoding.  Refactor the code to convert
      number of frames to an exponential number of microframes, and make sure
      we convert the number of microframes in HS bulk and control endpoints to
      an exponent.
      
      This should be back ported to kernels as old as 2.6.31, that contain the
      commit dfa49c4a "USB: xhci - fix math
      in xhci_get_endpoint_interval"
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NFelipe Contreras <felipe.contreras@gmail.com>
      Suggested-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      340a3504
    • S
      USB: Fix handoff when BIOS disables host PCI device. · cab928ee
      Sarah Sharp 提交于
      On some systems with an Intel Panther Point xHCI host controller, the
      BIOS disables the xHCI PCI device during boot, and switches the xHCI
      ports over to EHCI.  This allows the BIOS to access USB devices without
      having xHCI support.
      
      The downside is that the xHCI BIOS handoff mechanism will fail because
      memory mapped I/O is not enabled for the disabled PCI device.
      Jesse Barnes says this is expected behavior.  The PCI core will enable
      BARs before quirks run, but it will leave it in an undefined state, and
      it may not have memory mapped I/O enabled.
      
      Make the generic USB quirk handler call pci_enable_device() to re-enable
      MMIO, and call pci_disable_device() once the host-specific BIOS handoff
      is finished.  This will balance the ref counts in the PCI core.  When
      the PCI probe function is called, usb_hcd_pci_probe() will call
      pci_enable_device() again.
      
      This should be back ported to kernels as old as 2.6.31.  That was the
      first kernel with xHCI support, and no one has complained about BIOS
      handoffs failing due to memory mapped I/O being disabled on other hosts
      (EHCI, UHCI, or OHCI).
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NOliver Neukum <oneukum@suse.de>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: stable@vger.kernel.org
      cab928ee
  2. 15 2月, 2012 1 次提交
    • S
      USB: Don't fail USB3 probe on missing legacy PCI IRQ. · 68d07f64
      Sarah Sharp 提交于
      Intel has a PCI USB xhci host controller on a new platform. It doesn't
      have a line IRQ definition in BIOS.  The Linux driver refuses to
      initialize this controller, but Windows works well because it only depends
      on MSI.
      
      Actually, Linux also can work for MSI.  This patch avoids the line IRQ
      checking for USB3 HCDs in usb core PCI probe.  It allows the xHCI driver
      to try to enable MSI or MSI-X first.  It will fail the probe if MSI
      enabling failed and there's no legacy PCI IRQ.
      
      This patch should be backported to kernels as old as 2.6.32.
      Signed-off-by: NAlex Shi <alex.shi@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      68d07f64
  3. 11 2月, 2012 1 次提交
    • S
      xhci: Fix oops caused by more USB2 ports than USB3 ports. · 3278a55a
      Sarah Sharp 提交于
      The code to set the device removable bits in the USB 2.0 roothub
      descriptor was accidentally looking at the USB 3.0 port registers
      instead of the USB 2.0 registers.  This can cause an oops if there are
      more USB 2.0 registers than USB 3.0 registers.
      
      This should be backported to kernels as old as 2.6.39, that contain the
      commit 4bbb0ace "xhci: Return a USB 3.0
      hub descriptor for USB3 roothub."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      3278a55a
  4. 03 2月, 2012 4 次提交
    • R
      uwb & wusb & usb wireless controllers: fix kconfig error & build errors · 36f8ecbf
      Randy Dunlap 提交于
      Fix kconfig warnings and build errors in UWB/WUSB/USB_HWA etc.
      by making all of these related symbols depend on UWB.
      
      warning: (USB_WHCI_HCD && USB_HWA_HCD) selects USB_WUSB which has unmet direct dependencies (USB_SUPPORT && EXPERIMENTAL && USB && PCI && UWB)
      warning: (USB_HWA_HCD) selects UWB_HWA which has unmet direct dependencies (UWB && USB)
      
      which lead to:
      
      ERROR: "uwb_rsv_establish" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_pal_register" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rsv_get_usable_mas" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rsv_destroy" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_radio_stop" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rsv_terminate" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_pal_unregister" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_pal_init" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rc_reset_all" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_radio_start" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rsv_create" [drivers/usb/wusbcore/wusbcore.ko] undefined!
      ERROR: "uwb_rc_put" [drivers/usb/host/whci/whci-hcd.ko] undefined!
      ERROR: "uwb_rc_get_by_grandpa" [drivers/usb/host/whci/whci-hcd.ko] undefined!
      ERROR: "__umc_driver_register" [drivers/usb/host/whci/whci-hcd.ko] undefined!
      ERROR: "umc_driver_unregister" [drivers/usb/host/whci/whci-hcd.ko] undefined!
      ERROR: "whci_wait_for" [drivers/usb/host/whci/whci-hcd.ko] undefined!
      ERROR: "uwb_rc_get_by_grandpa" [drivers/usb/host/hwa-hc.ko] undefined!
      ERROR: "uwb_rc_put" [drivers/usb/host/hwa-hc.ko] undefined!
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36f8ecbf
    • J
      usb: Skip PCI USB quirk handling for Netlogic XLP · e4436a7c
      Jayachandran C 提交于
      The Netlogic XLP SoC's on-chip USB controller appears as a PCI
      USB device, but does not need the EHCI/OHCI handoff done in
      usb/host/pci-quirks.c.
      
      The pci-quirks.c is enabled for all vendors and devices, and is
      enabled if USB and PCI are configured.
      
      If we do not skip the qurik handling on XLP, the readb() call in
      ehci_bios_handoff() will cause a crash since byte access is not
      supported for EHCI registers in XLP.
      Signed-off-by: NJayachandran C <jayachandranc@netlogicmicro.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e4436a7c
    • S
      powerpc/usb: fix issue of CPU halt when missing USB PHY clock · 529febee
      Shengzhou Liu 提交于
      when missing USB PHY clock, kernel booting up will halt during USB
      initialization. We should check USBGP[PHY_CLK_VALID] bit to avoid
      CPU hang in this case.
      Signed-off-by: NShengzhou Liu <Shengzhou.Liu@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      529febee
    • F
      usb: host: Distinguish Kconfig text for Freescale controllers · c0ca9bc5
      Fabio Estevam 提交于
      Distinguish Kconfig text by providing the Freescale family name.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0ca9bc5
  5. 26 1月, 2012 1 次提交
  6. 25 1月, 2012 5 次提交
  7. 20 1月, 2012 2 次提交
  8. 16 1月, 2012 1 次提交
  9. 13 1月, 2012 1 次提交
  10. 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
  11. 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
  12. 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
  13. 23 12月, 2011 9 次提交
  14. 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
  15. 20 12月, 2011 1 次提交
  16. 16 12月, 2011 1 次提交
  17. 14 12月, 2011 1 次提交
  18. 10 12月, 2011 3 次提交
    • 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