Re: Callback not called on bulk out transfer with usbfs

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

 



On Wed, 20 Jun 2012, Austin Schuh wrote:

> > The IAA interrupts aren't getting lost. �Instead we're seeing early
> > timer expirations, probably caused by imprecise timer values. �What do
> > you have CONFIG_HZ set to
> 
> CONFIG_HZ=100

Yes, that explains it.  The timer values would be too imprecise for any 
CONFIG_HZ value smaller than 200.  Okay, never mind the IAA stuff...

> Ok.  Here's the trace.  I might have an extra print or two in there
> from some of my other debugging, but it should be pretty clean.

...
> [  430.268189] usb 1-4: usbdev_do_ioctl: SUBMITURB
> [  430.268196] usb 1-4: userurb 00007f1c3881e250, ep2 bulk-out, length 12
> [  430.268199] data: 0c 00 00 00 01 00 16 91 25 00 00 00
>                                                ........%...
> [  430.268324] ehci_hcd 0000:00:1a.7: IRQ: status c009 cmd 10021
> 
> $ cat 0000\:00\:1a.7/async
> qh/ffff88055e366980 dev7 hs ep2 42002207 40000000 (00008c00  data0 nak4)
> 	ffff880037801240 out len=0 00008c00 urb ffff880522de5c80

That's the smoking gun.  There _was_ an interrupt, and the STS_INT bit
(the 0x01 bit) in the status register was set.  That should have caused
ehci_irq to call ehci_work -> scan_async -> qh_completions.

qh_completions should have seen that the QTD_STS_ACTIVE bit wasn't set
in the qTD token (the 0x80 bit in the low-order byte of the 00008c00
word in the second line of the "async" file).  That would tell it the
transfer was complete.

Here's a patch to print out the values of the qTD tokens.  Let's see 
what it shows when your transfer hangs up.  Leave the "IRQ:" message in 
place.

Alan Stern



Index: usb-3.4/drivers/usb/host/ehci-q.c
===================================================================
--- usb-3.4.orig/drivers/usb/host/ehci-q.c
+++ usb-3.4/drivers/usb/host/ehci-q.c
@@ -364,6 +364,7 @@ qh_completions (struct ehci_hcd *ehci, s
 		/* hardware copies qtd out of qh overlay */
 		rmb ();
 		token = hc32_to_cpu(ehci, qtd->hw_token);
+ehci_dbg(ehci, "qh %p qtd %p token %x\n", qh, qtd, token);
 
 		/* always clean up qtds the hc de-activated */
  retry_xacterr:

--
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