On Thu, Mar 07, 2024 at 05:17:20PM +0100, Jan Čermák wrote: > Hi Alan, > > On 06. 03. 24 22:08, Alan Stern wrote: > > Can you provide two usbmon traces, one showing the problem with those > > patches present and the other (on the same system but with the patches > > reverted) showing the recovery? Comparison of the two should indicate > > what's happening differently. > > I reproduced the issue on my old ThinkPad X220 with 6.6.20 kernel, you can > find the usbmon captures below. This is quite strange; the two traces are the same up to this point: ffff9f9a29b3f300 298538675 S Co:1:002:0 s 23 03 0004 0002 0000 0 ffff9f9a29b3f300 298538893 C Co:1:002:0 0 0 ffff9f9a012cae40 298581342 C Ii:1:002:1 0:2048 1 = 04 ffff9f9a012cae40 298581372 S Ii:1:002:1 -115:2048 1 < ffff9f9a29b3f300 298742112 S Ci:1:002:0 s a3 00 0000 0002 0004 4 < ffff9f9a29b3f300 298742459 C Ci:1:002:0 0 4 = 03011000 ------------------------------------------------------------------ ffff8fc4ee367240 368298641 S Co:1:002:0 s 23 03 0004 0002 0000 0 ffff8fc4ee367240 368298823 C Co:1:002:0 0 0 ffff8fc4c0c5ac00 368343025 C Ii:1:002:1 0:2048 1 = 04 ffff8fc4c0c5ac00 368343056 S Ii:1:002:1 -115:2048 1 < ffff8fc4ee367240 368502095 S Ci:1:002:0 s a3 00 0000 0002 0004 4 < ffff8fc4ee367240 368502372 C Ci:1:002:0 0 4 = 01011100 The difference is in the last line: 03011000 vs. 01011100. This means that in the "working" scenario the device disconnected itself from the USB bus for no apparent reason and then reconnected, whereas in the "nonworking" scenario it didn't. The computer did nothing different before then, so I have no idea why the device's behavior changed. It's a mystery. Another thing the traces showed is that the device doesn't like the "new" initialization scheme; it wants the "old" one. You can test this by setting the old_scheme_first module parameter for usbcore before plugging in the device: echo 1 >/sys/module/usbcore/parameters/old_scheme_first Also, you can try the patch below (without the module parameter set). I suspect it should be applied in any case, but it would be nice to know if it makes any difference in your case. Alan Stern Index: usb-devel/drivers/usb/core/hub.c =================================================================== --- usb-devel.orig/drivers/usb/core/hub.c +++ usb-devel/drivers/usb/core/hub.c @@ -5481,6 +5481,7 @@ loop: msleep(2 * hub_power_on_good_delay(hub)); usb_hub_set_port_power(hdev, hub, port1, true); msleep(hub_power_on_good_delay(hub)); + hub_port_debounce_be_stable(hub, port1); } } if (hub->hdev->parent ||