Bug 191681 - Thunderbolt 3 adapter fails to instantiate USB and device enumeration if already connected at boot time
Summary: Thunderbolt 3 adapter fails to instantiate USB and device enumeration if alre...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: x86-64 Linux
: P1 high
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-01 19:28 UTC by Chris Murphy
Modified: 2018-04-02 19:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.11.0-0.rc3.git0.2.fc26.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
normal behavior (94.72 KB, text/plain)
2017-01-01 19:44 UTC, Chris Murphy
Details
failure dmesg (108.31 KB, text/plain)
2017-01-01 19:50 UTC, Chris Murphy
Details
dmidecode (19.63 KB, text/plain)
2017-01-01 19:51 UTC, Chris Murphy
Details
lspci -vvnn (28.25 KB, text/plain)
2017-01-01 19:51 UTC, Chris Murphy
Details
failure dmesg using pci=prealloc (98.26 KB, text/plain)
2017-01-03 15:12 UTC, Chris Murphy
Details
acpidump (934.91 KB, application/octet-stream)
2017-01-03 15:15 UTC, Chris Murphy
Details
rdsosreport 4.11.0.rc3 (110.20 KB, text/plain)
2017-04-02 22:53 UTC, Chris Murphy
Details

Description Chris Murphy 2017-01-01 19:28:36 UTC
Summary: If manufacturer (HP) included USB-C to USB 3 is connected at boot time, kernel fails to instantiate USB bus entirely, ignores any USB devices (e.g.) flash drives that are connected.

-Problem does not happen when booting hardware with Windows 10
-Problem does not happen when adapter is not connected at boot time, once later connected the USB bus instantiates and connected USB devices enumerate as expected.

Product info:
HP Spectre Notebook 13-v021nr
http://support.hp.com/us-en/product/HP-Spectre-13-v000-Notebook-PC/10862121/model/11528128/document/c05146453/

There are 3 USB-C ports. Two are Thunderbolt 3, USB 3.1 Gen 2. The problem happens on these two ports. One USB-C port is USB 3.1 Gen 1 and also accepts power, the problem doesn't happen on this port.

As a consequence, booting Linux from a USB stick fails. The firmware and bootloader see the USB stick OK, but in the initramfs, the USB doesn't enumerate so root fs can't be mounted. This means the only way to install Linux is to use the Gen 1/power port, using battery powe

Best guess: I think the two Gen 2 ports are actually Thunderbolt 3/PCIe ports primarily, and something is just getting confused when the USB adapter is already present during boot; whereas the Gen 1/power port is already a USB port so it doesn't have to "become" a USB port. This may be a PCI bug rather than a USB bug.
Comment 1 Chris Murphy 2017-01-01 19:44:46 UTC
Created attachment 249501 [details]
normal behavior

Adapter is not connected at boot time; is connected later and works as expected.

[   59.241996] connect the adapter to the 1st USB-C (thunderbolt / gen2) port.
[  114.499730] adapter disconnected
[  134.361001] connect the adapter to the 2nd USB-C (thunderbolt / gen2) port.
[  165.344026] adapter disconnected
Comment 2 Chris Murphy 2017-01-01 19:50:13 UTC
Created attachment 249511 [details]
failure dmesg

Adapter is already connected at boot time.

[   41.384191] disconnect adapter from port 1
[   56.678193] connect adapter to port 2 - no USB is instantiated as it is for the normal dmesg case.
[   78.498122] disconnect adapter from port 2
Comment 3 Chris Murphy 2017-01-01 19:51:14 UTC
Created attachment 249521 [details]
dmidecode

Firmware is up to date. Problem happens with original and updated firmware.
Comment 4 Chris Murphy 2017-01-01 19:51:26 UTC
Created attachment 249531 [details]
lspci -vvnn
Comment 5 Chris Murphy 2017-01-01 19:56:38 UTC
Problem happens with Fedora kernels as well as mainline.
kernel-4.9.0-1.fc26.x86_64
kernel-4.8.15-300.fc25.x86_64
Comment 6 Greg Kroah-Hartman 2017-01-02 09:21:41 UTC
On Sun, Jan 01, 2017 at 07:28:36PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=191681
> 
>             Bug ID: 191681
>            Summary: Thunderbolt 3 adapter fails to instantiate USB and
>                     device enumeration if already connected at boot time

All USB bugs should be sent to the linux-usb@vger.kernel.org mailing
list, and not entered into bugzilla.  Please bring this issue up there,
if it is still a problem in the latest kernel release.
Comment 7 Chris Murphy 2017-01-02 23:15:56 UTC
Upstream threads (cross posted):
http://www.spinics.net/lists/linux-usb/msg151275.html
http://www.spinics.net/lists/linux-pci/msg57110.html

Setting see also to downstream bug.
Comment 8 Chris Murphy 2017-01-03 15:12:21 UTC
Created attachment 249871 [details]
failure dmesg using pci=prealloc
Comment 9 Chris Murphy 2017-01-03 15:15:44 UTC
Created attachment 249881 [details]
acpidump
Comment 10 Chris Murphy 2017-02-24 22:04:11 UTC
Switching component to PCI based on comments on the USB list. For reference here:

Problem still happens with pci=realloc. Problem doesn't happen on Windows, or with GRUB.
Comment 11 Chris Murphy 2017-04-02 22:52:21 UTC
I get different kernel messages with 4.11.0.rc3, but the result is the same.

[    0.560375] localhost kernel: pci_bus 0000:37: busn_res: can not insert [bus 37] under [bus 02-06] (conflicts with (null) [bus 02-06])
[    0.560396] localhost kernel: pci 0000:37:00.0: [8086:15b6] type 00 class 0x0c0330
[    0.560421] localhost kernel: pci 0000:37:00.0: reg 0x10: [mem 0xb0000000-0xb000ffff]
[    0.560604] localhost kernel: pci 0000:37:00.0: supports D1 D2
[    0.560605] localhost kernel: pci 0000:37:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.560799] localhost kernel: pci 0000:02:02.0: PCI bridge to [bus 37]
[    0.560812] localhost kernel: pci 0000:02:02.0:   bridge window [mem 0xc7f00000-0xc7ffffff]
[    0.560820] localhost kernel: pci_bus 0000:37: [bus 37] partially hidden behind bridge 0000:02 [bus 02-06]
[    0.560871] localhost kernel: pci_bus 0000:38: busn_res: can not insert [bus 38-6b] under [bus 02-06] (conflicts with (null) [bus 02-06])
[    0.560874] localhost kernel: pci 0000:02:04.0: PCI bridge to [bus 38-6b]
[    0.560887] localhost kernel: pci 0000:02:04.0:   bridge window [mem 0xc8000000-0xddffffff]
[    0.560894] localhost kernel: pci 0000:02:04.0:   bridge window [mem 0x70000000-0x99ffffff 64bit pref]
[    0.560896] localhost kernel: pci_bus 0000:38: [bus 38-6b] partially hidden behind bridge 0000:02 [bus 02-06]
Comment 12 Chris Murphy 2017-04-02 22:53:11 UTC
Created attachment 255725 [details]
rdsosreport 4.11.0.rc3
Comment 13 Chris Murphy 2018-04-02 19:21:51 UTC
The problem doesn't happen in 4.16-rc4 although I'm not sure when it was fixed.

Note You need to log in before you can comment on or make changes to this bug.