1. 25 1月, 2017 11 次提交
  2. 11 1月, 2017 1 次提交
    • M
      xhci: fix deadlock at host remove by running watchdog correctly · d6169d04
      Mathias Nyman 提交于
      If a URB is killed while the host is removed we can end up in a situation
      where the hub thread takes the roothub device lock, and waits for
      the URB to be given back by xhci-hcd, blocking the host remove code.
      
      xhci-hcd tries to stop the endpoint and give back the urb, but can't
      as the host is removed from PCI bus at the same time, preventing the normal
      way of giving back urb.
      
      Instead we need to rely on the stop command timeout function to give back
      the urb. This xhci_stop_endpoint_command_watchdog() timeout function
      used a XHCI_STATE_DYING flag to indicate if the timeout function is already
      running, but later this flag has been taking into use in other places to
      mark that xhci is dying.
      
      Remove checks for XHCI_STATE_DYING in xhci_urb_dequeue. We are still
      checking that reading from pci state does not return 0xffffffff or that
      host is not halted before trying to stop the endpoint.
      
      This whole area of stopping endpoints, giving back URBs, and the wathdog
      timeout need rework, this fix focuses on solving a specific deadlock
      issue that we can then send to stable before any major rework.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6169d04
  3. 04 1月, 2017 7 次提交
  4. 14 11月, 2016 16 次提交
  5. 03 11月, 2016 1 次提交
  6. 08 9月, 2016 1 次提交
  7. 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
  8. 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