1. 04 1月, 2017 7 次提交
  2. 14 11月, 2016 16 次提交
  3. 03 11月, 2016 1 次提交
  4. 08 9月, 2016 1 次提交
  5. 16 8月, 2016 2 次提交
    • A
      xhci: really enqueue zero length TRBs. · 0d2daade
      Alban Browaeys 提交于
      Enqueue the first TRB even if full_len is zero.
      Without this "adb install <apk>" freezes the system.
      Signed-off-by: NAlban Browaeys <alban.browaeys@gmail.com>
      Fixes: 86065c27 ("xhci: don't rely on precalculated value of needed trbs in the enqueue loop")
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d2daade
    • M
      xhci: always handle "Command Ring Stopped" events · 33be1265
      Mathias Nyman 提交于
      Fix "Command completion event does not match command" errors by always
      handling the command ring stopped events.
      
      The command ring stopped event is generated as a result of aborting
      or stopping the command ring with a register write. It is not caused
      by a command in the command queue, and thus won't have a matching command
      in the comman list.
      
      Solve it by handling the command ring stopped event before checking for a
      matching command.
      
      In most command time out cases we abort the command ring, and get
      a command ring stopped event. The events command pointer will point at
      the current command ring dequeue, which in most cases matches the timed
      out command in the command list, and no error messages are seen.
      
      If we instead get a command aborted event before the command ring stopped
      event, the abort event will increse the command ring dequeue pointer, and
      the following command ring stopped events command pointer will point at the
      next, not yet queued command. This case triggered the error message
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33be1265
  6. 01 7月, 2016 1 次提交
    • A
      xhci: free the correct ring · f76a28a6
      Arnd Bergmann 提交于
      gcc warns about what first looks like a reference to an uninitialized
      variable:
      
      drivers/usb/host/xhci-ring.c: In function 'handle_cmd_completion':
      drivers/usb/host/xhci-ring.c:753:4: error: 'ep_ring' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/usb/host/xhci-ring.c:647:20: note: 'ep_ring' was declared here
        struct xhci_ring *ep_ring;
                          ^~~~~~~
      
      It's clear to see that the list_empty() check means it can never be
      uninitialized, however it still looks wrong:
      
      When ep->cancelled_td_list contains more than one entry, the
      ep_ring variable will point to the ring that was retrieved
      from the last urb, and we have to look it up again in the
      second loop instead, which fixes the behavior and gets rid of the
      warning too.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: f9c589e1 ("xhci: TD-fragment, align the unsplittable case with a bounce buffer")
      Acked-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f76a28a6
  7. 27 6月, 2016 11 次提交
  8. 02 6月, 2016 1 次提交
    • M
      xhci: Fix handling timeouted commands on hosts in weird states. · 3425aa03
      Mathias Nyman 提交于
      If commands timeout we mark them for abortion, then stop the command
      ring, and turn the commands to no-ops and finally restart the command
      ring.
      
      If the host is working properly the no-op commands will finish and
      pending completions are called.
      If we notice the host is failing, driver clears the command ring and
      completes, deletes and frees all pending commands.
      
      There are two separate cases reported where host is believed to work
      properly but is not. In the first case we successfully stop the ring
      but no abort or stop command ring event is ever sent and host locks up.
      
      The second case is if a host is removed, command times out and driver
      believes the ring is stopped, and assumes it will be restarted, but
      actually ends up timing out on the same command forever.
      If one of the pending commands has the xhci->mutex held it will block
      xhci_stop() in the remove codepath which otherwise would cleanup pending
      commands.
      
      Add a check that clears all pending commands in case host is removed,
      or we are stuck timing out on the same command. Also restart the
      command timeout timer when stopping the command ring to ensure we
      recive an ring stop/abort event.
      
      Cc: stable <stable@vger.kernel.org>
      Tested-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3425aa03