1. 10 12月, 2011 4 次提交
    • 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
    • H
      USB: cdc-acm: Fix potential deadlock (lockdep warning) · 7fb57a01
      Havard Skinnemoen 提交于
      Rework the locking and lifecycle management in the cdc-acm driver.
      Instead of using a global mutex to prevent the 'acm' object from being
      freed, use the tty_port kref to keep the device alive when either the
      USB side or TTY side is still active.
      
      This allows us to use the global mutex purely for protecting the
      acm_table, while use acm->mutex to guard against disconnect during
      TTY port activation and shutdown.
      
      The USB-side kref is taken during port initialization in probe(), and
      released at the end of disconnect(). The TTY-side kref is taken in
      install() and released in cleanup(). On disconnect, tty_vhangup() is
      called instead of tty_hangup() to ensure the TTY hangup processing is
      completed before the USB device is taken down.
      
      The TTY open and close handlers have been gutted and replaced with
      tty_port_open() and tty_port_close() respectively. The driver-specific
      code which used to be there was spread across install(), activate() and
      shutdown().
      Reported-by: NDave Jones <davej@redhat.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: NHavard Skinnemoen <hskinnemoen@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7fb57a01
    • 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
  2. 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
  3. 30 11月, 2011 1 次提交
  4. 28 11月, 2011 1 次提交
  5. 27 11月, 2011 6 次提交
  6. 19 11月, 2011 11 次提交
  7. 18 11月, 2011 1 次提交
  8. 16 11月, 2011 13 次提交