You are not logged in.

#1 2017-05-25 16:59:52

shaong
Member
Registered: 2016-12-07
Posts: 26

adb crashes xhci

Hi, I am currently developing Android application and whenever I start adb with my phone plugged in, xhci will die a little moment later and could only be restarted by rebooting the system. By looking through journalctl, only these are relevant to the issue and no other logs.

May 26 00:21:34 waifu kernel: xhci_hcd 0000:00:14.0: HC died; cleaning up
May 26 00:21:34 waifu kernel: xhci_hcd 0000:00:14.0: Assuming host is dying, halting host.
May 26 00:21:34 waifu kernel: xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command.

Not sure is it a software problem or a hardware problem, but xhci never dies when I don't run adb.
Is there anyway to fix this problem?

p.s Not sure whether this is the correct place to ask, could it be under Kernel & Hardware?

Offline

#2 2017-05-25 21:18:44

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: adb crashes xhci

What's the output of 'uname -a' and 'lspci -nnk'?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-05-26 04:36:32

shaong
Member
Registered: 2016-12-07
Posts: 26

Re: adb crashes xhci

uname -a

Linux waifu 4.11.2-1-ARCH #1 SMP PREEMPT Mon May 22 06:53:49 CEST 2017 x86_64 GNU/Linux

lspci -nnk

00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller [8086:0c04] (rev 06)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel modules: ie31200_edac
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller [8086:0c01] (rev 06)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06)
        Subsystem: Lenovo Device [17aa:3801]
        Kernel driver in use: i915
        Kernel modules: i915
00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
00:14.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI [8086:8c31] (rev 05)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci
00:16.0 Communication controller [0780]: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 [8086:8c3a] (rev 04)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: mei_me
        Kernel modules: mei_me
00:1a.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 [8086:8c2d] (rev 05)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: ehci-pci
        Kernel modules: ehci_pci
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 [8086:8c16] (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp
00:1c.4 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 [8086:8c18] (rev d5)
        Kernel driver in use: pcieport
        Kernel modules: shpchp                                                                                                                                                                                         
00:1d.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 [8086:8c26] (rev 05)                                                                                                  
        Subsystem: Lenovo Device [17aa:3978]                                                                                                                                                                           
        Kernel driver in use: ehci-pci                                                                                                                                                                                 
        Kernel modules: ehci_pci                                                                                                                                                                                       
00:1f.0 ISA bridge [0601]: Intel Corporation HM86 Express LPC Controller [8086:8c49] (rev 05)                                                                                                                          
        Subsystem: Lenovo Device [17aa:3978]                                                                                                                                                                           
        Kernel driver in use: lpc_ich
        Kernel modules: lpc_ich
00:1f.2 SATA controller [0106]: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] [8086:8c03] (rev 05)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: ahci
        Kernel modules: ahci
00:1f.3 SMBus [0c05]: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller [8086:8c22] (rev 05)
        Subsystem: Lenovo Device [17aa:3978]
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GT 755M] [10de:0fcd] (rev a1)
        Subsystem: Lenovo Device [17aa:3801]
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia
07:00.0 Ethernet controller [0200]: Qualcomm Atheros QCA8171 Gigabit Ethernet [1969:10a1] (rev 10)
        Subsystem: Lenovo Device [17aa:3800]
        Kernel driver in use: alx
        Kernel modules: alx
08:00.0 Network controller [0280]: Qualcomm Atheros AR9485 Wireless Network Adapter [168c:0032] (rev 01)
        Subsystem: Lenovo Device [17aa:3218]
        Kernel driver in use: ath9k
        Kernel modules: ath9k

Offline

#4 2017-05-26 18:43:59

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: adb crashes xhci

Please also post full dmesg output which includes the xhci host hanging.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2017-05-27 14:19:26

shaong
Member
Registered: 2016-12-07
Posts: 26

Re: adb crashes xhci

Offline

#6 2017-05-27 14:49:43

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,709

Re: adb crashes xhci

The baddness seems to happen here:

[21117.832580] usb 3-2: new high-speed USB device number 12 using xhci_hcd
[21127.955478] usb 4-2.1: USB disconnect, device number 3
[21133.818113] ------------[ cut here ]------------
[21133.818115] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[21133.818124] WARNING: CPU: 2 PID: 0 at drivers/usb/host/xhci-ring.c:1390 handle_cmd_completion+0xc1b/0xd80 [xhci_hcd]

What type of phone is it and what ROM is it using?
Do other Android devices work?
Is the phone, per chance, prompting you for permission to debug from that host during the 10 seconds before it disconnects?
Can you enumerate the device on the USB bus if you turn off USB debugging on the phone? (adb will obviously not work)

Edit: BTW, I just did a full update and it works here with my HTC one M8 running SkyDragon 4

ewaller@turing ~ 1002 %adb shell
shell@htc_m8:/ $ exit
ewaller@turing ~ 1003 %adb devices
List of devices attached
FA49AWM00543	device

ewaller@turing ~ 1004 %

Last edited by ewaller (2017-05-27 14:52:27)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2017-05-27 16:32:31

shaong
Member
Registered: 2016-12-07
Posts: 26

Re: adb crashes xhci

Phone: Xperia XA
ROM: Default ROM
No prompts whatsoever when it disconnects.

lsusb

Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0cf3:3004 Qualcomm Atheros Communications AR3012 Bluetooth 4.0
Bus 003 Device 035: ID 0fce:01de Sony Ericsson Mobile Communications AB 
Bus 003 Device 002: ID 0bda:58b9 Realtek Semiconductor Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Offline

#8 2017-05-27 16:44:33

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: adb crashes xhci

Do you have any virtual machine software installed? I see a few lines about "/dev/vmnet" which seem to point at some sort of virtual machine software being installed. It might be trying to capture (some) usb devices and causing trouble.

Try not to load any of the modules related to the virtualization software and check if the xhci host still hangs when connecting your phone.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-05-27 18:29:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,709

Re: adb crashes xhci

... And, just like that, my adb went to hell in a handbasket.  I get a series of disconnect, reconnects.

It crashes the colord.service if it is running.  hmm

Edit:  And backing down to the 4.10 kernel did not help.
Edit 2:  ... and changing from SkyDragon to LineageOS fixed the connect and disconnect issues.

But, as much as I prefer LineageOS, it does not work with Andoid Auto in my Civic.  SkyDragon does, but is becoming unstable in other areas.

Regardless, I'm not sure it is a Linux issue.

Last edited by ewaller (2017-05-27 18:51:46)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2017-05-28 13:05:13

shaong
Member
Registered: 2016-12-07
Posts: 26

Re: adb crashes xhci

R00KIE wrote:

Do you have any virtual machine software installed? I see a few lines about "/dev/vmnet" which seem to point at some sort of virtual machine software being installed. It might be trying to capture (some) usb devices and causing trouble.

Try not to load any of the modules related to the virtualization software and check if the xhci host still hangs when connecting your phone.

xhci still dies even when vm related modules are disabled.

p.s. It looks like adb is causes the kernel to scan for USB devices when it runs. Could the problem some sort related to IO blocking?

May 28 21:04:23 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:04:23 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:04:23 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 14 using xhci_hcd
May 28 21:04:23 waifu kernel: usb 4-3.1: USB disconnect, device number 13
May 28 21:04:20 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:04:20 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:04:20 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 13 using xhci_hcd
May 28 21:04:19 waifu kernel: usb 4-3.1: USB disconnect, device number 12
May 28 21:04:12 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:04:12 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:04:12 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 12 using xhci_hcd
May 28 21:04:12 waifu kernel: usb 4-3.1: USB disconnect, device number 11
May 28 21:03:56 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:56 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:56 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 11 using xhci_hcd
May 28 21:03:56 waifu kernel: usb 4-3.1: USB disconnect, device number 10
May 28 21:03:55 waifu kwin_x11[615]: QXcbConnection: XCB error: 3 (BadWindow), sequence: 17532, resource id: 106954776, major code: 18 (ChangeProperty), minor code: 0
May 28 21:03:54 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:54 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:54 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 10 using xhci_hcd
May 28 21:03:54 waifu kernel: usb 4-3.1: USB disconnect, device number 9
May 28 21:03:53 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:53 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:53 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 9 using xhci_hcd
May 28 21:03:53 waifu kernel: usb 4-3.1: USB disconnect, device number 8
May 28 21:03:41 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:41 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:41 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 8 using xhci_hcd
May 28 21:03:41 waifu kernel: usb 4-3.1: USB disconnect, device number 7
May 28 21:03:33 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:33 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:33 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 7 using xhci_hcd
May 28 21:03:33 waifu kernel: usb 4-3.1: USB disconnect, device number 6
May 28 21:03:27 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:27 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:27 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 6 using xhci_hcd
May 28 21:03:26 waifu kernel: usb 4-3.1: USB disconnect, device number 5
May 28 21:03:23 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:23 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:23 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 5 using xhci_hcd
May 28 21:03:23 waifu kernel: usb 4-3.1: USB disconnect, device number 4
May 28 21:03:07 waifu kernel: hub 4-3.1:1.0: 4 ports detected
May 28 21:03:07 waifu kernel: hub 4-3.1:1.0: USB hub found
May 28 21:03:07 waifu kernel: usb 4-3.1: new SuperSpeed USB device number 4 using xhci_hcd
May 28 21:03:07 waifu kernel: usb 4-3.1: USB disconnect, device number 3

Last edited by shaong (2017-05-28 13:08:23)

Offline

#11 2017-05-28 22:15:16

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: adb crashes xhci

I'd be more inclined to go with ewaller's hunch, I'm not completely sure a "rescan" of usb devices should cause the devices to disconnect and reconnect. Most probably there is a bug in the usb stack of your phone and it either times out or returns something that the xhci driver is not expecting and makes it hang.

My guess at the virtual machine modules was just that, a guess. However if you want to seek help upstream I suggest you keep testing without having the modules loaded otherwise you get a tainted kernel and upstream might not like that.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB