Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612704 - Kernel changes after 4.8.x (beginning with 4.9) are causing problems with USB 3 xHCI
Summary: Kernel changes after 4.8.x (beginning with 4.9) are causing problems with USB...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-15 11:26 UTC by Stefan Kalis
Modified: 2020-01-31 23:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
complete dmesg protocol of a failed start (FailedStart.dmesg.txt.gz,18.39 KB, application/gzip)
2017-03-27 09:06 UTC, Stefan Kalis
Details
dmesg 4.14.14 recovery mode (kernel.4.14.14.recovery.txt,71.18 KB, text/plain)
2018-01-19 14:27 UTC, Stefan Kalis
Details
dmesg of a 4.15.2 kernel start (a kernel including the mentioned patch) (kernel.4.15.2.dmesg.txt,71.67 KB, text/plain)
2018-02-13 11:41 UTC, Stefan Kalis
Details
dmesg of a kernel start with active debug options (dmesg.debug.kernel.4.16.2.txt.gz,36.83 KB, application/gzip)
2018-04-18 09:57 UTC, Stefan Kalis
Details
My /sys/firmware/acpi/tables/DSDT (DSDT.zip,22.54 KB, application/zip)
2019-01-26 11:50 UTC, Stefan Kalis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Kalis 2017-03-15 11:26:02 UTC
Kernel changes introduced in kernel 4.9 cause problems with some USB 3 PCI cards.

Starting external USB 3 harddisks fails during kernel boot:

dmesg:
[ 6.016742] usb-storage 2-1.8:1.0: USB Mass Storage device detected 
[ 6.016811] scsi host11: usb-storage 2-1.8:1.0 
[ 6.016901] usbcore: registered new interface driver usb-storage 
[ 6.088977] xhci_hcd 0000:08:00.0: xHCI Host Controller 
[ 6.089095] xhci_hcd 0000:08:00.0: new USB bus registered, assigned bus number 3 
[ 6.189662] hrtimer: interrupt took 30168649 ns 
[ 6.350531] xhci_hcd 0000:08:00.0: Host halt failed, -19 
[ 6.350533] xhci_hcd 0000:08:00.0: can't setup: -19 
[ 6.350537] xhci_hcd 0000:08:00.0: USB bus 3 deregistered 
[ 6.370735] xhci_hcd 0000:08:00.0: init 0000:08:00.0 fail, -19

The problem did not exist prior to kernel 4.9.
Comment 1 Stefan Kalis 2017-03-15 11:27:41 UTC
Sometimes it does work:

lspci -k: 

08:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03) 
Subsystem: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller 
Kernel driver in use: xhci_hcd 
Kernel modules: xhci_pci
Comment 2 Stefan Kalis 2017-03-15 11:29:57 UTC
I've already discussed the problem here:
https://forums.gentoo.org/viewtopic-t-1059240-highlight-.html
Comment 3 Stefan Kalis 2017-03-27 09:06:06 UTC
Created attachment 468408 [details]
complete dmesg protocol of a failed start

Maybe this complete log might help in finding the root cause of the problem.
Comment 4 Stefan Kalis 2017-04-20 09:20:52 UTC
After a failed start:

lspci -vvv:

08:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev ff) (prog-if ff) 
!!! Unknown header type 7f 
Kernel modules: xhci_pci

This is new information. What does unknown header type mean?
Comment 5 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-04-21 00:27:56 UTC
could you test on 4.10.11 and see if the problem persist?
Comment 6 Stefan Kalis 2017-04-23 10:05:42 UTC
Unfortunately I can confirm that the problem persists with 4.10.11.
Comment 7 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-04-24 18:32:19 UTC
unfortunatly i don't have a renesas usb device

could you please git bisect the kernel https://wiki.gentoo.org/wiki/Kernel_git-bisect

would be nice to find which patch is fault
Comment 8 Stefan Kalis 2017-05-25 10:39:59 UTC
Patching activity has extended the problem to older kernels. I just encountered the problem with kernel 4.4.52.
Comment 9 Stefan Kalis 2017-05-25 18:21:28 UTC
The problem does not show up with kernel 4.1.39-r1.
Comment 10 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-06-16 16:52:25 UTC
(In reply to Stefan Kalis from comment #9)
> The problem does not show up with kernel 4.1.39-r1.

thanks but this is not bisecting the kernel.

4.1.39-r1 and 4.4.52 are too much different for having something useful.
Comment 11 Stefan Kalis 2017-06-17 10:20:48 UTC
I should have been informed about that technique earlier.
It started sometime during the early phase of Kernel 4.9.
That's about what I can contribute at this time.
Comment 12 Stefan Kalis 2017-12-31 11:30:38 UTC
With kernel 4.14 it's a total hang now. The boot process stops after loading the xhci_hcd part.
Comment 14 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-12-31 13:46:47 UTC
would also be nice to have the dmesg of 4.14
Comment 15 Stefan Kalis 2018-01-19 14:27:31 UTC
Created attachment 515314 [details]
dmesg 4.14.14 recovery mode
Comment 16 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2018-01-21 00:16:41 UTC
please send it to linux-usb@vger.kernel.org mailing list, if not already done.
Comment 17 Stefan Kalis 2018-02-13 11:41:23 UTC
Created attachment 519302 [details]
dmesg of a 4.15.2 kernel start (a kernel including the mentioned patch)
Comment 18 Stefan Kalis 2018-02-13 11:44:07 UTC
The problem shows up around second 6 of the kernel start.
Comment 19 Stefan Kalis 2018-04-18 09:57:52 UTC
Created attachment 527918 [details]
dmesg of a kernel start with active debug options
Comment 20 Stefan Kalis 2018-04-18 10:01:43 UTC
I've added a dmesg protocol with activated debug options - so there is a lot of textual information now.
Comment 21 Stefan Kalis 2018-04-18 11:52:45 UTC
Please inform me if you would like to have additional debug modules activated in the kernel (like for example PCI stuff).
Comment 22 Thomas Deutschmann (RETIRED) gentoo-dev 2018-04-18 12:10:28 UTC
>= 4.14 is known for USB 3 problems, wondering that you mention it already started with 4.9.

Please submit your information to linux-usb@vger.kernel.org like Alice said.

Sounds like you can reproduce the problem (i.e. boot, wait 6 seconds -> problem)... please try latest gentoo-sources to make sure the problem still exists in latest kernel. Next step, to speed up things, would be a bisect...
Comment 23 Stefan Kalis 2019-01-26 11:46:55 UTC
The reason for the problem seems to be wrong power management:

If I remove the xhci_pci-module with modprobe -r and re-insert it with modprobe I get the following result:

dmesg:
[ 597.890743] xhci_hcd 0000:08:00.0: Refused to change power state, currently in D3
[ 597.941147] xhci_hcd 0000:08:00.0: xHCI Host Controller
[ 597.941291] xhci_hcd 0000:08:00.0: new USB bus registered, assigned bus number 3
[ 598.092185] xhci_hcd 0000:08:00.0: Host halt failed, -19
[ 598.092188] xhci_hcd 0000:08:00.0: can't setup: -19
[ 598.092192] xhci_hcd 0000:08:00.0: USB bus 3 deregistered
[ 598.112539] xhci_hcd 0000:08:00.0: init 0000:08:00.0 fail, -19

08:00.0 is the Renesas PCI-USB3-card.
Comment 24 Stefan Kalis 2019-01-26 11:50:06 UTC
Created attachment 562860 [details]
My /sys/firmware/acpi/tables/DSDT
Comment 25 Stefan Kalis 2019-01-26 17:51:14 UTC
The problem might be related to the one mentioned here:
https://github.com/Bumblebee-Project/bbswitch/issues/140
Comment 26 Stefan Kalis 2019-01-31 14:22:08 UTC
The problem persists with Kernel 5.0 rc4.
Comment 27 Stefan Kalis 2019-01-31 14:36:25 UTC
I think this here might be related, because it appeared 3 months before problems started on my side:

Kernel driver code by Christian Lamparter for PD720201 devices without firmware:
https://lkml.org/lkml/2016/6/23/632
Comment 28 Stefan Kalis 2019-01-31 14:46:32 UTC
My PD720201 loads firmware from an external ROM under normal circumstances. I've updated the firmware to Version 2.0.2.6 but it didn't solve the problem.
Comment 29 Stefan Kalis 2019-01-31 15:19:43 UTC
Is it possible that my card gets detected twice as first one with ROM and second one w/o ROM?
Comment 30 Mike Pagano gentoo-dev 2019-07-17 11:58:28 UTC
Is this still an issue?