Re: [BUG] SD card reader disappears after suspend

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

 



On Tue, 23 Jan 2018, Samuel Sadok wrote:

> Thanks Alan,
> 
> While I was at it I also enabled debug logs for xhci_hcd and xhci_pci.
> 
> $ echo module usbcore =p > /sys/kernel/debug/dynamic_debug/control
> $ echo module xhci_hcd =p > /sys/kernel/debug/dynamic_debug/control
> $ echo module xhci_pci =p > /sys/kernel/debug/dynamic_debug/control
> $ modprobe usbmon
> $ cat /sys/kernel/debug/usb/usbmon/0u > /tmp/usbmon.log
> $ # press power button
> 
> dmesg: https://gist.github.com/anonymous/29b81574abf40605f999cfeefe98e341
> usbmon: https://gist.github.com/anonymous/55b6d9bbf8b8c8627230b10d2b09dcb6
> 
> Both logs were collected at the same time so the timestamps should match.

In fact they do, quite closely.  But there is a noticeable gap in the
usbmon trace, between lines 197 and 198 (the timestamp jumps from
35923531 to 38925126) and there obviously was a lot of activity on bus
1 in between.

> Resume starts at dmesg line 1255.
> As far as I can judge, the earliest indication of something going
> wrong is line 1514:
> [ 36.087176] xhci_hcd 0000:00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087180] usb 2-4: Disable of device-initiated U1 failed.
> [ 36.087212] xhci_hcd 0000:00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087224] usb 2-4: Disable of device-initiated U2 failed.
> [ 36.087226] xhci_hcd 0000:00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087227] usb 2-4: usb_reset_and_verify_device Failed to disable LTM

Yes, that's where the problem first seems to show up.  Apparently 
usb_disable_ltm() fails because it can't communicate with the device, 
and usb_reset_and_verify_device() then aborts because of that failure.
It shouldn't do this; after all, one very good reason for resetting the 
device is because we're unable to communicate with it.

You could try editing the source code for usb_reset_and_verify_device() 
in drivers/usb/core/hub.c, to see what happens if it doesn't give up 
after usb_disable_ltm() fails.

However, this does not explain the errors that occur later, notably 
around line 2008 or a little earlier:

[   42.819016] usb usb2-port4: not enabled, trying warm reset again...
[   42.819020] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[   42.819110] xhci_hcd 0000:00:14.0: Cannot set link state.
[   42.819125] usb usb2-port4: cannot disable (err = -32)
[   42.819180] usb usb2-port4: status 0341, change 0010, 5.0 Gb/s
[   42.819185] usb 2-4: USB disconnect, device number 2

Perhaps Mathias can take a look at this, and the error messages that
follow, and figure out what's going wrong.

Alan Stern

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