Re: XHCI, "brain-dead scanner", and microframe rounding

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

 



On 06/30/2014 12:02 AM, Mike Mammarella wrote:
>  recently got a computer [1] with USB3 ports, and plugged my Fujitsu Scansnap S1500 scanner into one of them. It turns out this doesn't work, and after a lot of searching the web and tinkering with it I've discovered that it has something to do with XHCI. If I recompile the kernel without the xhci_hcd driver (merely not loading the module is insufficient, since the ehci_hcd driver knows to defer to xhci_hcd in that case), then the scanner works.
> 
> It looks like this has been known for some time [2], but nobody's been able to work out exactly what the problem is. (I'm using Debian, but Ubuntu's similar; I see the same microframe rounding messages, for instance.) Following some of the debugging instructions on a thread on sane-devel [3], I found that when using xhci_hcd, SANE thinks my scanner is "brain-dead." (The thread is about a slightly different Fujitsu scanner, but I see very similar symptoms.)
> 
> So, can I convince you to take a look at this with me in more detail? I know very little about the USB(3) stack and the its implementation in Linux, but I am a proficient software engineer and I've written (out of tree) kernel modules before, so I hope that remote debugging this hardware driver issue through my hands won't be so terrib


Hi

Can you add xhci debugging by enabling CONFIG_DYNAMIC_DEBUG, and run
`echo -n 'module xhci_hcd =p' > /sys/kernel/debug/dynamic_debug/control`
as root,
and send me the output of dmesg.

Without debugging info it's hard to guess what's going on.

The microframe rounding look a bit suspicious:
[12864.453456] usb 3-4: ep 0x81 - rounding interval to 128 microframes, ep desc says 255 microframes

xhci specs says it needs the interval rounded to nearest 2^(X) value, which would be 256, not 128. I'll take a look at that.

An other possibility is that it's related to how xhci handles halted endpoints. I got some untested code to fix this, It needs a lot of cleanup but can be tested.

If you are able to test my ep_reset_halt_test branch (with xhci debugging) I'd be interested to know if it helps.

Code is at:
git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git ep_reset_halt_test

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