Re: xhci_hcd can't detect new devices after enabling runtime PM and disabling S3 wake (bug #85701)

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

 



On Mon, 6 Oct 2014, Dmitry Nezhevenko wrote:

> [ resending from bugzilla as requested ]+
> 
> On Lenovo t440p machine I've xhci_hcd port that doesn't work after enabling runtime PM:
> 
> 1. Just after boot, rmmod xhci_hcd and modprobe it again:

...

> 2. apply power_settings: 
> 
> % for F in /sys/bus/usb/devices/*; do test -f $F/power/control && echo auto | sudo tee $F/power/control; done 
> 
> [  947.442248] xhci_hcd 0000:00:14.0: PME# enabled
> [  947.482119] xhci_hcd 0000:00:14.0: power state changed by ACPI to D3cold
> 
> 3. disable XHCI in /proc/acpi/wakeup:
> 
> % echo XHCI | sudo tee /proc/acpi/wakeup
> % cat /proc/acpi/wakeup| grep XHCI
> XHCI      S3    *disabled  pci:0000:00:14.0

The right way to disable wakeup is to write "disabled" to the device's
power/wakeup attribute in sysfs.  Don't use /proc/acpi/wakeup.

> 4. plug some USB device to port:
> 
> [ 1072.724884] xhci_hcd 0000:00:14.0: power state changed by ACPI to D0
> [ 1072.828927] xhci_hcd 0000:00:14.0: PME# disabled
> [ 1072.828951] xhci_hcd 0000:00:14.0: enabling bus mastering
> [ 1072.829114] pci_pm_runtime_suspend(): hcd_pci_runtime_suspend+0x0/0x40 [usbcore] returns -16
> [ 1072.933036] xhci_hcd 0000:00:14.0: PME# enabled
> [ 1072.972798] xhci_hcd 0000:00:14.0: power state changed by ACPI to D3cold

We need to see what's going on here in more detail.  An easy way to 
start is to acquire a usbmon trace for bus 1 (see 
Documentation/usb/usbmon.txt for instructions).  Start the trace before 
plugging in the device and stop it after the device is attached.

Also, you should enable debugging for usbcore:

	echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control

assuming you have dynamic debugging enabled in your kernel.

> 5. device is not detected and not present in lsusb. I'm using smartphone as
> device and it's starts charging (but doesn't display 'connected' message).
> Reenabling xhci in /proc/acpi/wakeup doesn't help. Always reproduces.
> 
> 6. Unplug device, rmmod xhci_hcd and repeat everything again except 3 (don't
> disable XHCI in /proc/acpi/wakeup):
> 
> ...
> [ 1240.128339] xhci_hcd 0000:00:14.0: PME# enabled
> [ 1240.176209] xhci_hcd 0000:00:14.0: power state changed by ACPI to D3cold
> 
> 7. Plug device again (XHCI is enabled in /proc/acpi/wakeup):
> 
> [ 1295.636130] xhci_hcd 0000:00:14.0: power state changed by ACPI to D0
> [ 1295.740136] xhci_hcd 0000:00:14.0: PME# disabled
> [ 1295.740150] xhci_hcd 0000:00:14.0: enabling bus mastering
> [ 1295.740238] pci_pm_runtime_suspend(): hcd_pci_runtime_suspend+0x0/0x40 [usbcore] returns -16
> [ 1295.844209] xhci_hcd 0000:00:14.0: PME# enabled
> [ 1295.876043] xhci_hcd 0000:00:14.0: power state changed by ACPI to D3cold
> [ 1296.667761] xhci_hcd 0000:00:14.0: power state changed by ACPI to D0
> [ 1296.771757] xhci_hcd 0000:00:14.0: PME# disabled
> [ 1296.771772] xhci_hcd 0000:00:14.0: enabling bus mastering
> [ 1296.771860] pci_pm_runtime_suspend(): hcd_pci_runtime_suspend+0x0/0x40 [usbcore] returns -16
> [ 1296.987688] usb 1-6: new high-speed USB device number 5 using xhci_hcd
> [ 1297.118812] usb 1-6: New USB device found, idVendor=0fca, idProduct=8012
> [ 1297.118815] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 1297.118817] usb 1-6: Product: RIM Network Device
> [ 1297.118818] usb 1-6: Manufacturer: Research In Motion, Ltd.
> [ 1297.118819] usb 1-6: SerialNumber: EBD1BA7B6C5E4765D017A580236520AB97994D33
> [ 1297.139270] rndis_host 1-6:1.0: rndis media connect
> [ 1297.161920] rndis_host 1-6:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-6, RNDIS device, 96:eb:cd:0d:5f:e9
> [ 1297.173486] rndis_host 1-6:1.0 usb6: renamed from usb0
> [ 1297.191666] systemd-udevd[19181]: renamed network interface usb0 to usb6
> 
> So now it works as expected. I'm disabling everything from /proc/acpi/wakeup to
> make sure that laptop will not be resumed by any USB device.

This is odd because the wakeup setting should not make any difference 
at all, since you're not using system suspend.

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