[ 3.5.y.z extended stable ] Patch "xhci: Fix race between ep halt and URB cancellation" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Fri Oct 4 09:37:38 UTC 2013


This is a note to let you know that I have just added a patch titled

    xhci: Fix race between ep halt and URB cancellation

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 4e7b23b10cad7a54d78492356ce125bfd20ea765 Mon Sep 17 00:00:00 2001
From: Florian Wolter <wolly84 at web.de>
Date: Wed, 14 Aug 2013 10:33:16 +0200
Subject: [PATCH] xhci: Fix race between ep halt and URB cancellation

commit 526867c3ca0caa2e3e846cb993b0f961c33c2abb upstream.

The halted state of a endpoint cannot be cleared over CLEAR_HALT from a
user process, because the stopped_td variable was overwritten in the
handle_stopped_endpoint() function. So the xhci_endpoint_reset() function will
refuse the reset and communication with device can not run over this endpoint.
https://bugzilla.kernel.org/show_bug.cgi?id=60699

Signed-off-by: Florian Wolter <wolly84 at web.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp at linux.intel.com>
Cc: Jonghwan Choi <jhbird.choi at samsung.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/usb/host/xhci-ring.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 37cecce..36d1290 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -847,8 +847,12 @@ remove_finished_td:
 		/* Otherwise ring the doorbell(s) to restart queued transfers */
 		ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
 	}
-	ep->stopped_td = NULL;
-	ep->stopped_trb = NULL;
+
+	/* Clear stopped_td and stopped_trb if endpoint is not halted */
+	if (!(ep->ep_state & EP_HALTED)) {
+		ep->stopped_td = NULL;
+		ep->stopped_trb = NULL;
+	}

 	/*
 	 * Drop the lock and complete the URBs in the cancelled TD list.
--
1.8.3.2





More information about the kernel-team mailing list