Re: xHCI driver issue (ASMedia Controller using xhci_hcd)

2016-01-06 Thread Steve Graham
In my case, my scanner problem has been fixed (so far) by tuning off
autosuspend:

# echo -1 >/sys/module/usbcore/parameters/autosuspend

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


Re: xHCI driver issue (ASMedia Controller using xhci_hcd)

2016-01-06 Thread Oliver Neukum
On Wed, 2016-01-06 at 17:52 +, Steve Graham wrote:
> In my case, my scanner problem has been fixed (so far) by tuning off
> autosuspend:
> 
> # echo -1 >/sys/module/usbcore/parameters/autosuspend

Did you see any other device failing or is it specific
to your scanner?

Regards
Oliver


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


Re: xHCI driver issue (ASMedia Controller using xhci_hcd)

2016-01-06 Thread Steve Graham
I've been trying to get my scanner working on my newer laptop (entire Linux
installation, apart from the kernel (4.2.5) cloned from the old one) and I
seem to be seeing the same issue, although I have no problem with USB
storage or HID devices on the USB 3 port.

Here's a clip from the debug with SANE_DEBUG_SANEI_USB &
SANE_DEBUG_SANEI_LM983X set:

[sanei_lm983x] sanei_lm983x_write: fd=1, reg=0x59, len=1, increment=0
[sanei_usb] sanei_usb_write_bulk: trying to write 5 bytes
[sanei_usb] 000 00 59 00 01 66  .Y..f   
[sanei_usb] sanei_usb_write_bulk: sg : about to call usb_bulk_write
[sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily unavailable
[sanei_usb] sanei_usb_write_bulk: wanted 5 bytes, wrote 0 bytes
[sanei_lm983x] sanei_lm983x_write: short write (0/5)
[sanei_lm983x] sanei_lm983x_write: couldn't even send command

That's after four successful reads and writes, and is at the same point
every time. After this, all reads and writes fail and the sane interface
hangs. If you try running it again, it fails straight away, and the USB plug
has to be pulled and re-inserted before the first series of reads and writes
work again.

I'll carry on poking at this, but maybe someone who really understands what
is going on will see the posts and think of something!




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


Re: xHCI driver issue (ASMedia Controller using xhci_hcd)

2016-01-06 Thread Steve Graham
Oliver Neukum  writes:

> > # echo -1 >/sys/module/usbcore/parameters/autosuspend
> 
> Did you see any other device failing or is it specific
> to your scanner?
> 
>   Regards
>   Oliver
> 
All other devices I own have worked as expected: mouse, keyboard, storage
(memory card, hard disk) and a TV decoder.



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


xHCI driver issue (ASMedia Controller using xhci_hcd)

2015-12-30 Thread Johannes Bauer
Hi list,

I originally posted this on libusb-devel [1], but got a friendly
redirect here by Alan Stern, hope this is the right place!

Let me describe my problem from a "user" standpoint before diving into
the technical details: USB 3.0 does not work on my PC flat out.
Sometimes USB 3.0 ports work for /some/ USB 2.0 devices, but most of the
time they don't at all (e.g. RS232 converters will show up at first but
have transmission errors once I open the tty device, etc.). If they do
work, they're flaky as hell. All USB 3.0 ports are, for all practical
purposes, unusable on my system (even with USB 2 devices attached).

Here's an example of a USB 3.0 device (ix500 scanner) and what happens
when I plug it in:

$ dmesg
[  167.736631] usb 8-1: new SuperSpeed USB device number 2 using xhci_hcd
[  167.756492] usb 8-1: New USB device found, idVendor=04c5, idProduct=132b
[  167.756497] usb 8-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[  167.756500] usb 8-1: Product: ScanSnap iX500
[  167.756503] usb 8-1: Manufacturer: Fujitsu

(note this is a freshly booted system, no previous suspend/hiberate
going on).

Then I try to scan with it:

$ scanimage
scanimage: open of device fujitsu:ScanSnap iX500:9768 failed: Error
during device I/O

No log output is shown in dmesg. Subsequent attempts to scan with the
device yield:

$ scanimage
scanimage: no SANE devices found

Note that the scanner works perfectly on my USB 2.0 ports of the system
and it works perfectly on the exact same USB 3.0 ports under Windows (I
bit the bullet, installed Windows 7, and tried that out just today).

Some details about my system: I'm using an MSI X99S-SLI PLUS (BIOS v1.9,
latest one) motherboard. The xhci controller is a ASMedia brand:

$ lspci -nn | grep -i asme
06:00.0 USB controller [0c03]: ASMedia Technology Inc. Device [1b21:1142]

I'm running Linux Mint x86_64. The problem occured with the stock
3.16.0-38-generic #52~14.04.1-Ubuntu SMP kernel, but I've also just now
compiled the latest stable 4.3.3 and can reproduce the exact same
problem with it.

Let's look at a strace of the first scanimage call:

$ strace -ff scanimage
[...]
open("/dev/bus/usb/008/005", O_RDWR)= 3
ioctl(3, USBDEVFS_CLAIMINTERFACE, 0x7ffe9ccfa08c) = 0
ioctl(3, USBDEVFS_SUBMITURB, 0x7ffe9ccf9ec0) = 0
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = 0
ioctl(3, USBDEVFS_SUBMITURB, 0x7ffe9ccf9ec0) = 0
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = -1 EAGAIN (Resource
temporarily unavailable)
select(4, NULL, [3], NULL, {0, 1000})   = 0 (Timeout)
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = -1 EAGAIN (Resource
temporarily unavailable)
select(4, NULL, [3], NULL, {0, 1000})   = 0 (Timeout)
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = -1 EAGAIN (Resource
temporarily unavailable)

[this repeats about 1300 times, interrupted two times by:]

ioctl(3, USBDEVFS_DISCARDURB, 0x7ffe9ccf9ec0) = 0
ioctl(3, USBDEVFS_REAPURB, 0x7ffe9ccf9e88) = 0
ioctl(3, SNDRV_CTL_IOCTL_ELEM_UNLOCK or USBDEVFS_CLEAR_HALT,
0x7ffe9ccf9f9c) = 0
ioctl(3, USBDEVFS_SUBMITURB, 0x7ffe9ccf9ec0) = 0
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = 0
ioctl(3, USBDEVFS_SUBMITURB, 0x7ffe9ccf9ec0) = 0

[and finally]

ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = -1 EAGAIN (Resource
temporarily unavailable)
select(4, NULL, [3], NULL, {0, 1000})   = 0 (Timeout)
ioctl(3, USBDEVFS_REAPURBNDELAY, 0x7ffe9ccf9e88) = -1 EAGAIN (Resource
temporarily unavailable)
ioctl(3, USBDEVFS_DISCARDURB, 0x7ffe9ccf9ec0) = 0
ioctl(3, USBDEVFS_REAPURB, 0x7ffe9ccf9e88) = 0
ioctl(3, SNDRV_CTL_IOCTL_ELEM_UNLOCK or USBDEVFS_CLEAR_HALT,
0x7ffe9ccf9f9c) = 0
ioctl(3, USBDEVFS_SETINTERFACE, 0x7ffe9ccfa0b0) = 0
ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST or USBDEVFS_RELEASEINTERFACE,
0x7ffe9ccfa0dc) = 0
close(3)= 0
write(2, "scanimage: open of device fujits"..., 86scanimage: open of
device fujitsu:ScanSnap iX500:9768 failed: Error during device I/O
) = 86

Then, on the second call, during device discovery, something similar:

$ strace -ff scanimage
[...]
open("/dev/bus/usb/008/004", O_RDWR)= 4
ioctl(4, USBDEVFS_CLAIMINTERFACE, 0x7ffdcbcacfbc) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0x7ffdcbcacdf0) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0x7ffdcbcacdb8) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0x7ffdcbcacdf0) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0x7ffdcbcacdb8) = -1 EAGAIN (Resource
temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 0 (Timeout)
ioctl(4, USBDEVFS_REAPURBNDELAY, 0x7ffdcbcacdb8) = -1 EAGAIN (Resource
temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 0 (Timeout)
[... tons of repeats ...]
ioctl(4, USBDEVFS_REAPURBNDELAY, 0x7ffdcbcacdb8) = -1 EAGAIN (Resource
temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 0 (Timeout)
ioctl(4, USBDEVFS_REAPURBNDELAY, 0x7ffdcbcacdb8) = -1 EAGAIN (Resource
temporarily unavailable)
ioctl(4, USBDEVFS_DISCARDURB, 0x7ffdcbcacdf0) = 0
ioctl(4, USBDEVFS_REAPURB, 0x7ffdcbcacdb8) = 0
ioctl(4,