[PATCH 5/11] USB: EHCI: change toggle only upon successful reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ehci-hcd uses a value of 0 in an endpoint's toggle flag to indicate
that the endpoint has been reset (and therefore the Data Toggle bit
needs to be cleared in the endpoint's QH overlay region).

The toggle flag should be set to 0 only when ehci_endpoint_reset()
succeeds.  This patch moves the usb_settoggle() call into the
appropriate branch of the "if" statement.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

---

[as1718]

 drivers/usb/host/ehci-hcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: usb-3.11/drivers/usb/host/ehci-hcd.c
===================================================================
--- usb-3.11.orig/drivers/usb/host/ehci-hcd.c
+++ usb-3.11/drivers/usb/host/ehci-hcd.c
@@ -1022,7 +1022,6 @@ ehci_endpoint_reset(struct usb_hcd *hcd,
 	 * the toggle bit in the QH.
 	 */
 	if (qh) {
-		usb_settoggle(qh->dev, epnum, is_out, 0);
 		if (!list_empty(&qh->qtd_list)) {
 			WARN_ONCE(1, "clear_halt for a busy endpoint\n");
 		} else {
@@ -1030,6 +1029,7 @@ ehci_endpoint_reset(struct usb_hcd *hcd,
 			 * while the QH is active.  Unlink it now;
 			 * re-linking will call qh_refresh().
 			 */
+			usb_settoggle(qh->dev, epnum, is_out, 0);
 			qh->exception = 1;
 			if (eptype == USB_ENDPOINT_XFER_BULK)
 				start_unlink_async(ehci, qh);


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux