You are not logged in.

#1 2020-03-05 07:45:58

pacoandres
Member
Registered: 2020-03-05
Posts: 56

USB multicard reader continuously reset when no card inserted

I've a Realtek multicard reader (vendor: 0bda, device: 0151) that works well. But a few days ago it started to make a lot of log noise with continuous reset messages when there is no sdcard inserted:

[ 1105.846841] usb 1-9: reset high-speed USB device number 2 using xhci_hcd
[ 1173.764481] usb 1-9: reset high-speed USB device number 2 using xhci_hcd
[ 1196.874721] usb 1-9: reset high-speed USB device number 2 using xhci_hcd
[ 1280.010251] usb 1-9: reset high-speed USB device number 2 using xhci_hcd
[ 1280.250129] usb 1-9: reset high-speed USB device number 2 using xhci_hcd

When a sdcard is inserted the noise stops.

I've captured the USB conversation and I've seen that the kernel is constantly checking the device, as the Wireshark capture shows:

15	0.793799	host	1.2.1	USBMS	95	SCSI: Test Unit Ready LUN: 0x03 	
16	0.793832	1.2.1	host	USB	64	URB_BULK out	
17	0.793842	host	1.2.2	USB	64	URB_BULK in	
18	0.793903	1.2.2	host	USBMS	77		
19	0.793916	host	1.2.1	USBMS	95	SCSI: Request Sense LUN: 0x03 	
20	0.793941	1.2.1	host	USB	64	URB_BULK out	
21	0.793952	host	1.2.2	USB	64	URB_BULK in	
22	0.794058	1.2.2	host	USB	82	URB_BULK in	

But sometimes, when no card is inserted, the last response from the device is

URB status: Broken pipe (-EPIPE) (-32)

instead of Success. And then the system resets the device.

When a card is inserted everything works ok.

The current kernel is 5.4.23-1-lts. I'm not sure when this logs messages started, with the latest update or before.

I've tried to modify the power options in /sys/bus/usb/devices/1-9/power folder with no success.

Does anyone know how to solve this problem or where can I find more info for solving it? Because it's getting a little hard searching in the logs.

Thanks.

Offline

#2 2020-03-05 11:50:09

xerxes_
Member
Registered: 2018-04-29
Posts: 1,065

Re: USB multicard reader continuously reset when no card inserted

https://superuser.com/questions/668911/ … ts/1107610

Instead removing ehci_hcd driver remove (blacklist) xhci_hcd and reboot.

Or don't plug in card reader with no card.

Last edited by xerxes_ (2020-03-05 11:51:31)

Offline

#3 2020-03-05 17:36:36

pacoandres
Member
Registered: 2020-03-05
Posts: 56

Re: USB multicard reader continuously reset when no card inserted

Thanks for the idea.

As there are also some USB3 ports I can't blacklist xhci. So I'm trying to have  USB 3 ports with xhci and USB 2 with ehci.

I'm unbinding the USB 2 ports from xhci and trying to binding them to ehci, but the binding is not working:

[root@monelle paco]# echo 0000:01:00.0 | tee /sys/bus/pci/drivers/ehci-pci/bind 
0000:01:00.0
tee: /sys/bus/pci/drivers/ehci-pci/bind: No such device

I don't know why there is no such device as ls command lists it.

I'm also trying another way: setting avoid_reset_quirk to 1.

echo 1 > /sys/bus/usb/devices/1-9/avoid_reset_quirk

It works, it stops the log noise.
But I can't figure the side effects of this. The only document that I've found about this parameter is https://www.kernel.org/doc/html/latest/ … eset_quirk, and it doesn't really tell what this parameter does.

The idea about always plug the reader with a card can't work. It's an internal reader.

Thanks again.

Last edited by pacoandres (2020-03-05 17:39:13)

Offline

#4 2020-03-07 07:46:08

pacoandres
Member
Registered: 2020-03-05
Posts: 56

Re: USB multicard reader continuously reset when no card inserted

After some tests, setting avoid_reset_quirk to 1 is not good.

I've made an udev rule for setting it on boot and makes lvm2-monitor.service to take up to 2 minutes to start, and plasma desktop up to 5 minutes.

If anyone has an idea about how to solve the log noise, please tell me.

Thanks

Last edited by pacoandres (2020-03-07 07:46:36)

Offline

#5 2020-03-07 12:18:16

pacoandres
Member
Registered: 2020-03-05
Posts: 56

Re: USB multicard reader continuously reset when no card inserted

From the last post I've been working in the first idea: to use ehci on USB 2 ports.

But after some work I'm unable to use ehci on any port. I think that's because the hardware has only xhci host controllers. And I'm thinking that the log noise must be there since ever and I haven't notice it for some reason.

But, anyway, I'd like to remove this log noise. I'll keep working on it, and If I can remove it I'll post here the way.

Thanks

Offline

Board footer

Powered by FluxBB