aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorElric Fu <elricfu1@gmail.com>2012-06-27 16:30:57 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-28 10:02:13 -0700
commitc76e4de05c23fea3d6ad6df63876a9397dd7c85a (patch)
treead79eb26202dc0539091c49bc6566c4816d6ed0b /drivers/usb/host/xhci-ring.c
parent63d9249d5fa183605153928e9f19881fb86e9e81 (diff)
downloadkernel_samsung_smdk4412-c76e4de05c23fea3d6ad6df63876a9397dd7c85a.zip
kernel_samsung_smdk4412-c76e4de05c23fea3d6ad6df63876a9397dd7c85a.tar.gz
kernel_samsung_smdk4412-c76e4de05c23fea3d6ad6df63876a9397dd7c85a.tar.bz2
xHCI: add cmd_ring_state
commit c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 upstream. Adding cmd_ring_state for command ring. It helps to verify the current command ring state for controlling the command ring operations. This patch should be backported to kernels as old as 3.0. The commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an assertion to check for virt_dev=0 bug." papers over the NULL pointer dereference that I now believe is related to a timed out Set Address command. This (and the four patches that follow it) contain the real fix that also allows VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug stress tests. Signed-off-by: Elric Fu <elricfu1@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 152daca..4027779 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -311,6 +311,9 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
/* Ring the host controller doorbell after placing a command on the ring */
void xhci_ring_cmd_db(struct xhci_hcd *xhci)
{
+ if (!(xhci->cmd_ring_state & CMD_RING_STATE_RUNNING))
+ return;
+
xhci_dbg(xhci, "// Ding dong!\n");
xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]);
/* Flush PCI posted writes */