Skip to contentSkip to conversation

usb: host: ehci: always enable interrupt for qtd completion at test mode

PATCH Superseded Peter Chen 1 participant 1 message Feb 2, 2018 USB

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH 1/1 usb: host: ehci: always enable interrupt for qtd completion at test mode

Quoted 29 lines · Alan Stern
Quoted 18 lines · Peter Chen

At former code, the SETUP stage does not enable interrupt for qtd completion, it relies on IAA watchdog to complete interrupt, then the transcation would be considered timeout if the flag need_io_watchdog is cleared by platform code.

In this commit, we always add enable interrupt for qtd completion, then the qtd completion can be notified by hardware interrupt.

---
 drivers/usb/host/ehci-q.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-q.c +0 -0
index 8815832..4cc2609 100644

drivers/usb/host/ehci-q.c static int submit_single_step_set_feature( · line 1196

Quoted 5 lines
drivers/usb/host/ehci-q.c +2 -0
@@ -1192,6 +1192,8 @@ static int submit_single_step_set_feature(
 		qtd_fill(ehci, qtd, urb->setup_dma,
 				sizeof(struct usb_ctrlrequest),
 				token | (2 /* "setup" */ << 8), 8);
+		/* Always enable interrupt on qtd completion */
+		qtd->hw_token |= cpu_to_hc32(ehci, QTD_IOC);

This would be cleaner if you didn't make it a separate statement. Before the call to qtd_fill(), you can do:

Quoted 1 line
		token |= QTD_IOC;	/* Interrupt after SETUP completion */

Since the variable "token" is used for every qtd, but I do not want interrupt for DATA stage, how about adding QTD_IOC directly at qtd_fill for both SETUP and STATUS stage?

  		qtd_fill(ehci, qtd, urb->setup_dma,
  				sizeof(struct usb_ctrlrequest),
  				QTD_IOC | token | (2 /* "setup" */ << 8), 8);