[PATCH 3/4] usb: xhci: handle Set TR Deq Context State Error due to Slot state

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


(追記) (追記ここまで)



One of the reasons for a Set TR Deq Context State Error, is that the Slot
state is not Default, Configured, or Addressed. This leaves it 2 options;
Enabled and Disabled. If the slot state was Disabled, HW would have
returned a Slot Not Enabled Error, which only leaves Enabled Slot state.
Devices with a slot state of Enabled must have previously been in a
Disabled slot state. Both Enabled and Disabled slot states have the
Doorbell register disabled, meaning they do not receive or handle TDs.
Consequently, all cancelled TDs are released.
xHCI specification, rev 1.2:
 Slot State		section 4.5.3
 Set TR Dequeue Pointer	section 4.6.10
Signed-off-by: Niklas Neronin <niklas.neronin@xxxxxxxxxxxxxxx>
---
 drivers/usb/host/xhci-ring.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 79c15dbae43b..f4e4bd8db210 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1465,10 +1465,15 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
 			xhci_warn(xhci, "Set TR Deq error slot %d is Disabled\n", slot_id);
 			goto td_cleanup;
 		case COMP_CONTEXT_STATE_ERROR:
-			xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.\n");
-			ep_state = GET_EP_CTX_STATE(ep_ctx);
 			slot_state = le32_to_cpu(slot_ctx->dev_state);
 			slot_state = GET_SLOT_STATE(slot_state);
+			if (slot_state == SLOT_STATE_ENABLED) {
+				xhci_warn(xhci, "Set TR Deq error slot %d is Enabled\n", slot_id);
+				goto td_cleanup;
+			}
+
+			xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due to incorrect ep state.\n");
+			ep_state = GET_EP_CTX_STATE(ep_ctx);
 			xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
 					"Slot state = %u, EP state = %u",
 					slot_state, ep_state);
-- 
2.50.1

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

(追記) (追記ここまで)
Powered by Linux

AltStyle によって変換されたページ (->オリジナル) /