On Wed, May 24, 2017 at 11:34 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Wed, 24 May 2017, Kai-Heng Feng wrote: > >> On Wed, May 24, 2017 at 12:43 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: >> >> >> >> Output of `cat /sys/kernel/debug/usb/usbmon/1u`: >> >> Runtime PM disabled as attachment. >> > >> > When you say "runtime PM disabled", you mean that it is disabled for >> > the EHCI controller but enabled for other devices, right? >> >> Yes, disabled for the ehci-hcd. Runtime PM is enabled for ehci-pci. >> >> > >> >> It's empty when runtime PM is enabled. >> > >> > And nothing shows up in the dmesg log either? This suggests that the >> > PME signal isn't working properly. >> > >> > Try doing this: With runtime PM enabled, plug in a device. When >> > nothing happens, do: >> > >> > lspci -v -s 00:12.0 >> > >> > The output should show whether the controller is sending a wakeup >> > signal. Does it cause the device to be detected? >> >> No. >> >> 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB >> EHCI Controller (rev 39) (prog-if 20 [EHCI]) >> Subsystem: Dell FCH USB EHCI Controller >> Flags: 66MHz, medium devsel, IRQ 18 >> Memory at fe769000 (32-bit, non-prefetchable) [size=256] >> Capabilities: [c0] Power Management version 2 >> Capabilities: [e4] Debug port: BAR=1 offset=00e0 >> Kernel driver in use: ehci-pci >> >> > If it doesn't, run lsusb. That definitely should wake up the >> > controller and cause the device to be detected. Then run the lspci >> > command again. Let's see what the output from these commands shows. >> >> I plugged an optical mouse to test: >> lsusb or "lsusb -s 001:001" does nothing, the mouse is not shown in >> lsusb. The optical light is off. >> "lsusb -s 001:001 -v" wakes up the controller and make the mouse to be >> detected, the mouse is in lsusb and works correctly. >> Once I turned on runtime PM on the mouse, it no longer works. The >> optical light is still on but it did not response to movement or >> click. >> >> This is the lspci right after I use "lsusb -s 001:001 -v" to wake up >> the controller: >> 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB >> EHCI Controller (rev 39) (prog-if 20 [EHCI]) >> Subsystem: Dell FCH USB EHCI Controller >> Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18 >> Memory at fe769000 (32-bit, non-prefetchable) [size=256] >> Capabilities: [c0] Power Management version 2 >> Capabilities: [e4] Debug port: BAR=1 offset=00e0 >> Kernel driver in use: ehci-pci > > My mistake; we need to see the information from "lspci -vv -s 00:12.0" > with two "v"'s, not just one. Before wakeup: 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39) (prog-if 20 [EHCI]) Subsystem: Dell FCH USB EHCI Controller Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Interrupt: pin A routed to IRQ 18 Region 0: Memory at fe769000 (32-bit, non-prefetchable) [size=256] Capabilities: [c0] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D3 NoSoftRst- PME-Enable+ DSel=0 DScale=0 PME- Bridge: PM- B3+ Capabilities: [e4] Debug port: BAR=1 offset=00e0 Kernel driver in use: ehci-pci After wakeup: 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 39) (prog-if 20 [EHCI]) Subsystem: Dell FCH USB EHCI Controller Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 32, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 18 Region 0: Memory at fe769000 (32-bit, non-prefetchable) [size=256] Capabilities: [c0] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Bridge: PM- B3+ Capabilities: [e4] Debug port: BAR=1 offset=00e0 Kernel driver in use: ehci-pci > > There's another piece of information you can collect. Mount a > debugfs filesystem at /sys/kernel/debug, and then copy the contents of > the file > > /sys/kernel/debug/usb/ehci/0000:00:12.0/registers > > Do this while the controller is still asleep (after the mouse is > plugged in) and then again after it is awake. Before wakeup: bus pci, device 0000:00:12.0 EHCI Host Controller SUSPENDED (no register access) After wakeup: bus pci, device 0000:00:12.0 EHCI Host Controller EHCI 1.00, rh state running ownership 00000001 SMI sts/enable 0xc0080000 structural params 0x00200002 capability params 0x0000a076 status 4008 Periodic FLR command 0010015 (park)=0 ithresh=1 Periodic period=512 RUN intrenable 37 IAA FATAL PCD ERR INT uframe 2d5f port:1 status 001005 0 ACK POWER sig=se0 PE CONNECT port:2 status 001000 0 ACK POWER sig=se0 irq normal 1855 err 10 iaa 98 (lost 0) complete 1865 unlink 10 -- 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