]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Ensure a command structure points to the correct trb on the command ring
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 30 Aug 2013 15:25:49 +0000 (18:25 +0300)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 23 Sep 2013 22:43:30 +0000 (15:43 -0700)
commit89d1d4d654b6d921848f7dd1f66f56a8865608a2
tree43ac59451086b752caee4930129bc7d3ec380117
parent0b607a3089bd2c5a7ff22c8fc7541972f5edee70
xhci: Ensure a command structure points to the correct trb on the command ring

If a command on the command ring needs to be cancelled before it is handled
it can be turned to a no-op operation when the ring is stopped.
We want to store the command ring enqueue pointer in the command structure
when the command in enqueued for the cancellation case.

Some commands used to store the command ring dequeue pointers instead of enqueue
(these often worked because enqueue happends to equal dequeue quite often)

Other commands correctly used the enqueue pointer but did not check if it pointed
to a valid trb or a link trb, this caused for example stop endpoint command to timeout in
xhci_stop_device() in about 2% of suspend/resume cases.

This should also solve some weird behavior happening in command cancellation cases.

This patch is based on a patch submitted by Sarah Sharp to linux-usb, but
then forgotten:
    http://marc.info/?l=linux-usb&m=136269803207465&w=2

This patch should be backported to kernels as old as 3.7, that contain
the commit 4e07e76e317e1b7ea18252d92337fc361d574d30 "xHCI: add aborting
command ring function"

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h