Bug 156725 - USB stack stall cause complete system input loss
Summary: USB stack stall cause complete system input loss
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 21:20 UTC by Arnaud
Modified: 2015-12-25 05:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud 2011-04-29 21:20:08 UTC
The problem happened twice in the following condition:
 - high frequency attach/detach of a USB adapter
 - failure to detach snd_uaudio(4)

Symptoms is a complete loss of the USB stack. Already plugged devices
continue to work, but trying to attach new devices fails

Dmesg:

real memory  = 4294967296 (4096 MB)
avail memory = 4088045568 (3898 MB)
ACPI APIC Table: <DELL   PE_SC3  >
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  2
 cpu2 (AP): APIC ID:  4
 cpu3 (AP): APIC ID:  6
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <DELL PE_SC3> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
unknown: I/O range not supported
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 3.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0xfc00-0xfcff mem 0xc0000000-0xcfffffff,0xdf9e0000-0xdf9effff irq 16 at device 0.0 on pci1
vgapci1: <VGA-compatible display> mem 0xdf9f0000-0xdf9fffff at device 0.1 on pci1
pcib2: <ACPI PCI-PCI bridge> at device 5.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pci0: <base peripheral> at device 8.0 (no driver attached)
pci0: <base peripheral> at device 8.1 (no driver attached)
pci0: <base peripheral> at device 8.2 (no driver attached)
pci0: <base peripheral> at device 8.3 (no driver attached)
pci0: <base peripheral> at device 16.0 (no driver attached)
pci0: <base peripheral> at device 16.1 (no driver attached)
ehci0: <Intel PCH USB 2.0 controller USB-B> mem 0xdf8fa000-0xdf8fa3ff irq 22 at device 26.0 on pci0
ehci0: [ITHREAD]
usbus0: EHCI version 1.0
usbus0: <Intel PCH USB 2.0 controller USB-B> on ehci0
pcib3: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 28.4 on pci0
pci4: <ACPI PCI bus> on pcib4
bge0: <Broadcom NetXtreme Gigabit Ethernet Controller, ASIC rev. 0x00a200> mem 0xdfaf0000-0xdfafffff irq 16 at device 0.0 on pci4
bge0: CHIP ID 0x0000a200; ASIC REV 0x0a; CHIP REV 0xa2; PCI-E
miibus0: <MII bus> on bge0
brgphy0: <BCM5722 10/100/1000baseTX PHY> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge0: Ethernet address: 00:26:b9:7b:36:90
bge0: [FILTER]
pcib5: <ACPI PCI-PCI bridge> at device 28.5 on pci0
pci5: <ACPI PCI bus> on pcib5
ehci1: <Intel PCH USB 2.0 controller USB-A> mem 0xdf8fc000-0xdf8fc3ff irq 22 at device 29.0 on pci0
ehci1: [ITHREAD]
usbus1: EHCI version 1.0
usbus1: <Intel PCH USB 2.0 controller USB-A> on ehci1
pcib6: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci6: <ACPI PCI bus> on pcib6
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel 5 Series/3400 Series PCH SATA300 controller> port 0xecd0-0xecd7,0xecc8-0xeccb,0xecd8-0xecdf,0xeccc-0xeccf,0xece0-0xecff mem 0xdf8fe000-0xdf8fe7ff irq 20 at device 31.2 on pci0
atapci0: [ITHREAD]
atapci0: AHCI called from vendor specific driver
atapci0: AHCI v1.30 controller with 6 3Gbps ports, PM supported
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: [ITHREAD]
ata5: <ATA channel 3> on atapci0
ata5: [ITHREAD]
ata6: <ATA channel 4> on atapci0
ata6: [ITHREAD]
ata7: <ATA channel 5> on atapci0
ata7: [ITHREAD]
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 900
atrtc0: <AT realtime clock> port 0x70-0x7f irq 8 on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
orm0: <ISA Option ROMs> at iomem 0xc0000-0xcefff,0xcf000-0xcffff,0xec000-0xeffff on isa0
atkbd: unable to set the command byte.
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: unable to set the command byte.
est0: <Enhanced SpeedStep Frequency Control> on cpu0
est: CPU supports Enhanced Speedstep, but is not recognized.
est: cpu_vendor GenuineIntel, msr 13
device_attach: est0 attach returned 6
p4tcc0: <CPU Frequency Thermal Control> on cpu0
est1: <Enhanced SpeedStep Frequency Control> on cpu1
est: CPU supports Enhanced Speedstep, but is not recognized.
est: cpu_vendor GenuineIntel, msr 13
device_attach: est1 attach returned 6
p4tcc1: <CPU Frequency Thermal Control> on cpu1
est2: <Enhanced SpeedStep Frequency Control> on cpu2
est: CPU supports Enhanced Speedstep, but is not recognized.
est: cpu_vendor GenuineIntel, msr 13
device_attach: est2 attach returned 6
p4tcc2: <CPU Frequency Thermal Control> on cpu2
est3: <Enhanced SpeedStep Frequency Control> on cpu3
est: CPU supports Enhanced Speedstep, but is not recognized.
est: cpu_vendor GenuineIntel, msr 13
device_attach: est3 attach returned 6
p4tcc3: <CPU Frequency Thermal Control> on cpu3
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
ad4: 238418MB <WDC WD2502ABYS-18B7A0 02.03B04> at ata2-master UDMA100 SATA 3Gb/s
ugen0.1: <Intel> at usbus0
uhub0: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen1.1: <Intel> at usbus1
uhub1: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ad6: 152627MB <WDC WD1600AAJS-00L7A0 01.03E01> at ata3-master UDMA100 SATA 3Gb/s
acd0: DVDROM <HL-DT-ST DVD-ROM DH20N/A102> at ata6-master UDMA100 SATA 1.5Gb/s
SMP: AP CPU #2 Launched!
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
Root mount waiting for: usbus1 usbus0
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
ugen0.2: <vendor 0x8087> at usbus0ugen1.2: <vendor 0x8087> at usbus1

uhub2: <vendor 0x8087 product 0x0020, class 9/0, rev 2.00/0.00, addr 2> on usbus0
uhub3: <vendor 0x8087 product 0x0020, class 9/0, rev 2.00/0.00, addr 2> on usbus1
Root mount waiting for: usbus1 usbus0
uhub2: 6 ports with 6 removable, self powered
uhub3: 8 ports with 8 removable, self powered
ugen1.3: <vendor 0x1a40> at usbus1
uhub4: <vendor 0x1a40 USB 2.0 Hub [MTT], class 9/0, rev 2.00/1.00, addr 3> on usbus1
Root mount waiting for: usbus1
uhub4: 7 ports with 7 removable, self powered
Root mount waiting for: usbus1
ugen1.4: <Prolific Technology Inc.> at usbus1
uplcom0: <Prolific Technology Inc. USB-Serial Controller, class 0/0, rev 1.10/3.00, addr 4> on usbus1
Root mount waiting for: usbus1
ugen1.5: <Prolific Technology Inc.> at usbus1
uplcom1: <Prolific Technology Inc. USB-Serial Controller, class 0/0, rev 1.10/3.00, addr 5> on usbus1
ugen1.6: <Dell> at usbus1
ums0: <Dell Dell USB Optical Mouse, class 0/0, rev 2.00/43.01, addr 6> on usbus1
ums0: 3 buttons and [XYZ] coordinates ID=0
Root mount waiting for: usbus1
ugen1.7: <vendor 0x099a> at usbus1
ukbd0: <vendor 0x099a USB Multimedia Keyboard, class 0/0, rev 1.10/0.01, addr 7> on usbus1
kbd2 at ukbd0
ums1: <vendor 0x099a USB Multimedia Keyboard, class 0/0, rev 1.10/0.01, addr 7> on usbus1
ugen1.8: <Logitech> at usbus1
Root mount waiting for: usbus1
uhid0: <Logitech Logitech USB Headset, class 0/0, rev 1.10/10.13, addr 8> on usbus1
Trying to mount root from ufs:/dev/ad4s1a
bge0: link state changed to UP
drm0: <ATI Radeon X1300/X1550> on vgapci0

Fix: 

ACPI-shutdown the machine. ie. the USB stack recovers during the shutdown
process; plugged devices are attached, but at this point, it becomes too
late to stop the shutdown process.
How-To-Repeat: happens randomly from a user point of view.
Comment 1 Arnaud 2011-04-29 21:48:52 UTC
this bug is tightly related to amd64/156726. Considering the following scenario:

 1) plug a snd_uaudio(4)-based device
 2) open aumix(1) on, pcmN, the mixer device attached to the
previously attached device
 3) unplug the snd_uaudio(4)-based device
 [the USB stack busy wait pcmN detach]
 4) close aumix(1)
 [pcmN finally detach]

If there is no USB activity (ie, no attach/detach, but "normal" hid
activity), the USB stack recovers. If another USB device is
attached/detached while the stack busy wait on pcmN detachment
(between step 3 and step 4), events ends up being queued. Once step 4
is done, events gets processed, however, once completed the USB stall,
ie. no more mouse or keyboard.

At this point, I do not see any USB related message while the system halts.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2011-05-02 01:25:49 UTC
Responsible Changed
From-To: freebsd-amd64->freebsd-usb

reclassify.
Comment 3 Hans Petter Selasky 2011-05-02 07:28:48 UTC
On Monday 02 May 2011 02:26:29 linimon@freebsd.org wrote:
> Synopsis: USB stack stall cause complete system input loss
> 
> Responsible-Changed-From-To: freebsd-amd64->freebsd-usb
> Responsible-Changed-By: linimon
> Responsible-Changed-When: Mon May 2 00:25:49 UTC 2011
> Responsible-Changed-Why:
> reclassify.
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=156725

Hi,

All attach and detach methods are run from a single thread, the root HUB 
thread. If any device driver is blocking the detach routine for some reason, 
other devices on the same USB controller will be prevented from enumerating 
aswell.

--HPS