REGRESSION after upgrade from 14.10 to 15.04: USB3 boot device lost during system boot: "xhci_hcd 0000:04:00.0: Error while assigning device slot ID" / "device not accepting address 2, error -22"

Bug #1455376 reported by Robert Schlabbach
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Booting Ubuntu 15.04 amd64 kernel "Linux version 3.19.0-16-generic (buildd@komainu) (gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) ) #16-Ubuntu SMP Thu Apr 30 16:09:58 UTC 2015" on a Samsung RF711-S08 laptop (Sandy Bridge) from a USB3 stick connected to the USB3 port on the righthand side, the boot stalls at the Ubuntu splash screen (with the dots), with the USB3 stick LED showing no activity, eventually dropping to the initramfs console. If I unplug and replug the USB3 stick during the stall period, the LED shows activity and the boot proceeds.

The same USB3 stick boots on another laptop without any problems.

Excerpts from dmesg:

Recognition of the USB3 port:

[ 1.643737] xhci_hcd 0000:04:00.0: xHCI Host Controller
[ 1.643741] xhci_hcd 0000:04:00.0: new USB bus registered, assigned bus number 2
[ 1.646775] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[ 1.646777] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.646778] usb usb2: Product: xHCI Host Controller
[ 1.646780] usb usb2: Manufacturer: Linux 3.19.0-16-generic xhci-hcd
[ 1.646781] usb usb2: SerialNumber: 0000:04:00.0
[ 1.646886] hub 2-0:1.0: USB hub found
[ 1.646895] hub 2-0:1.0: 2 ports detected

Failure to initialize the USB3 device:

[ 1.847589] xhci_hcd 0000:04:00.0: Error while assigning device slot ID
[ 1.847597] xhci_hcd 0000:04:00.0: Max number of devices this xHCI host supports is 32.
[ 1.847600] usb usb2-port1: couldn't allocate usb_device

Replugged the USB3 device during the boot stall:

[ 13.861689] usb 2-1: new SuperSpeed USB device number 2 using xhci_hcd
[ 13.881832] usb 2-1: New USB device found, idVendor=0951, idProduct=162b
[ 13.881844] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 13.881850] usb 2-1: Product: DT HyperX 3.0
[ 13.881855] usb 2-1: Manufacturer: Kingston
[ 13.881860] usb 2-1: SerialNumber: *********************
[ 13.885561] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 13.885829] scsi host6: usb-storage 2-1:1.0
[ 13.885901] usbcore: registered new interface driver usb-storage
[ 13.887130] usbcore: registered new interface driver uas

I assume the bug is at 1.847589.
---
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: robert 1480 F.... pulseaudio
CurrentDesktop: Unity
DistroRelease: Ubuntu 15.04
InstallationDate: Installed on 2012-12-07 (889 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427)
MachineType: SAMSUNG ELECTRONICS CO., LTD. RF511/RF411/RF711
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-16-generic root=UUID=51713370-20d5-4b75-ae59-7f6bda369278 ro quiet splash
ProcVersionSignature: Ubuntu 3.19.0-16.16-generic 3.19.3
RelatedPackageVersions:
 linux-restricted-modules-3.19.0-16-generic N/A
 linux-backports-modules-3.19.0-16-generic N/A
 linux-firmware 1.143
Tags: vivid
Uname: Linux 3.19.0-16-generic x86_64
UpgradeStatus: Upgraded to vivid on 2015-04-23 (22 days ago)
UserGroups: adm admin cdrom dialout lpadmin mythtv plugdev sambashare
_MarkForUpload: True
dmi.bios.date: 11/27/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 17HX.M045.20121127.SSH
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: RF511/RF411/RF711
dmi.board.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.board.version: 17HX
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 9
dmi.chassis.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr17HX.M045.20121127.SSH:bd11/27/2012:svnSAMSUNGELECTRONICSCO.,LTD.:pnRF511/RF411/RF711:pvr17HX:rvnSAMSUNGELECTRONICSCO.,LTD.:rnRF511/RF411/RF711:rvr17HX:cvnSAMSUNGELECTRONICSCO.,LTD.:ct9:cvrN/A:
dmi.product.name: RF511/RF411/RF711
dmi.product.version: 17HX
dmi.sys.vendor: SAMSUNG ELECTRONICS CO., LTD.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1455376/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → linux (Ubuntu)
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.1 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc3-vivid/

Changed in linux (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

Forgot to mention: Ubuntu 14.10 (linux kernel 3.16) booted without this problem off the same USB3 stick on the same USB3 port on the same laptop. So this is a regression that was introduced in Ubuntu 15.04 (linux kernel 3.19).

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1455376

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Robert Schlabbach (robert-s-t) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected vivid
description: updated
Revision history for this message
Robert Schlabbach (robert-s-t) wrote : CRDA.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : IwConfig.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : JournalErrors.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : Lspci.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : Lsusb.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : ProcEnviron.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : ProcModules.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : PulseList.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : RfKill.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : UdevDb.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : UdevLog.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : WifiSyslog.txt

apport information

Revision history for this message
Robert Schlabbach (robert-s-t) wrote : Re: USB3 boot device lost during system boot: "xhci_hcd 0000:04:00.0: Error while assigning device slot ID"

Trying various kernels from http://kernel.ubuntu.com/~kernel-ppa/mainline, I can pinpoint that this bug was introduced with linux kernel 3.18.

These kernels did NOT exhibit the bug:

linux-image-3.16.7-031607-generic_3.16.7-031607.201410301735_amd64.deb
linux-image-3.17.2-031702-generic_3.17.2-031702.201410301416_amd64.deb
linux-image-3.17.8-031708-generic_3.17.8-031708.201501081837_amd64.deb

All of these kernels DO have the bug:

linux-image-3.18.0-031800-generic_3.18.0-031800.201412071935_amd64.deb
linux-image-3.18.0-031800rc1-generic_3.18.0-031800rc1.201410192135_amd64.deb
linux-image-3.18.0-031800rc2-generic_3.18.0-031800rc2.201410281737_amd64.deb
linux-image-4.1.0-040100rc2-generic_4.1.0-040100rc2.201505032335_amd64.deb
linux-image-4.1.0-040100rc3-generic_4.1.0-040100rc3.201505102036_amd64.deb

For some reason, I'm not getting the original error message in dmesg anymore, though. The error message popping up every time in all the bugged kernels is now:

[ 2.614392] usb 2-1: device not accepting address 2, error -22

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

Seems others have been seeing similar regressions between kernels 3.17 and 3.18:

http://lkml.iu.edu/hypermail/linux/kernel/1501.2/01802.html

Is it possible that Ubuntu did not pick up that fix...?

Revision history for this message
Robert Schlabbach (robert-s-t) wrote :
summary: - USB3 boot device lost during system boot: "xhci_hcd 0000:04:00.0: Error
- while assigning device slot ID"
+ REGRESSION after upgrade from 14.10 to 15.04: USB3 boot device lost
+ during system boot: "xhci_hcd 0000:04:00.0: Error while assigning device
+ slot ID"
summary: REGRESSION after upgrade from 14.10 to 15.04: USB3 boot device lost
during system boot: "xhci_hcd 0000:04:00.0: Error while assigning device
- slot ID"
+ slot ID" / "device not accepting address 2, error -22"
Revision history for this message
penalvch (penalvch) wrote :

Robert Schlabbach, could you please provide the full computer model as noted on the sticker of the computer itself (not from the Bug Description)?

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

Here's what it says on the sticker:

SAMSUNG
NOTEBOOK
MODEL: NP-RF711
MODEL CODE: NP-RF711-S08DE

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Robert Schlabbach, the next step is to fully commit bisect from kernel 3.17.8 to 3.18 in order to identify the last good kernel commit, followed immediately by the first bad one. This will allow for a more expedited analysis of the root cause of your issue. Could you please do this following https://wiki.ubuntu.com/Kernel/KernelBisection ?

Please note, finding adjacent kernel versions is not fully commit bisecting.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

tags: added: kernel-bug-exists-upstream-4.1-rc3 needs-bisect regression-release
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

I took a different route and tried to find out what is going wrong with the current code. I loaded the linux-source package and built kernel 3.19.3 versions with added debug messages in drivers/usb/core/hub.c to see that is happening. I found the following chain of calls:

1. hub_port_reset()
2. > hub_port_wait_reset()
3. > > hub_port_status() returns port status 0x02C0 (USB_SS_PORT_LS_SS_INACTIVE)
4. > > hub_port_warm_reset_required() returns TRUE due to link_state == USB_SS_PORT_LS_SS_INACTIVE
5. > hub_port_wait_reset() returns -ENOTCONN due to the TRUE result from hub_port_warm_reset_required()
6. > hub_port_finish_reset(... *status = -ENOTCONN)
7. > > usb_set_device_state(udev, USB_STATE_NOTATTACHED)

And that's the problem: USB device state NOTATTACHED is a dead end as usb_set_device_state() does not seem to allow ever leaving that state:

 if (udev->state == USB_STATE_NOTATTACHED) {
  ; /* do nothing */
 }

That seems bogus to me. A "warm reset" sounds like it is supposed to be recoverable, but a port which ever runs into this state cannot recover since the NOTATTACHED software state is a deathtrap.

I tried altering the end of hub_port_finish_reset() to:

  if (udev)
   usb_set_device_state(udev, *status
     ? USB_STATE_ATTACHED // FIX: was USB_STATE_NOTATTACHED
     : USB_STATE_DEFAULT);

and that fixes the problem. The port is warm reset, the USB device is set to a working state and the boot continues without problems.

However:

1. I'm not sure if this is the right place to fix the problem. Maybe there are scenarios in which the "dead end" is needed. Then it would be a better solution to change the status in a place where it is known that a warm reset will be tried...

2. I cannot find any substantial difference in drivers/usb/core/hub.c between kernel sources 3.17.8 and 3.18-rc1 which would explain why this problem occurs so frequently with the latter, but not with the former. So this may not be the root cause of my problem, but at least it's a way to fix it, and from what I can tell, this is erroneous behavior which requires fixing anyway.

Now, how to get this issue up with the experts on this code to discuss if my findings are right and how to best fix it...?

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
penalvch (penalvch)
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

An enhanced version of the fix I outlined above has now been accepted for inclusion in Linux kernel 4.2:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/core/hub.c?id=fb6d1f7df5d25299fd7b3e84b72b8851d3634764

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Robert Schlabbach, did you test the patch to confirm it fixes the problem?

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

Well, I developed the patch to fix my problem, so it would be rather strange if it didn't ;-)

In short: Yes.

penalvch (penalvch)
tags: added: cherry-pick kernel-fixed-upstream
removed: kernel-bug-exists-upstream needs-bisect
Changed in linux (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Robert Schlabbach (robert-s-t) wrote :

My patch to fix this issue was pulled into Ubuntu 15.04 with the kernel update 3.19.0-26.27:

https://launchpad.net/ubuntu/+source/linux/3.19.0-26.27

usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset

I can confirm that the updated kernel fixes the problem on my machine.

Changed in linux (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.