1. 14 8月, 2013 14 次提交
    • X
      xhci: fix dma mask setup in xhci.c · c10cf118
      Xenia Ragiadakou 提交于
      The function dma_set_mask() tests internally whether the dma_mask pointer
      for the device is initialized and fails if the dma_mask pointer is NULL.
      On pci platforms, the device dma_mask pointer is initialized, when pci
      devices are enumerated, to point to the pci_dev->dma_mask which is 0xffffffff.
      However, for non-pci platforms, the dma_mask pointer may not be initialized
      and in that case dma_set_mask() will fail.
      
      This patch initializes the dma_mask and the coherent_dma_mask to 32bits
      in xhci_plat_probe(), before the call to usb_create_hcd() that sets the
      "uses_dma" flag for the usb bus and the call to usb_add_hcd() that creates
      coherent dma pools for the usb hcd.
      
      Moreover, a call to dma_set_mask() does not set the device coherent_dma_mask.
      Since the xhci-hcd driver calls dma_alloc_coherent() and dma_pool_alloc()
      to allocate consistent DMA memory blocks, the coherent DMA address mask
      has to be set explicitly.
      
      This patch sets the coherent_dma_mask to 64bits in xhci_gen_setup() when
      the xHC is capable for 64-bit DMA addressing.
      
      If dma_set_mask() succeeds, for a given bitmask, it is guaranteed that
      the given bitmask is also supported for consistent DMA mappings.
      
      Other changes introduced in this patch are:
      
      - The return value of dma_set_mask() is checked to ensure that the required
        dma bitmask conforms with the host system's addressing capabilities.
      
      - The dma_mask setup code for the non-primary hcd was removed since both
        primary and non-primary hcd refer to the same generic device whose
        dma_mask and coherent_dma_mask are already set during the setup of
        the primary hcd.
      
      - The code for reading the HCCPARAMS register to find out the addressing
        capabilities of xHC was removed since its value is already cached in
        xhci->hccparams.
      
      - hcd->self.controller was replaced with the dev variable since it is
        already available.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      c10cf118
    • X
      xhci: trace debug statements related to ring expansion · 68ffb011
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_ring_expansion
      and belongs to the event class xhci_log_msg, and adds tracepoints that trace
      the debug messages associated with the expansion of endpoint ring when there
      is not enough space allocated to hold all pending TRBs.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      68ffb011
    • X
      xhci: trace debug messages related to driver initialization and unload · d195fcff
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_init
      and belongs to the event class xhci_log_msg, and adds tracepoints that
      trace the debug statements in the functions used to start and stop the
      xhci-hcd driver.
      
      Also, it removes an unnecessary cast of variable val to unsigned int
      in xhci_mem_init(), since val is already declared as unsigned int.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      d195fcff
    • X
      xhci: trace debug statements for urb cancellation · aa50b290
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_cancel_urb
      and belongs to the event class xhci_log_msg, and adds tracepoints that
      trace the debug messages related to the removal of a cancelled URB from
      the endpoint's transfer ring.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      aa50b290
    • X
      xhci: add xhci_cmd_completion trace event · 63a23b9a
      Xenia Ragiadakou 提交于
      This patch creates a new event class, called xhci_log_event,
      and defines the xhci_cmd_completion trace event used for
      tracing the commands issued to xHC that generate a completion
      event in the event ring.
      
      This info can be used, later, to print, in a human readable
      way, the completion status and flags as well as the command's
      type and fields using the trace-cmd tool and the appropriate
      plugin.
      
      Also, a tracepoint is added in handle_cmd_completion().
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      63a23b9a
    • X
      xhci: add xhci_address_ctx trace event · 1d27fabe
      Xenia Ragiadakou 提交于
      This patch defines a new event class, called xhci_log_ctx,
      that records in the ring buffer the context data, the
      context type (input or output), the context dma and virtual
      addresses, the context endpoint entries, the slot ID and
      whether the xHC uses 64 byte context data structures.
      
      This information can be used, later, to parse and display
      the context data fields with the appropriate plugin using
      the trace-cmd tool.
      
      Also, this patch defines a trace event, called xhci_address_ctx,
      to trace the contexts related to the Address Device command and
      adds the associated tracepoints in xhci_address_device().
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      1d27fabe
    • X
      xhci: add trace for debug messages related to endpoint reset · a0254324
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_reset_ep
      and belongs in the event class xhci_log_msg, and adds tracepoints that
      trace the debug messages associated with resetting an endpoint after
      the reception of a STALL packet.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      a0254324
    • X
      xhci: add trace for debug messages related to quirks · 4bdfe4c3
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_quirks
      and belongs in the event class xhci_log_msg, and adds tracepoints that
      trace the debug messages associated with xHCs' quirks.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      4bdfe4c3
    • X
      xhci: add trace for debug messages related to changing contexts · 3a7fa5be
      Xenia Ragiadakou 提交于
      This patch defines a new trace event, which is called xhci_dbg_context_change
      and belongs in the event class xhci_log_msg, and adds tracepoints for tracing
      the debug messages related to context updates performed with Configure Endpoint
      and Evaluate Context commands.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      3a7fa5be
    • X
      xhci: add traces for debug messages in xhci_address_device() · 84a99f6f
      Xenia Ragiadakou 提交于
      This patch declares an event class for trace events that
      trace messages with variadic arguments, called xhci_log_msg,
      and defines a trace event for tracing the debug messages in
      xhci_address_device() function, called xhci_dbg_address.
      
      In order to implement this type of trace events, a wrapper function,
      called xhci_dbg_trace(), was created that records the format string
      and variadic arguments into a va_format structure which is passed as
      argument to the tracepoints of the class xhci_log_msg.
      
      All the xhci_dbg() calls in xhci_address_device() are replaced
      with calls to xhci_dbg_trace(). The functionality of xhci_dbg()
      log messages was not removed though, but it is placed inside
      xhci_dbg_trace().
      
      This trace event aims to give the ability to the user or the
      developper to isolate and trace the debug messages generated
      when an Address Device Command is issued to xHC.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      84a99f6f
    • X
      xhci: remove CONFIG_USB_XHCI_HCD_DEBUGGING and unused code · b2497509
      Xenia Ragiadakou 提交于
      CONFIG_USB_XHCI_HCD_DEBUGGING option is used to enable
      verbose debugging output for the xHCI host controller
      driver.
      
      In the current version of the xhci-hcd driver, this
      option must be turned on, in order for the debugging
      log messages to be displayed, and users may need to
      recompile the linux kernel to obtain debugging
      information that will help them track down problems.
      
      This patch removes the above debug option to enable
      debugging log messages at all times.
      The aim of this is to rely on the debugfs and the
      dynamic debugging feature for fine-grained management
      of debugging messages and to not force users to set
      the debug config option and compile the linux kernel
      in order to have access in that information.
      
      This patch, also, removes the XHCI_DEBUG symbol and the
      functions dma_to_stream_ring(), xhci_test_radix_tree()
      and xhci_event_ring_work() that are not useful anymore.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      b2497509
    • X
      xhci: replace printk(KERN_DEBUG ...) · 5c1127d3
      Xenia Ragiadakou 提交于
      This patch replaces the calls to printk(KERN_DEBUG ...)
      with either calls to xhci_dbg() or calls to pr_debug(),
      depending on whether the xhci_hcd structure is available
      at callsite, so that the correspoding debugging messages
      are not enabled by default when CONFIG_DYNAMIC_DEBUG option
      is set but rather can be enabled dynamically taking advantage
      of the dynamic debugging feature.
      
      Also, it adds a newline at the end of debugging messages in
      case there is not, so that messages don't appear broken
      when printed.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      5c1127d3
    • X
      xhci: replace xhci_info() with xhci_dbg() · 38a532a6
      Xenia Ragiadakou 提交于
      This patch replaces the calls to xhci_info() with calls to
      xhci_dbg() and removes the unused xhci_info() definition
      from xhci-hcd.
      
      By replacing the xhci_info() with xhci_dbg(), the calls to
      dev_info() are replaced with calls to dev_dbg() so that
      their output can be dynamically controlled via the dynamic
      debugging mechanism.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      38a532a6
    • A
      usb: Add Device Tree support to XHCI Platform driver · 1fe6c452
      Al Cooper 提交于
      Add Device Tree match table to xhci-plat.c. Add DT bindings document.
      Signed-off-by: NAl Cooper <alcooperx@gmail.com>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      1fe6c452
  2. 02 8月, 2013 3 次提交
    • B
      USB: ohci-at91: add usb_clk for transition to common clk framework · 6b0a1cf7
      Boris BREZILLON 提交于
      The AT91 PMC (Power Management Controller) provides an USB clock used by
      USB Full Speed host (ohci) and USB Full Speed device (udc).
      The usb drivers (ohci and udc) must configure this clock to 48Mhz.
      This configuration was formely done in mach-at91/clock.c, but this
      implementation will be removed when moving to common clk framework.
      
      This patch adds support for usb clock retrieval and configuration, and is
      backward compatible with the current at91 clk implementation (if usb clk
      is not found, it does not configure/enable it).
      
      Changes since v1:
       - use IS_ENABLED(CONFIG_COMMON_CLK) to isolate new at91 clk support
      Signed-off-by: NBoris BREZILLON <b.brezillon@overkiz.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b0a1cf7
    • A
      USB: EHCI: don't depend on hardware for tracking port resets and resumes · 6753f4cf
      Alan Stern 提交于
      In theory, an EHCI controller can turn off the PORT_RESUME or
      PORT_RESET bits in a port status register all by itself (and some
      controllers actually do this).  We shouldn't depend on these bits
      being set correctly.
      
      This patch rearranges the code in ehci-hcd that handles completion of
      port resets and resumes.  We guarantee that ehci->reset_done[portnum]
      is nonzero if a reset or resume is in progress, and that the portnum
      bit is set in ehci->resuming_ports if the operation is a resume.  (To
      help enforce this guarantee, the patch prevents suspended ports from
      being reset.)  Therefore it's not necessary to look at the port status
      bits to learn what's going on.
      
      The patch looks bigger than it really is, because it changes the
      indentation level of a sizeable region of code.  Most of what it
      actually does is interchange some tests.  The only functional changes
      are testing reset_done and resuming_ports rather than PORT_RESUME and
      PORT_RESET, removing a now-unnecessary check for spontaneous
      resets of the PORT_RESUME and PORT_RESET bits, and preventing a
      suspended or resuming port from being reset.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6753f4cf
    • A
      USB: EHCI: keep better track of resuming ports · 3a20446f
      Alan Stern 提交于
      The ehci-hcd driver isn't as careful as it should be about the way it
      uses ehci->resuming_ports.  One of the omissions was fixed recently by
      commit 47a64a13 (USB: EHCI: Fix resume signalling on remote
      wakeup), but there are other places that need attention:
      
      	When a port's suspend feature is explicitly cleared, the
      	corresponding bit in resuming_ports should be set and the core
      	should be notified about the port resume.
      
      	We don't need to clear a resuming_ports bit when a reset
      	completes.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a20446f
  3. 01 8月, 2013 1 次提交
  4. 30 7月, 2013 1 次提交
  5. 27 7月, 2013 5 次提交
  6. 26 7月, 2013 1 次提交
  7. 25 7月, 2013 9 次提交
    • O
      xhci: fix null pointer dereference on ring_doorbell_for_active_rings · d66eaf9f
      Oleksij Rempel 提交于
      in some cases where device is attched to xhci port and do not responding,
      for example ath9k_htc with stalled firmware, kernel will
      crash on ring_doorbell_for_active_rings.
      This patch check if pointer exist before it is used.
      
      This patch should be backported to kernels as old as 2.6.35, that
      contain the commit e9df17eb "USB: xhci:
      Correct assumptions about number of rings per endpoint"
      Signed-off-by: NOleksij Rempel <linux@rempel-privat.de>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      d66eaf9f
    • G
      usb: host: xhci: Enable XHCI_SPURIOUS_SUCCESS for all controllers with xhci 1.0 · 07f3cb7c
      George Cherian 提交于
      Xhci controllers with hci_version > 0.96 gives spurious success
      events on short packet completion. During webcam capture the
      "ERROR Transfer event TRB DMA ptr not part of current TD" was observed.
      The same application works fine with synopsis controllers hci_version 0.96.
      The same issue is seen with Intel Pantherpoint xhci controller. So enabling
      this quirk in xhci_gen_setup if controller verion is greater than 0.96.
      For xhci-pci move the quirk to much generic place xhci_gen_setup.
      
      Note from Sarah:
      
      The xHCI 1.0 spec changed how hardware handles short packets.  The HW
      will notify SW of the TRB where the short packet occurred, and it will
      also give a successful status for the last TRB in a TD (the one with the
      IOC flag set).  On the second successful status, that warning will be
      triggered in the driver.
      
      Software is now supposed to not assume the TD is not completed until it
      gets that last successful status.  That means we have a slight race
      condition, although it should have little practical impact.  This patch
      papers over that issue.
      
      It's on my long-term to-do list to fix this race condition, but it is a
      much more involved patch that will probably be too big for stable.  This
      patch is needed for stable to avoid serious log spam.
      
      This patch should be backported to kernels as old as 3.0, that
      contain the commit ad808333 "Intel xhci:
      Ignore spurious successful event."
      
      The patch will have to be modified for kernels older than 3.2, since
      that kernel added the xhci_gen_setup function for xhci platform devices.
      The correct conflict resolution for kernels older than 3.2 is to set
      XHCI_SPURIOUS_SUCCESS in xhci_pci_quirks for all xHCI 1.0 hosts.
      Signed-off-by: NGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      07f3cb7c
    • R
      usb: fix build warning in pci-quirks.h when CONFIG_PCI is not enabled · c4d949b7
      Randy Dunlap 提交于
      Fix warning when CONFIG_PCI is not enabled
      (from commit 29636578).
      
      drivers/usb/host/pci-quirks.h: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Moiz Sonasath <m-sonasath@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      c4d949b7
    • O
      usb: xhci: Mark two functions __maybe_unused · d5c82feb
      Olof Johansson 提交于
      Resolves the following build warnings:
      drivers/usb/host/xhci.c:332:13: warning: 'xhci_msix_sync_irqs' defined but not used [-Wunused-function]
      drivers/usb/host/xhci.c:3901:12: warning: 'xhci_change_max_exit_latency' defined but not used [-Wunused-function]
      
      These functions are not always used, and since they're marked static
      they will produce build warnings:
      - xhci_msix_sync_irqs is only used with CONFIG_PCI.
      - xhci_change_max_exit_latency is a little more complicated with
        dependencies on CONFIG_PM and CONFIG_PM_RUNTIME.
      
      Instead of building a bigger maze of ifdefs in this code, I've just
      marked both with __maybe_unused.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      d5c82feb
    • S
      xhci: Avoid NULL pointer deref when host dies. · 203a8661
      Sarah Sharp 提交于
      When the host controller fails to respond to an Enable Slot command, and
      the host fails to respond to the register write to abort the command
      ring, the xHCI driver will assume the host is dead, and call
      usb_hc_died().
      
      The USB device's slot_id is still set to zero, and the pointer stored at
      xhci->devs[0] will always be NULL.  The call to xhci_check_args in
      xhci_free_dev should have caught the NULL virt_dev pointer.
      
      However, xhci_free_dev is designed to free the xhci_virt_device
      structures, even if the host is dead, so that we don't leak kernel
      memory.  xhci_free_dev checks the return value from the generic
      xhci_check_args function.  If the return value is -ENODEV, it carries on
      trying to free the virtual device.
      
      The issue is that xhci_check_args looks at the host controller state
      before it looks at the xhci_virt_device pointer.  It will return -ENIVAL
      because the host is dead, and xhci_free_dev will ignore the return
      value, and happily dereference the NULL xhci_virt_device pointer.
      
      The fix is to make sure that xhci_check_args checks the xhci_virt_device
      pointer before it checks the host state.
      
      See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1203453 for
      further details.  This patch doesn't solve the underlying issue, but
      will ensure we don't see any more NULL pointer dereferences because of
      the issue.
      
      This patch should be backported to kernels as old as 3.1, that
      contain the commit 7bd89b40 "xhci: Don't
      submit commands or URBs to halted hosts."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NVincent Thiele <vincentthiele@gmail.com>
      Cc: stable@vger.kernel.org
      203a8661
    • G
      Revert "usb: host: Faraday fotg210-hcd driver" · 5447e0a6
      Greg Kroah-Hartman 提交于
      This reverts commit 1dd3d123.
      
      The email address for the developer now bounces, which means they have
      moved on, so remove the driver until someone else from the company steps
      up to maintain it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5447e0a6
    • Y
      usb: host: Faraday fotg210-hcd driver · 1dd3d123
      Yuan-Hsin Chen 提交于
      FOTG210 is an OTG controller which can be configured as an
      USB2.0 host. FOTG210 host is an ehci-like controller with
      some differences. First, register layout of FOTG210 is
      incompatible with EHCI. Furthermore, FOTG210 is lack of
      siTDs which means iTDs are used for both HS and FS ISO
      transfer.
      Signed-off-by: NYuan-Hsin Chen <yhchen@faraday-tech.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1dd3d123
    • G
      USB: isp1362: move debug files from proc to debugfs · a6363463
      Greg Kroah-Hartman 提交于
      Drivers should not be putting debug files in /proc/ that is what debugfs
      is for, so move the isp1362 driver's debug file to debugfs.
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6363463
    • G
      USB: sl811: move debug files from proc to debugfs · 0511b363
      Greg Kroah-Hartman 提交于
      Drivers should not be putting debug files in /proc/ that is what debugfs
      is for, so move the sl811 driver's debug file to debugfs.
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0511b363
  8. 24 7月, 2013 6 次提交