Skip to contentSkip to conversation

pm_op(): usb_dev_suspend+0x0/0x10 returns -2 on USB device 8087:0020

DISCUSSION Ákos Maróy 5 participants 22 messages Feb 23, 2010 – Mar 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I wonder if this is the write place to post this issue to, but I have a proplem when trying go suspend or hibernate my system. after enabling pm_trace by:

echo 1 > /sys/power/pm_trace

and then issuing pm-suspend, I get the following in dmesg:

[  685.833275] PM: Entering mem sleep
[  685.833292] Suspending console(s) (use no_console_suspend to debug)
[  685.993399] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
[  685.993404] PM: Device usb2 failed to suspend: error -2
[  685.993408] PM: Some devices failed to suspend
[  685.997009] PM: resume devices took 0.000 seconds
[  685.997169] PM: Finishing wakeup.

this is on 2.6.32.8, but on 2.6.33-rc8 I get the same results.

trying to find out what device this is:

$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp.
Bus 001 Device 004: ID 04f2:b16c Chicony Electronics Co., Ltd
Bus 001 Device 005: ID 03f0:231d Hewlett-Packard
Bus 001 Device 002: ID 8087:0020
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

my persumption is that "Device usb2" would be device 002 on bus 001 above, that is, 8087:0020. googling for this USB id I found some references here: http://forum.notebookreview.com/showthread.php?p=5906076 :

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

I wonder what could be done to make this device not sabotage the suspend process?

Akos

#1 lore raw
Quoted 34 lines · Ákos Maróy

Hi,

I wonder if this is the write place to post this issue to, but I have a proplem when trying go suspend or hibernate my system. after enabling pm_trace by:

echo 1 > /sys/power/pm_trace

and then issuing pm-suspend, I get the following in dmesg:

[  685.833275] PM: Entering mem sleep
[  685.833292] Suspending console(s) (use no_console_suspend to debug)
[  685.993399] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
[  685.993404] PM: Device usb2 failed to suspend: error -2
[  685.993408] PM: Some devices failed to suspend
[  685.997009] PM: resume devices took 0.000 seconds
[  685.997169] PM: Finishing wakeup.

this is on 2.6.32.8, but on 2.6.33-rc8 I get the same results.

trying to find out what device this is:

$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp.
Bus 001 Device 004: ID 04f2:b16c Chicony Electronics Co., Ltd
Bus 001 Device 005: ID 03f0:231d Hewlett-Packard
Bus 001 Device 002: ID 8087:0020
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

my persumption is that "Device usb2" would be device 002 on bus 001 above, that is, 8087:0020. googling for this USB id I found some references here: http://forum.notebookreview.com/showthread.php?p=5906076 :

Quoted 5 lines

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

I wonder what could be done to make this device not sabotage the suspend process?

That's a good question for the USB people (CCed).

Rafael

#2 lore raw
Quoted 31 lines · Rafael J. Wysocki
Quoted 30 lines · Ákos Maróy

Hi,

I wonder if this is the write place to post this issue to, but I have a proplem when trying go suspend or hibernate my system. after enabling pm_trace by:

echo 1 > /sys/power/pm_trace

and then issuing pm-suspend, I get the following in dmesg:

[  685.833275] PM: Entering mem sleep
[  685.833292] Suspending console(s) (use no_console_suspend to debug)
[  685.993399] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
[  685.993404] PM: Device usb2 failed to suspend: error -2
[  685.993408] PM: Some devices failed to suspend
[  685.997009] PM: resume devices took 0.000 seconds
[  685.997169] PM: Finishing wakeup.

this is on 2.6.32.8, but on 2.6.33-rc8 I get the same results.

trying to find out what device this is:

$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp.
Bus 001 Device 004: ID 04f2:b16c Chicony Electronics Co., Ltd
Bus 001 Device 005: ID 03f0:231d Hewlett-Packard
Bus 001 Device 002: ID 8087:0020
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Quoted 2 lines
Quoted 2 lines

my persumption is that "Device usb2" would be device 002 on bus 001 above, that is, 8087:0020.

It isn't. usb2 is the root hub device on bus 2, i.e., it is device 001 on bus 002.

Quoted 8 lines
Quoted 8 lines

googling for this USB id I found some
references here: http://forum.notebookreview.com/showthread.php?p=5906076 :

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

I wonder what could be done to make this device not sabotage the suspend process?

You can get more information if you enable CONFIG_USB_DEBUG in your kernel configuration. The most likely explanation is that the suspend failed because one of the ports on that root hub issued a wakeup request.

Alan Stern

#3 lore raw

Alan,

Quoted 4 lines

You can get more information if you enable CONFIG_USB_DEBUG in your kernel configuration. The most likely explanation is that the suspend failed because one of the ports on that root hub issued a wakeup request.

I tried, and this is what I seem to be getting now:

Feb 24 23:28:52 tonkachi kernel: [  348.733460] PM: Syncing filesystems ...
Feb 24 23:28:52 tonkachi kernel: [  348.903106] done.
Feb 24 23:28:52 tonkachi kernel: [  348.903123] Freezing user space
processes ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903808] Freezing remaining
freezable tasks ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903952] Suspending console(s)
(use no_console_suspend to debug)
Feb 24 23:28:52 tonkachi kernel: [  348.985903] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 24 23:28:52 tonkachi kernel: [  348.987274] PM: resume devices took
0.060 seconds
Feb 24 23:28:52 tonkachi kernel: [  348.987371] Restarting tasks ...
Feb 24 23:28:52 tonkachi kernel: [  348.988165] done.

though I don't see the pm_op() error log anymore..

would this make sense?

actually, the whole USB susbsystem seems to be very fragile - I plug in a USB device, and the whole system freezes for about 5 seconds or more. then the device is registered (for example, a mouse). but I unplug and re-plug, and the device doesn't work anymore...

or I plug in an external USB DVD drive - but if I unplug it, it is still listed in lsusb..

Akos

#4 lore raw
Quoted 26 lines · Ákos Maróy

Alan,

Quoted 4 lines

You can get more information if you enable CONFIG_USB_DEBUG in your kernel configuration. The most likely explanation is that the suspend failed because one of the ports on that root hub issued a wakeup request.

I tried, and this is what I seem to be getting now:

Feb 24 23:28:52 tonkachi kernel: [  348.733460] PM: Syncing filesystems ...
Feb 24 23:28:52 tonkachi kernel: [  348.903106] done.
Feb 24 23:28:52 tonkachi kernel: [  348.903123] Freezing user space
processes ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903808] Freezing remaining
freezable tasks ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903952] Suspending console(s)
(use no_console_suspend to debug)
Feb 24 23:28:52 tonkachi kernel: [  348.985903] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 24 23:28:52 tonkachi kernel: [  348.987274] PM: resume devices took
0.060 seconds
Feb 24 23:28:52 tonkachi kernel: [  348.987371] Restarting tasks ...
Feb 24 23:28:52 tonkachi kernel: [  348.988165] done.
Quoted 3 lines

though I don't see the pm_op() error log anymore..

would this make sense?

You should not be looking at the system log file; you should use the output from dmesg.

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

Quoted 7 lines

actually, the whole USB susbsystem seems to be very fragile - I plug in a USB device, and the whole system freezes for about 5 seconds or more. then the device is registered (for example, a mouse). but I unplug and re-plug, and the device doesn't work anymore...

or I plug in an external USB DVD drive - but if I unplug it, it is still listed in lsusb..

These separate issues deserve to be investigated more closely. The USB stack is not supposed to be that fragile. Describe your environment more fully and provide the dmesg log from a kernel with CONFIG_USB_DEBUG enabled showing what happens during the experiments.

Alan Stern

#5 lore raw

Alan,

Quoted 2 lines

You should not be looking at the system log file; you should use the output from dmesg.

indeed. I'm sorry about that.

looking at dmesg, its a long line of output. points of interest look like the following:

[   12.216797] hub 2-0:1.0: hub_suspend
[   12.216811] usb usb2: bus auto-suspend
[   12.216816] usb usb2: bus suspend fail, err -2
[   12.216820] hub 2-0:1.0: hub_resume
[   12.216864] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[   15.214004] hub 2-0:1.0: hub_suspend
[   15.214015] usb usb2: bus auto-suspend
[   15.214020] usb usb2: bus suspend fail, err -2
[   15.214024] hub 2-0:1.0: hub_resume
[   15.214055] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[   18.211195] hub 2-0:1.0: hub_suspend
[   18.211206] usb usb2: bus auto-suspend
[   18.211211] usb usb2: bus suspend fail, err -2
[   18.211215] hub 2-0:1.0: hub_resume
[   18.211254] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[   21.208379] hub 2-0:1.0: hub_suspend
[   21.208389] usb usb2: bus auto-suspend
[   21.208394] usb usb2: bus suspend fail, err -2
[   21.208398] hub 2-0:1.0: hub_resume
[   21.208432] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[   24.205564] hub 2-0:1.0: hub_suspend
[   24.205578] usb usb2: bus auto-suspend
[   24.205583] usb usb2: bus suspend fail, err -2
[   24.205587] hub 2-0:1.0: hub_resume
[   24.205624] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000

...

[   27.202742] hub 2-0:1.0: hub_suspend
[   27.202755] usb usb2: bus auto-suspend
[   27.202760] usb usb2: bus suspend fail, err -2
[   27.202764] hub 2-0:1.0: hub_resume
[   27.202807] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[   29.851255] usb usb2: uevent
[   29.851420] usb 2-0:1.0: uevent

...

[   30.209824] usb usb2: bus auto-suspend
[   30.209828] usb usb2: bus suspend fail, err -2
[   30.209833] hub 2-0:1.0: hub_resume
[   30.209881] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000

and a lot of the same, repeated all over. and then:

[  407.210004] PM: Entering mem sleep
[  407.210022] Suspending console(s) (use no_console_suspend to debug)
[  407.368716] hub 2-0:1.0: hub_suspend
[  407.368726] usb usb2: bus suspend
[  407.368731] usb usb2: bus suspend fail, err -2
[  407.368734] hub 2-0:1.0: hub_resume
[  407.368768] pm_op(): usb_dev_suspend+0x0/0x10 returns -2
[  407.368773] PM: Device usb2 failed to suspend: error -2
[  407.368776] PM: Some devices failed to suspend
[  407.371952] PM: resume devices took 0.000 seconds
[  407.372122] PM: Finishing wakeup.
Quoted 4 lines

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

wow, rmmod xhci - and the suspend goes through fine!

what is this xhci thing anyway?

Quoted 4 lines

These separate issues deserve to be investigated more closely. The USB stack is not supposed to be that fragile. Describe your environment more fully and provide the dmesg log from a kernel with CONFIG_USB_DEBUG enabled showing what happens during the experiments.

indeed. interestingly, xhci may be the culprit, as without xhci, the external DVD doesn't even register at all.

loadind xhci, I get:

Feb 25 17:33:50 tonkachi kernel: [  168.203418] xhci_hcd 0000:02:00.0:
PCI INT A -> GSI 16 (level, low) -> IRQ 16
Feb 25 17:33:50 tonkachi kernel: [  168.203568] xhci_hcd 0000:02:00.0:
xHCI Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203689] xhci_hcd 0000:02:00.0:
new USB bus registered, assigned bus number 2
Feb 25 17:33:50 tonkachi kernel: [  168.203832] xhci_hcd 0000:02:00.0:
irq 16, io mem 0xd4000000
Feb 25 17:33:50 tonkachi kernel: [  168.203875] usb usb2: config 1
interface 0 altsetting 0 endpoint 0x81 has no SuperSpeed companion
descriptor
Feb 25 17:33:50 tonkachi kernel: [  168.203912] usb usb2: New USB device
found, idVendor=1d6b, idProduct=0002
Feb 25 17:33:50 tonkachi kernel: [  168.203919] usb usb2: New USB device
strings: Mfr=3, Product=2, SerialNumber=1
Feb 25 17:33:50 tonkachi kernel: [  168.203925] usb usb2: Product: xHCI
Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203931] usb usb2: Manufacturer:
Linux 2.6.32.8-usb-debug xhci_hcd
Feb 25 17:33:50 tonkachi kernel: [  168.203937] usb usb2: SerialNumber:
0000:02:00.0
Feb 25 17:33:50 tonkachi kernel: [  168.204089] usb usb2: configuration
#1 chosen from 1 choice
Feb 25 17:33:50 tonkachi kernel: [  168.204198] hub 2-0:1.0: USB hub found
Feb 25 17:33:50 tonkachi kernel: [  168.204213] hub 2-0:1.0: 4 ports

detected

plugging in the USB DVD drive, there's a system 'freeze' for about 5 seconds (nothing is responding, not even caps lock), then I get in syslog:

Feb 25 17:34:39 tonkachi kernel: [  217.433960] Registered led device:
iwl-phy0::radio
Feb 25 17:34:39 tonkachi kernel: [  217.433990] Registered led device:
iwl-phy0::assoc
Feb 25 17:34:39 tonkachi kernel: [  217.434020] Registered led device:
iwl-phy0::RX
Feb 25 17:34:39 tonkachi kernel: [  217.434045] Registered led device:
iwl-phy0::TX
Feb 25 17:34:39 tonkachi kernel: [  217.463366] usb 2-4: new high speed
USB device using xhci_hcd and address 0
Feb 25 17:34:39 tonkachi kernel: [  217.485828] usb 2-4: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:34:39 tonkachi kernel: [  217.485834] usb 2-4: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:34:39 tonkachi kernel: [  217.485949] usb 2-4: configuration
#1 chosen from 1 choice
Feb 25 17:34:39 tonkachi kernel: [  217.485963] usb 2-4: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 17:34:39 tonkachi kernel: [  217.487002] hub 2-4:1.0: USB hub found
Feb 25 17:34:39 tonkachi kernel: [  217.487502] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:39 tonkachi kernel: [  217.487533] hub 2-4:1.0: 3 ports
detected
Feb 25 17:34:40 tonkachi kernel: [  217.782947] usb 2-4.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:34:40 tonkachi kernel: [  217.806372] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.807238] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808106] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808996] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.809420] usb 2-4.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:34:40 tonkachi kernel: [  217.809425] usb 2-4.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:34:40 tonkachi kernel: [  217.809430] usb 2-4.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:34:40 tonkachi kernel: [  217.809434] usb 2-4.1: Manufacturer:
JMicron
Feb 25 17:34:40 tonkachi kernel: [  217.809437] usb 2-4.1: SerialNumber:
6A1713351FFF
Feb 25 17:34:40 tonkachi kernel: [  217.809574] usb 2-4.1: configuration
#1 chosen from 1 choice
Feb 25 17:34:40 tonkachi kernel: [  217.811213] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.812078] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.840485] Initializing USB Mass
Storage driver...
Feb 25 17:34:40 tonkachi kernel: [  217.840664] scsi6 : SCSI emulation
for USB Mass Storage devices
Feb 25 17:34:40 tonkachi kernel: [  217.840795] usbcore: registered new
interface driver usb-storage
Feb 25 17:34:40 tonkachi kernel: [  217.840800] USB Mass Storage support
registered.
Feb 25 17:34:45 tonkachi kernel: [  222.833493] scsi 6:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:34:45 tonkachi kernel: [  222.846361] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:34:45 tonkachi kernel: [  222.847589] sr0: scsi3-mmc drive:
24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:34:45 tonkachi kernel: [  222.847597] Uniform CD-ROM driver
Revision: 3.20
Feb 25 17:34:45 tonkachi kernel: [  222.849281] sr 6:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:34:45 tonkachi kernel: [  222.958589] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

now, I unplug the USB DVD drive:

Feb 25 17:35:38 tonkachi kernel: [  276.374282] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728151] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728819] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

I plug it back in, with a DVD in the drive:

Feb 25 17:41:21 tonkachi kernel: [  618.701586] Registered led device:
iwl-phy0::radio
Feb 25 17:41:21 tonkachi kernel: [  618.701619] Registered led device:
iwl-phy0::assoc
Feb 25 17:41:21 tonkachi kernel: [  618.701649] Registered led device:
iwl-phy0::RX
Feb 25 17:41:21 tonkachi kernel: [  618.701674] Registered led device:
iwl-phy0::TX
Feb 25 17:41:21 tonkachi kernel: [  618.719536] usb 2-3: new high speed
USB device using xhci_hcd and address 0
Feb 25 17:41:21 tonkachi kernel: [  618.742028] usb 2-3: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:41:21 tonkachi kernel: [  618.742034] usb 2-3: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:41:21 tonkachi kernel: [  618.742155] usb 2-3: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  618.742168] usb 2-3: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 17:41:21 tonkachi kernel: [  618.743316] hub 2-3:1.0: USB hub found
Feb 25 17:41:21 tonkachi kernel: [  618.743794] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  618.743830] hub 2-3:1.0: 3 ports
detected
Feb 25 17:41:21 tonkachi kernel: [  619.045944] usb 2-3.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:41:21 tonkachi kernel: [  619.069424] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.070295] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.071173] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072042] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072398] usb 2-3.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:41:21 tonkachi kernel: [  619.072404] usb 2-3.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:41:21 tonkachi kernel: [  619.072408] usb 2-3.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:41:21 tonkachi kernel: [  619.072412] usb 2-3.1: Manufacturer:
JMicron
Feb 25 17:41:21 tonkachi kernel: [  619.072416] usb 2-3.1: SerialNumber:
6A1713351FFF
Feb 25 17:41:21 tonkachi kernel: [  619.072530] usb 2-3.1: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  619.074124] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.074999] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.075559] scsi7 : SCSI emulation

for USB Mass Storage devices

Feb 25 17:41:26 tonkachi kernel: [  624.073472] scsi 7:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:41:26 tonkachi kernel: [  624.086041] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:26 tonkachi kernel: [  624.087393] sr0: scsi3-mmc drive:
62x/62x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:41:26 tonkachi kernel: [  624.088377] sr 7:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:41:26 tonkachi kernel: [  624.118679] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  626.883451] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  626.915739] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.147000] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.270741] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

unplug:

Feb 25 17:42:05 tonkachi kernel: [  663.327552] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.364546] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.365228] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:10 tonkachi kernel: [  667.360714] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.360956] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.361101] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.362264] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.363730] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377669] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377910] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.378158] VFS: busy inodes on

changed media or resized disk sr0

plug back in:

Feb 25 17:42:50 tonkachi kernel: [  707.759089] Registered led device:
iwl-phy0::radio
Feb 25 17:42:50 tonkachi kernel: [  707.759179] Registered led device:
iwl-phy0::assoc
Feb 25 17:42:50 tonkachi kernel: [  707.759412] Registered led device:
iwl-phy0::RX
Feb 25 17:42:50 tonkachi kernel: [  707.759572] Registered led device:

iwl-phy0::TX

but the disk does not register anymore :(

Akos

#18 lore raw
In reply to Alan Stern

Alan,

Quoted 4 lines

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

as I added xhci among the SUSPEND_MODULES for pm, I tried pm-hibernate after a successful pm-suspend. but this doesn't work, the machine just goes blank, and it doesn't power off. doing a power cycle boots it 'as usual'.

how can one debug the hibernation process?

Akos

#6 lore raw
In reply to Ákos Maróy
Quoted 8 lines · Ákos Maróy
Quoted 4 lines

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

wow, rmmod xhci - and the suspend goes through fine!

what is this xhci thing anyway?

It is the driver for USB-3.0 controllers. It's relatively new and not as mature as the USB-2.0 drivers.

I'm a little surprised that it is running on your system. Why would you have USB-3.0 hardware?

Quoted 234 lines
Quoted 4 lines

These separate issues deserve to be investigated more closely. The USB stack is not supposed to be that fragile. Describe your environment more fully and provide the dmesg log from a kernel with CONFIG_USB_DEBUG enabled showing what happens during the experiments.

indeed. interestingly, xhci may be the culprit, as without xhci, the external DVD doesn't even register at all.

loadind xhci, I get:

Feb 25 17:33:50 tonkachi kernel: [  168.203418] xhci_hcd 0000:02:00.0:
PCI INT A -> GSI 16 (level, low) -> IRQ 16
Feb 25 17:33:50 tonkachi kernel: [  168.203568] xhci_hcd 0000:02:00.0:
xHCI Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203689] xhci_hcd 0000:02:00.0:
new USB bus registered, assigned bus number 2
Feb 25 17:33:50 tonkachi kernel: [  168.203832] xhci_hcd 0000:02:00.0:
irq 16, io mem 0xd4000000
Feb 25 17:33:50 tonkachi kernel: [  168.203875] usb usb2: config 1
interface 0 altsetting 0 endpoint 0x81 has no SuperSpeed companion
descriptor
Feb 25 17:33:50 tonkachi kernel: [  168.203912] usb usb2: New USB device
found, idVendor=1d6b, idProduct=0002
Feb 25 17:33:50 tonkachi kernel: [  168.203919] usb usb2: New USB device
strings: Mfr=3, Product=2, SerialNumber=1
Feb 25 17:33:50 tonkachi kernel: [  168.203925] usb usb2: Product: xHCI
Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203931] usb usb2: Manufacturer:
Linux 2.6.32.8-usb-debug xhci_hcd
Feb 25 17:33:50 tonkachi kernel: [  168.203937] usb usb2: SerialNumber:
0000:02:00.0
Feb 25 17:33:50 tonkachi kernel: [  168.204089] usb usb2: configuration
#1 chosen from 1 choice
Feb 25 17:33:50 tonkachi kernel: [  168.204198] hub 2-0:1.0: USB hub found
Feb 25 17:33:50 tonkachi kernel: [  168.204213] hub 2-0:1.0: 4 ports

detected

plugging in the USB DVD drive, there's a system 'freeze' for about 5 seconds (nothing is responding, not even caps lock), then I get in syslog:

Feb 25 17:34:39 tonkachi kernel: [  217.433960] Registered led device:
iwl-phy0::radio
Feb 25 17:34:39 tonkachi kernel: [  217.433990] Registered led device:
iwl-phy0::assoc
Feb 25 17:34:39 tonkachi kernel: [  217.434020] Registered led device:
iwl-phy0::RX
Feb 25 17:34:39 tonkachi kernel: [  217.434045] Registered led device:
iwl-phy0::TX
Feb 25 17:34:39 tonkachi kernel: [  217.463366] usb 2-4: new high speed
USB device using xhci_hcd and address 0
Feb 25 17:34:39 tonkachi kernel: [  217.485828] usb 2-4: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:34:39 tonkachi kernel: [  217.485834] usb 2-4: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:34:39 tonkachi kernel: [  217.485949] usb 2-4: configuration
#1 chosen from 1 choice
Feb 25 17:34:39 tonkachi kernel: [  217.485963] usb 2-4: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 17:34:39 tonkachi kernel: [  217.487002] hub 2-4:1.0: USB hub found
Feb 25 17:34:39 tonkachi kernel: [  217.487502] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:39 tonkachi kernel: [  217.487533] hub 2-4:1.0: 3 ports
detected
Feb 25 17:34:40 tonkachi kernel: [  217.782947] usb 2-4.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:34:40 tonkachi kernel: [  217.806372] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.807238] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808106] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808996] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.809420] usb 2-4.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:34:40 tonkachi kernel: [  217.809425] usb 2-4.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:34:40 tonkachi kernel: [  217.809430] usb 2-4.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:34:40 tonkachi kernel: [  217.809434] usb 2-4.1: Manufacturer:
JMicron
Feb 25 17:34:40 tonkachi kernel: [  217.809437] usb 2-4.1: SerialNumber:
6A1713351FFF
Feb 25 17:34:40 tonkachi kernel: [  217.809574] usb 2-4.1: configuration
#1 chosen from 1 choice
Feb 25 17:34:40 tonkachi kernel: [  217.811213] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.812078] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.840485] Initializing USB Mass
Storage driver...
Feb 25 17:34:40 tonkachi kernel: [  217.840664] scsi6 : SCSI emulation
for USB Mass Storage devices
Feb 25 17:34:40 tonkachi kernel: [  217.840795] usbcore: registered new
interface driver usb-storage
Feb 25 17:34:40 tonkachi kernel: [  217.840800] USB Mass Storage support
registered.
Feb 25 17:34:45 tonkachi kernel: [  222.833493] scsi 6:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:34:45 tonkachi kernel: [  222.846361] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:34:45 tonkachi kernel: [  222.847589] sr0: scsi3-mmc drive:
24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:34:45 tonkachi kernel: [  222.847597] Uniform CD-ROM driver
Revision: 3.20
Feb 25 17:34:45 tonkachi kernel: [  222.849281] sr 6:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:34:45 tonkachi kernel: [  222.958589] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

now, I unplug the USB DVD drive:

Feb 25 17:35:38 tonkachi kernel: [  276.374282] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728151] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728819] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

I plug it back in, with a DVD in the drive:

Feb 25 17:41:21 tonkachi kernel: [  618.701586] Registered led device:
iwl-phy0::radio
Feb 25 17:41:21 tonkachi kernel: [  618.701619] Registered led device:
iwl-phy0::assoc
Feb 25 17:41:21 tonkachi kernel: [  618.701649] Registered led device:
iwl-phy0::RX
Feb 25 17:41:21 tonkachi kernel: [  618.701674] Registered led device:
iwl-phy0::TX
Feb 25 17:41:21 tonkachi kernel: [  618.719536] usb 2-3: new high speed
USB device using xhci_hcd and address 0
Feb 25 17:41:21 tonkachi kernel: [  618.742028] usb 2-3: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:41:21 tonkachi kernel: [  618.742034] usb 2-3: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:41:21 tonkachi kernel: [  618.742155] usb 2-3: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  618.742168] usb 2-3: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 17:41:21 tonkachi kernel: [  618.743316] hub 2-3:1.0: USB hub found
Feb 25 17:41:21 tonkachi kernel: [  618.743794] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  618.743830] hub 2-3:1.0: 3 ports
detected
Feb 25 17:41:21 tonkachi kernel: [  619.045944] usb 2-3.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:41:21 tonkachi kernel: [  619.069424] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.070295] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.071173] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072042] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072398] usb 2-3.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:41:21 tonkachi kernel: [  619.072404] usb 2-3.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:41:21 tonkachi kernel: [  619.072408] usb 2-3.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:41:21 tonkachi kernel: [  619.072412] usb 2-3.1: Manufacturer:
JMicron
Feb 25 17:41:21 tonkachi kernel: [  619.072416] usb 2-3.1: SerialNumber:
6A1713351FFF
Feb 25 17:41:21 tonkachi kernel: [  619.072530] usb 2-3.1: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  619.074124] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.074999] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.075559] scsi7 : SCSI emulation

for USB Mass Storage devices

Feb 25 17:41:26 tonkachi kernel: [  624.073472] scsi 7:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:41:26 tonkachi kernel: [  624.086041] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:26 tonkachi kernel: [  624.087393] sr0: scsi3-mmc drive:
62x/62x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:41:26 tonkachi kernel: [  624.088377] sr 7:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:41:26 tonkachi kernel: [  624.118679] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  626.883451] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  626.915739] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.147000] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.270741] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

unplug:

Feb 25 17:42:05 tonkachi kernel: [  663.327552] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.364546] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.365228] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:10 tonkachi kernel: [  667.360714] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.360956] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.361101] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.362264] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.363730] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377669] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377910] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.378158] VFS: busy inodes on

changed media or resized disk sr0

plug back in:

Feb 25 17:42:50 tonkachi kernel: [  707.759089] Registered led device:
iwl-phy0::radio
Feb 25 17:42:50 tonkachi kernel: [  707.759179] Registered led device:
iwl-phy0::assoc
Feb 25 17:42:50 tonkachi kernel: [  707.759412] Registered led device:
iwl-phy0::RX
Feb 25 17:42:50 tonkachi kernel: [  707.759572] Registered led device:
Quoted 5 lines

iwl-phy0::TX

but the disk does not register anymore :(

This is something Sarah should look into. She's the main developer behind xhci-hcd.

Alan Stern

#7 lore raw
Quoted 9 lines · Alan Stern
Quoted 7 lines · Ákos Maróy
Quoted 4 lines

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

wow, rmmod xhci - and the suspend goes through fine!

Quoted 7 lines
Quoted 1 line

what is this xhci thing anyway?

It is the driver for USB-3.0 controllers. It's relatively new and not as mature as the USB-2.0 drivers.

I'm a little surprised that it is running on your system. Why would you have USB-3.0 hardware?

USB 3.0 hosts and devices are now available commercially. I think the HP envy laptop has an integrated USB 3.0 host. Ákos, which host controller do you have? Is it a PCIe add-in card, a PCI express card, or a port on a laptop?

The xHCI driver doesn't support PCI suspend, and it also doesn't support suspending devices under the xHCI host. The xHCI hardware needs to do some extra work when a device is suspended, and I haven't added that API to the USB core yet. In short, power management sucks under xHCI. :-/

Quoted 38 lines
Quoted 38 lines
Quoted 4 lines

These separate issues deserve to be investigated more closely. The USB stack is not supposed to be that fragile. Describe your environment more fully and provide the dmesg log from a kernel with CONFIG_USB_DEBUG enabled showing what happens during the experiments.

indeed. interestingly, xhci may be the culprit, as without xhci, the external DVD doesn't even register at all.

loadind xhci, I get:

Feb 25 17:33:50 tonkachi kernel: [  168.203418] xhci_hcd 0000:02:00.0:
PCI INT A -> GSI 16 (level, low) -> IRQ 16
Feb 25 17:33:50 tonkachi kernel: [  168.203568] xhci_hcd 0000:02:00.0:
xHCI Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203689] xhci_hcd 0000:02:00.0:
new USB bus registered, assigned bus number 2
Feb 25 17:33:50 tonkachi kernel: [  168.203832] xhci_hcd 0000:02:00.0:
irq 16, io mem 0xd4000000
Feb 25 17:33:50 tonkachi kernel: [  168.203875] usb usb2: config 1
interface 0 altsetting 0 endpoint 0x81 has no SuperSpeed companion
descriptor
Feb 25 17:33:50 tonkachi kernel: [  168.203912] usb usb2: New USB device
found, idVendor=1d6b, idProduct=0002
Feb 25 17:33:50 tonkachi kernel: [  168.203919] usb usb2: New USB device
strings: Mfr=3, Product=2, SerialNumber=1
Feb 25 17:33:50 tonkachi kernel: [  168.203925] usb usb2: Product: xHCI
Host Controller
Feb 25 17:33:50 tonkachi kernel: [  168.203931] usb usb2: Manufacturer:
Linux 2.6.32.8-usb-debug xhci_hcd
Feb 25 17:33:50 tonkachi kernel: [  168.203937] usb usb2: SerialNumber:
0000:02:00.0
Feb 25 17:33:50 tonkachi kernel: [  168.204089] usb usb2: configuration
#1 chosen from 1 choice
Feb 25 17:33:50 tonkachi kernel: [  168.204198] hub 2-0:1.0: USB hub found
Feb 25 17:33:50 tonkachi kernel: [  168.204213] hub 2-0:1.0: 4 ports

detected

Quoted 2 lines
Quoted 2 lines

plugging in the USB DVD drive, there's a system 'freeze' for about 5 seconds (nothing is responding, not even caps lock), then I get in syslog:

Oh, freezes are not good. I wonder if the xHCI host is taking a long time to respond to a hardware command? Can you turn on CONFIG_USB_XHCI_HCD_DEBUGGING and send me the dmesg when you plug in the device?

Quoted 11 lines
Quoted 11 lines
Feb 25 17:34:39 tonkachi kernel: [  217.433960] Registered led device:
iwl-phy0::radio
Feb 25 17:34:39 tonkachi kernel: [  217.433990] Registered led device:
iwl-phy0::assoc
Feb 25 17:34:39 tonkachi kernel: [  217.434020] Registered led device:
iwl-phy0::RX
Feb 25 17:34:39 tonkachi kernel: [  217.434045] Registered led device:
iwl-phy0::TX
Feb 25 17:34:39 tonkachi kernel: [  217.463366] usb 2-4: new high speed
USB device using xhci_hcd and address 0
Feb 25 17:34:39 tonkachi kernel: [  217.485828] usb 2-4: New USB device
Quoted 8 lines
Quoted 8 lines

found, idVendor=058f, idProduct=6254

Feb 25 17:34:39 tonkachi kernel: [  217.485834] usb 2-4: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:34:39 tonkachi kernel: [  217.485949] usb 2-4: configuration
#1 chosen from 1 choice
Feb 25 17:34:39 tonkachi kernel: [  217.485963] usb 2-4: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 17:34:39 tonkachi kernel: [  217.487002] hub 2-4:1.0: USB hub found

Did you plug in the DVD device behind a USB hub? Or is the hub a part of the device?

Quoted 74 lines
Quoted 74 lines
Feb 25 17:34:39 tonkachi kernel: [  217.487502] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:39 tonkachi kernel: [  217.487533] hub 2-4:1.0: 3 ports
detected
Feb 25 17:34:40 tonkachi kernel: [  217.782947] usb 2-4.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:34:40 tonkachi kernel: [  217.806372] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.807238] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808106] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.808996] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.809420] usb 2-4.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:34:40 tonkachi kernel: [  217.809425] usb 2-4.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:34:40 tonkachi kernel: [  217.809430] usb 2-4.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:34:40 tonkachi kernel: [  217.809434] usb 2-4.1: Manufacturer:
JMicron
Feb 25 17:34:40 tonkachi kernel: [  217.809437] usb 2-4.1: SerialNumber:
6A1713351FFF
Feb 25 17:34:40 tonkachi kernel: [  217.809574] usb 2-4.1: configuration
#1 chosen from 1 choice
Feb 25 17:34:40 tonkachi kernel: [  217.811213] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.812078] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:34:40 tonkachi kernel: [  217.840485] Initializing USB Mass
Storage driver...
Feb 25 17:34:40 tonkachi kernel: [  217.840664] scsi6 : SCSI emulation
for USB Mass Storage devices
Feb 25 17:34:40 tonkachi kernel: [  217.840795] usbcore: registered new
interface driver usb-storage
Feb 25 17:34:40 tonkachi kernel: [  217.840800] USB Mass Storage support
registered.
Feb 25 17:34:45 tonkachi kernel: [  222.833493] scsi 6:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:34:45 tonkachi kernel: [  222.846361] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:34:45 tonkachi kernel: [  222.847589] sr0: scsi3-mmc drive:
24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:34:45 tonkachi kernel: [  222.847597] Uniform CD-ROM driver
Revision: 3.20
Feb 25 17:34:45 tonkachi kernel: [  222.849281] sr 6:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:34:45 tonkachi kernel: [  222.958589] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

now, I unplug the USB DVD drive:

Feb 25 17:35:38 tonkachi kernel: [  276.374282] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728151] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728819] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

I plug it back in, with a DVD in the drive:

Feb 25 17:41:21 tonkachi kernel: [  618.701586] Registered led device:
iwl-phy0::radio
Feb 25 17:41:21 tonkachi kernel: [  618.701619] Registered led device:
iwl-phy0::assoc
Feb 25 17:41:21 tonkachi kernel: [  618.701649] Registered led device:
iwl-phy0::RX
Feb 25 17:41:21 tonkachi kernel: [  618.701674] Registered led device:
iwl-phy0::TX
Feb 25 17:41:21 tonkachi kernel: [  618.719536] usb 2-3: new high speed

USB device using xhci_hcd and address 0

Quoted 8 lines
Quoted 8 lines
Feb 25 17:41:21 tonkachi kernel: [  618.742028] usb 2-3: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:41:21 tonkachi kernel: [  618.742034] usb 2-3: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:41:21 tonkachi kernel: [  618.742155] usb 2-3: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  618.742168] usb 2-3: ep 0x81 -

rounding interval to 2048 microframes

That looks like a rather long polling interval. Can you post the output of lsusb -vvv -d 058f:6254?

Quoted 46 lines
Quoted 46 lines
Feb 25 17:41:21 tonkachi kernel: [  618.743316] hub 2-3:1.0: USB hub found
Feb 25 17:41:21 tonkachi kernel: [  618.743794] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  618.743830] hub 2-3:1.0: 3 ports
detected
Feb 25 17:41:21 tonkachi kernel: [  619.045944] usb 2-3.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 17:41:21 tonkachi kernel: [  619.069424] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.070295] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.071173] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072042] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.072398] usb 2-3.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 17:41:21 tonkachi kernel: [  619.072404] usb 2-3.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 17:41:21 tonkachi kernel: [  619.072408] usb 2-3.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 17:41:21 tonkachi kernel: [  619.072412] usb 2-3.1: Manufacturer:
JMicron
Feb 25 17:41:21 tonkachi kernel: [  619.072416] usb 2-3.1: SerialNumber:
6A1713351FFF
Feb 25 17:41:21 tonkachi kernel: [  619.072530] usb 2-3.1: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  619.074124] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.074999] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 17:41:21 tonkachi kernel: [  619.075559] scsi7 : SCSI emulation

for USB Mass Storage devices

Feb 25 17:41:26 tonkachi kernel: [  624.073472] scsi 7:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 17:41:26 tonkachi kernel: [  624.086041] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:26 tonkachi kernel: [  624.087393] sr0: scsi3-mmc drive:
62x/62x writer dvd-ram cd/rw xa/form2 cdda tray
Feb 25 17:41:26 tonkachi kernel: [  624.088377] sr 7:0:0:0: Attached
scsi generic sg2 type 5
Feb 25 17:41:26 tonkachi kernel: [  624.118679] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

Quoted 8 lines
Quoted 8 lines
Feb 25 17:41:29 tonkachi kernel: [  626.883451] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  626.915739] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.147000] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 17:41:29 tonkachi kernel: [  627.270741] xhci_hcd 0000:02:00.0:

WARN: Stalled endpoint

Can you read the DVD at this point?

Quoted 16 lines
Quoted 16 lines

unplug:

Feb 25 17:42:05 tonkachi kernel: [  663.327552] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.364546] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:06 tonkachi kernel: [  663.365228] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:42:10 tonkachi kernel: [  667.360714] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.360956] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.361101] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.362264] VFS: busy inodes on

changed media or resized disk sr0

Quoted 8 lines
Quoted 8 lines
Feb 25 17:42:10 tonkachi kernel: [  667.363730] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377669] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.377910] VFS: busy inodes on
changed media or resized disk sr0
Feb 25 17:42:10 tonkachi kernel: [  667.378158] VFS: busy inodes on

changed media or resized disk sr0

Did you unmount the DVD before you removed it? I'm not sure what the VFS errors are, but it looks like VFS doesn't like you removing the disk.

Quoted 13 lines
Quoted 13 lines

plug back in:

Feb 25 17:42:50 tonkachi kernel: [  707.759089] Registered led device:
iwl-phy0::radio
Feb 25 17:42:50 tonkachi kernel: [  707.759179] Registered led device:
iwl-phy0::assoc
Feb 25 17:42:50 tonkachi kernel: [  707.759412] Registered led device:
iwl-phy0::RX
Feb 25 17:42:50 tonkachi kernel: [  707.759572] Registered led device:

iwl-phy0::TX

Quoted 4 lines
Quoted 1 line

but the disk does not register anymore :(

This is something Sarah should look into. She's the main developer behind xhci-hcd.

Sarah Sharp

#8 lore raw
Quoted 8 lines · Sarah Sharp
Quoted 8 lines
Quoted 8 lines

now, I unplug the USB DVD drive:

Feb 25 17:35:38 tonkachi kernel: [  276.374282] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728151] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728819] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

Shouldn't there be some messages here about "USB disconnect"? This suggests there's something wrong with the root hub.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines

I plug it back in, with a DVD in the drive:

Feb 25 17:41:21 tonkachi kernel: [  618.701586] Registered led device:
iwl-phy0::radio
Feb 25 17:41:21 tonkachi kernel: [  618.701619] Registered led device:
iwl-phy0::assoc
Feb 25 17:41:21 tonkachi kernel: [  618.701649] Registered led device:
iwl-phy0::RX
Feb 25 17:41:21 tonkachi kernel: [  618.701674] Registered led device:
iwl-phy0::TX
Feb 25 17:41:21 tonkachi kernel: [  618.719536] usb 2-3: new high speed

USB device using xhci_hcd and address 0

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Feb 25 17:41:21 tonkachi kernel: [  618.742028] usb 2-3: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 17:41:21 tonkachi kernel: [  618.742034] usb 2-3: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 17:41:21 tonkachi kernel: [  618.742155] usb 2-3: configuration
#1 chosen from 1 choice
Feb 25 17:41:21 tonkachi kernel: [  618.742168] usb 2-3: ep 0x81 -

rounding interval to 2048 microframes

You must have plugged it into a different port this time, yes?

Quoted 2 lines

That looks like a rather long polling interval. Can you post the output of lsusb -vvv -d 058f:6254?

2048 microframes is 256 ms, the normal polling interval for hubs.

Alan Stern

#9 lore raw
Quoted 11 lines · Alan Stern
Quoted 8 lines · Sarah Sharp
Quoted 8 lines
Quoted 8 lines

now, I unplug the USB DVD drive:

Feb 25 17:35:38 tonkachi kernel: [  276.374282] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728151] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 17:35:39 tonkachi kernel: [  276.728819] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

Quoted 2 lines

Shouldn't there be some messages here about "USB disconnect"? This suggests there's something wrong with the root hub.

True. I can't tell exactly what's going on without CONFIG_USB_XHCI_HCD_DEBUGGING. It's possible the xHCI host never notified the driver of the disconnect, or there's a bug in the xHCI hub emulation code.

Sarah Sharp

#16 lore raw
In reply to Alan Stern
Quoted 5 lines · Alan Stern

It is the driver for USB-3.0 controllers. It's relatively new and not as mature as the USB-2.0 drivers.

I'm a little surprised that it is running on your system. Why would you have USB-3.0 hardware?

I might - this is a brand new HP Envy 15 laptop, which seems to be 'too new' for Linux in a number of ways (e.g. video card, with the latest 10.2 official AMD binary driver 'sort of' working, hardware raid controller for SSD, which only the mainline grub can handle, WiFi card that is only supported in 2.6.32.x, etc.)

actually, it has 3 USB ports - two of them seem to have these issues. the third USB port, which is phyisically both a USB and en eSATA port, seems to work as expected.

Quoted 2 lines

This is something Sarah should look into. She's the main developer behind xhci-hcd.

thanks for CC'ing her in..

Quoted 4 lines · Sarah Sharp

USB 3.0 hosts and devices are now available commercially. I think the HP envy laptop has an integrated USB 3.0 host. Ákos, which host controller do you have? Is it a PCIe add-in card, a PCI express card, or a port on a laptop?

see above, these are two ports on the side of the laptop.

Quoted 4 lines

The xHCI driver doesn't support PCI suspend, and it also doesn't support suspending devices under the xHCI host. The xHCI hardware needs to do some extra work when a device is suspended, and I haven't added that API to the USB core yet. In short, power management sucks under xHCI. :-/

for suspend, I seem to get along find with unloading / reloading the xhci kernel module, as a workaround

Quoted 4 lines

Oh, freezes are not good. I wonder if the xHCI host is taking a long time to respond to a hardware command? Can you turn on CONFIG_USB_XHCI_HCD_DEBUGGING and send me the dmesg when you plug in the device?

ok, I'll do that..

Quoted 2 lines

Did you plug in the DVD device behind a USB hub? Or is the hub a part of the device?

I didn't use a USB hub. I plugged in the USB DVD right into the USB port on the laptop. the HP Envy 15 does not have a built-in optical drive, but you can order an external USB DVD-RW drive as an option. this is what I have.

Quoted 2 lines

That looks like a rather long polling interval. Can you post the output of lsusb -vvv -d 058f:6254?

sure, here you go:

# lsusb -vvv -d 058f:6254

Bus 002 Device 002: ID 058f:6254 Alcor Micro Corp. USB Hub Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x058f Alcor Micro Corp.
  idProduct          0x6254 USB Hub
  bcdDevice            1.00
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 3
wHubCharacteristic 0x0080
Ganged power switching
Ganged overcurrent protection
TT think time 8 FS bits
Port indicators
bPwrOn2PwrGood 50 * 2 milli seconds
bHubContrCurrent 100 milli Ampere
DeviceRemovable 0x02
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0503 highspeed power enable connect Port 2: 0000.0100 power
Port 3: 0000.0100 power
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00

  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub

bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered

though let me remind you that the same long delay happens when I plug in other devices, like simple USB mice. also, if I plug in the same device into the third USB port, it seems to work just fine. no 5 second freeze, etc.

Quoted 1 line

Can you read the DVD at this point?

yes, after the first plug, it works as expected. after the unplug - replug, it doesn't work. unless I unload the xhci module, and reload it.

Quoted 3 lines

Did you unmount the DVD before you removed it? I'm not sure what the VFS errors are, but it looks like VFS doesn't like you removing the disk.

IMHO it got automatically mounted by gnome... (I saw it on my desktop as a DVD drive)

Quoted 1 line · Alan Stern

You must have plugged it into a different port this time, yes?

I might have used the different of the two proplematic USB ports..

Quoted 4 lines · Sarah Sharp

True. I can't tell exactly what's going on without CONFIG_USB_XHCI_HCD_DEBUGGING. It's possible the xHCI host never notified the driver of the disconnect, or there's a bug in the xHCI hub emulation code.

I'm recompiling the kernel with the above configuration setting, and will send you an output..

thanks for spending time on this issue...

BTW, any ideas on why suspend works with unloading xhci, but hibernate not working?

Akos

#17 lore raw
Quoted 2 lines · Ákos Maróy

BTW, any ideas on why suspend works with unloading xhci, but hibernate not working?

That's a power management issue, not a USB problem. Rafael may be able to help you. You'll probably want to start a new email thread on the linux-pm mailing list.

Alan Stern

#10 lore raw
In reply to Sarah Sharp

Sarah,

Quoted 4 lines

True. I can't tell exactly what's going on without CONFIG_USB_XHCI_HCD_DEBUGGING. It's possible the xHCI host never notified the driver of the disconnect, or there's a bug in the xHCI hub emulation code.

after having turned this option on in the kernel, this is what I get when plugging in the device:

Feb 25 23:32:14 tonkachi kernel: [  100.473783] Registered led device:
iwl-phy0::radio
Feb 25 23:32:14 tonkachi kernel: [  100.473812] Registered led device:
iwl-phy0::assoc
Feb 25 23:32:14 tonkachi kernel: [  100.473839] Registered led device:
iwl-phy0::RX
Feb 25 23:32:14 tonkachi kernel: [  100.473864] Registered led device:
iwl-phy0::TX
Feb 25 23:32:14 tonkachi kernel: [  100.497848] usb 2-4: new high speed
USB device using xhci_hcd and address 0
Feb 25 23:32:14 tonkachi kernel: [  100.520591] usb 2-4: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 23:32:14 tonkachi kernel: [  100.520595] usb 2-4: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 23:32:14 tonkachi kernel: [  100.520680] usb 2-4: configuration
#1 chosen from 1 choice
Feb 25 23:32:14 tonkachi kernel: [  100.520732] usb 2-4: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 23:32:14 tonkachi kernel: [  100.522403] hub 2-4:1.0: USB hub found
Feb 25 23:32:14 tonkachi kernel: [  100.522930] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.523156] hub 2-4:1.0: 3 ports
detected
Feb 25 23:32:14 tonkachi kernel: [  100.825758] usb 2-4.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 23:32:14 tonkachi kernel: [  100.848327] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.849375] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.850370] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.851366] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.851782] usb 2-4.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 23:32:14 tonkachi kernel: [  100.851785] usb 2-4.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 23:32:14 tonkachi kernel: [  100.851790] usb 2-4.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 23:32:14 tonkachi kernel: [  100.851792] usb 2-4.1: Manufacturer:
JMicron
Feb 25 23:32:14 tonkachi kernel: [  100.851795] usb 2-4.1: SerialNumber:
6A1713351FFF
Feb 25 23:32:14 tonkachi kernel: [  100.851873] usb 2-4.1: configuration
#1 chosen from 1 choice
Feb 25 23:32:14 tonkachi kernel: [  100.854283] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.855037] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.879271] Initializing USB Mass
Storage driver...
Feb 25 23:32:14 tonkachi kernel: [  100.879988] scsi6 : SCSI emulation
for USB Mass Storage devices
Feb 25 23:32:14 tonkachi kernel: [  100.880141] usbcore: registered new
interface driver usb-storage
Feb 25 23:32:14 tonkachi kernel: [  100.880147] USB Mass Storage support
registered.
Feb 25 23:32:19 tonkachi kernel: [  105.884853] scsi 6:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 23:32:19 tonkachi kernel: <0: `MEM_WRITE_DWORD(3'b000,
32'hffffc90000hi0 00000.1fevhc anl0d0i  02-:e0x  t2);
Feb 25 23:32:19 tonkachi kernel: x1.0:  _ca0 00000000 01000000 02038000
Feb 25 23:32:19 tonkachi kernel: x1.0: `MEM_W_c70 000000 f__h:had
c2c]:00-:e0x  t3);
Feb 25 23:32:19 tonkachi kernel: _tist us:i 00Tx] 5b78b073ndxh0.0
_c.]70h ]00t0:xhcf3) 754'hf);x.23000:02:00.0: `MEM_WRITE_DWORD(3'b000,
32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: 603n00nt 0<05.898876] xhci_hcd
0000:00h00MEM_WRITE_10 wn.8eh:0c>78 0 i_0 013Ue9:020)
Feb 25 23:32:19 tonkachi kernel: 02:00.i0h00.0: New dequeue pointer =
0x375b78d0 (DMA)
Feb 25 23:32:19 tonkachi kernel: 19
Feb 25 23:32:19 tonkachi kernel: 3d07` 300ee e_ i7c67 o5.899445] 9fc
Crned from h:0t8]__0td h096:: cs0000c63,v 005a/ed scsi  0
0dd00M_WRITE_DWORD(3'b000, 32'h50ns 01en2  ]]h00s0n/27 00670009[
903541] xhci0 00:_WRITE_DWORD(3'b000, 32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: n (D005.r0000:024 0
0dd00M_WRITE_DWORD(3'b000, 32'hffffc950ns0en2   ]]h00s0n/57 0067009[
907215] x0 0_WRITE_DWORD(3'b000, 32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: = 0i_hcd 0000:02:00.0:
`MEM_WRITE_DWORD(3'b000, 32'hffffc90000c7c808, 32'h3, 4'hf);
Feb 25 23:32:19 tonkachi kernel: n (D00090.rom0000:024 0
0dd00M_WRITE_DWORD(3'b000, 32'hffffc90000c50ns 09en2   ]]h00s0n/97
00670009[  910899] x0 00:_WRITE_DWORD(3'b000, 32'hffffc90000c7c024,
32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: T5nt d:h0  c:0s0n/57 00.0I67009[
916128] x0 00:0_WRITE_DWORD(3'b000, 32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: 6 3]0D0xhci8hci_
0000:02:040]1000:02:00.0: In handle_tx_event
Feb 25 23:32:19 tonkachi kernel: [  105.922881] xhci_hcd0hch0:
`MEM_WRI>f0OS _tx.0:c0990c_xh.0 8b0002c= 0>DMA)>[  105.92000000ht0lo>2f
:n0e0cf0c40.09400[._> ee_1<0a1r000c700.xhci_hcd 0000:02:00.0: Endpoint
state = 0x1
Feb 25 23:32:19 tonkachi kernel: 2:0:00.0: In xhci_handle_event
Feb 25 23:32:19 tonkachi kernel: 19b lnd 6] :000 020300.0ic_ nn

=f0x10[10105.926503] xhci_hcd 0000:02:00.0: Event ring deq = 02hc::;3(:
c7c.r80h 1_d7 10xx.]0477x.:EWx 6:00>[ 5750c>000.0: @37805720 375b7a30 00`7>ff5.936369] 7dx0 0_e0 :434h1:EWx 6:007>[300700000.0: @37805730 37 <h05.936744] xhci_hcd 0000:02:00.0: xhci_handle_event - OS owns TRB

Feb 25 23:32:19 tonkachi kernel:
Feb 25 23:32:19 tonkachi kernel: 025<)nE_DW0vev8 urb= 0x1
Feb 25 23:32:19 tonkachi kernel: <750.07<h05.937960] xhci_hcd
0000:02:00.0: xhci_handle_event - OS owns TRB
Feb 25 23:32:19 tonkachi kernel:
Feb 25 23:32:19 tonkachi kernel: 025<)[nE_D0veve8 urb= 0x1
Feb 25 23:32:19 tonkachi kernel:
Feb 25 23:32:19 tonkachi kernel: 025<)[nE_D0vev8 urb= 0x1
Feb 25 23:32:19 tonkachi kernel: <750c.07<h05.945270] xhci_hcd
0000:02:00.0: xhci_handle_event - OS owns TRB
Feb 25 23:32:19 tonkachi kernel: se0D]<7>090<c xh: `MEM0'vcd
0000:02:00.0: xhci_handle_event - calling handle_tx_event
Feb 25 23:32:19 tonkachi kernel: <0.0: @37805430 375b7ad0 0,T:7>xhih [c
Feb 25 23:32:19 tonkachi kernel: 7x140 i6b 6:00l38,0.0:3]
xhci_01ie5R'vecd 0000:02:00.0: xhci_handle_event - calling handle_tx_event
Feb 25 23:32:19 tonkachi kernel: se0( 0:020i_h t  dma_hcd 0000:02:00.0:
`M50537805460 375i8R 05c 005.0 7c0  c0c[f0:
Feb 25 23:32:19 tonkachi kernel: <370oinhcd 005107805470 375b7b00
00000000 01000000 02038001
Feb 25 23:32:19 tonkachi kernel: <37800ointhcd 0000:15.17805480
375d61f_,DI5d00019
Feb 25 23:32:19 tonkachi kernel: 1>d4x2d0i f: c
Feb 25 23:32:19 tonkachi kernel: 370oinhcd 0000:2i
Feb 25 23:32:19 tonkachi kernel: 00f[ 02:00.0: xhci_handle_event -
calling handle_tx_event
Feb 25 23:32:19 tonkachi kernel: 370ohcd 0051078054c0 375b7b30 00000000
01000000 02038001
Feb 25 23:32:20 tonkachi kernel: 37800ohcd 00005.178054d0 _,DI5.d 00009
Feb 25 23:32:20 tonkachi kernel: 1>d8x2d0i f:c
Feb 25 23:32:20 tonkachi kernel: 3780x4en = 0f1uh:5178054e0 375b7b40
00000000 01000000 0203800_,DI5d 00019
Feb 25 23:32:20 tonkachi kernel: 1>d62c0c f: Gc
Feb 25 23:32:20 tonkachi kernel: 37800oinhcd 0000:5.178054f0 375b7b50
00000000 01000000 02038001
Feb 25 23:32:20 tonkachi kernel: 1>d3x2c0c f: c
Feb 25 23:32:20 tonkachi kernel: 37800ohcd 0000:02:00.0: `M5.17805500
_,DIn5d00029
Feb 25 23:32:20 tonkachi kernel: 1>d8x2d0i f:
Feb 25 23:32:20 tonkachi kernel: 3780ohcd 00084nt0'3n 0000:02:00.0:
xhci_handle_event - calling handle_tx_event
Feb 25 23:32:20 tonkachi kernel: 60#hc
Feb 25 23:32:20 tonkachi kernel: : d A)  105.965349] xhci_hcd0cic:
`MEM_WR[c.S1tx00i
Feb 25 23:32:20 tonkachi kernel: 669dh8c001,a0:7 0[MA[  10hh0:
`MEM_WRITE_DWORD(3'b000, 32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:20 tonkachi kernel: [  106.005103] xhci_hcd 0000:02:00.0:
WARN: Stalled endpoint
Feb 25 23:32:22 tonkachi kernel: <7008.h8Dhr:0:0248 ]0 158e 3x)
0nsf:02:00.0: Event ring deq =t867n = 13, sa008hc11Dhr:0:0209 ]0 198pe
00s)n:02:0t97cn = 31, status = 0
Feb 25 23:32:22 tonkachi kernel: 0i4<1= TfC (f>es uhcd 0000:  f86c0, len

= 18, status = 0

with un-plugging, I get:

Feb 25 23:33:07 tonkachi kernel: [  153.205311] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 23:33:08 tonkachi kernel: [  154.008265] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 23:33:08 tonkachi kernel: [  154.008995] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

at this point, rmmod xhci doesn't even work anymore, I get stuff during / around the rmmod like:

Feb 25 23:34:24 tonkachi kernel: [  230.133711] xhci_hcd 0000:02:00.0:
remove, state 1
Feb 25 23:34:24 tonkachi kernel: [  230.133727] usb usb2: USB
disconnect, address 1
Feb 25 23:34:24 tonkachi kernel: [  230.133731] usb 2-4: USB disconnect,
address 2
Feb 25 23:34:24 tonkachi kernel: [  230.133735] usb 2-4.1: USB

disconnect, address 3

at the end, with rmmod still not returning, but doing a re-plug, I get:

Feb 25 23:36:37 tonkachi kernel: [  363.295298] rmmod         D
ffff88002834fa28     0  2818   2802 0x00000004
Feb 25 23:36:37 tonkachi kernel: [  363.295307]  ffff88022f581b88
0000000000000086 0000000000000000 0000000000000282
Feb 25 23:36:37 tonkachi kernel: [  363.295315]  00000000fffffffe
ffffffff81a0bf78 ffff88023fc3c8a0 00000000ffffe4be
Feb 25 23:36:37 tonkachi kernel: [  363.295323]  ffff8802332403c0
ffff88022f581fd8 000000000000fa28 ffff8802332403c0
Feb 25 23:36:37 tonkachi kernel: [  363.295331] Call Trace:
Feb 25 23:36:37 tonkachi kernel: [  363.295344]  [<ffffffff813b3ff5>]
usb_kill_urb+0x85/0xc0
Feb 25 23:36:37 tonkachi kernel: [  363.295353]  [<ffffffff8107d8b0>] ?
autoremove_wake_function+0x0/0x40
Feb 25 23:36:37 tonkachi kernel: [  363.295360]  [<ffffffff813b43c6>] ?
usb_get_urb+0x16/0x20
Feb 25 23:36:37 tonkachi kernel: [  363.295367]  [<ffffffff813b27db>]
usb_hcd_flush_endpoint+0xcb/0x1b0
Feb 25 23:36:37 tonkachi kernel: [  363.295374]  [<ffffffff813b4d18>]
usb_disable_endpoint+0x58/0x90
Feb 25 23:36:37 tonkachi kernel: [  363.295381]  [<ffffffff813b4dd9>]
usb_disable_device+0x89/0x1f0
Feb 25 23:36:37 tonkachi kernel: [  363.295388]  [<ffffffff813adc3d>]
usb_disconnect+0xfd/0x180
Feb 25 23:36:37 tonkachi kernel: [  363.295394]  [<ffffffff813adbff>]
usb_disconnect+0xbf/0x180
Feb 25 23:36:37 tonkachi kernel: [  363.295400]  [<ffffffff813b1a5d>]
usb_remove_hcd+0xcd/0x130
Feb 25 23:36:37 tonkachi kernel: [  363.295408]  [<ffffffff813c2236>]
usb_hcd_pci_remove+0x26/0xa0
Feb 25 23:36:37 tonkachi kernel: [  363.295416]  [<ffffffff812a0fdf>]
pci_device_remove+0x2f/0x60
Feb 25 23:36:37 tonkachi kernel: [  363.295433]  [<ffffffff81334bd3>]
__device_release_driver+0x53/0xb0
Feb 25 23:36:37 tonkachi kernel: [  363.295440]  [<ffffffff81334cf8>]
driver_detach+0xc8/0xd0
Feb 25 23:36:37 tonkachi kernel: [  363.295448]  [<ffffffff81333c65>]
bus_remove_driver+0x85/0xe0
Feb 25 23:36:37 tonkachi kernel: [  363.295456]  [<ffffffff813352ba>]
driver_unregister+0x5a/0x90
Feb 25 23:36:37 tonkachi kernel: [  363.295464]  [<ffffffff812a12d0>]
pci_unregister_driver+0x40/0xb0
Feb 25 23:36:37 tonkachi kernel: [  363.295476]  [<ffffffffa0048b80>]
xhci_unregister_pci+0x10/0x20 [xhci]
Feb 25 23:36:37 tonkachi kernel: [  363.295485]  [<ffffffffa004e459>]
xhci_hcd_cleanup+0x9/0xb [xhci]
Feb 25 23:36:37 tonkachi kernel: [  363.295493]  [<ffffffff81095768>]
sys_delete_module+0x1a8/0x270
Feb 25 23:36:37 tonkachi kernel: [  363.295500]  [<ffffffff81081bd9>] ?
up_read+0x9/0x10
Feb 25 23:36:37 tonkachi kernel: [  363.295510]  [<ffffffff81011f82>]

system_call_fastpath+0x16/0x1b

please let me know what other debugging I should do..

Akos

#11 lore raw
Quoted 72 lines · Ákos Maróy

Sarah,

Quoted 4 lines

True. I can't tell exactly what's going on without CONFIG_USB_XHCI_HCD_DEBUGGING. It's possible the xHCI host never notified the driver of the disconnect, or there's a bug in the xHCI hub emulation code.

after having turned this option on in the kernel, this is what I get when plugging in the device:

Feb 25 23:32:14 tonkachi kernel: [  100.473783] Registered led device:
iwl-phy0::radio
Feb 25 23:32:14 tonkachi kernel: [  100.473812] Registered led device:
iwl-phy0::assoc
Feb 25 23:32:14 tonkachi kernel: [  100.473839] Registered led device:
iwl-phy0::RX
Feb 25 23:32:14 tonkachi kernel: [  100.473864] Registered led device:
iwl-phy0::TX
Feb 25 23:32:14 tonkachi kernel: [  100.497848] usb 2-4: new high speed
USB device using xhci_hcd and address 0
Feb 25 23:32:14 tonkachi kernel: [  100.520591] usb 2-4: New USB device
found, idVendor=058f, idProduct=6254
Feb 25 23:32:14 tonkachi kernel: [  100.520595] usb 2-4: New USB device
strings: Mfr=0, Product=0, SerialNumber=0
Feb 25 23:32:14 tonkachi kernel: [  100.520680] usb 2-4: configuration
#1 chosen from 1 choice
Feb 25 23:32:14 tonkachi kernel: [  100.520732] usb 2-4: ep 0x81 -
rounding interval to 2048 microframes
Feb 25 23:32:14 tonkachi kernel: [  100.522403] hub 2-4:1.0: USB hub found
Feb 25 23:32:14 tonkachi kernel: [  100.522930] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.523156] hub 2-4:1.0: 3 ports
detected
Feb 25 23:32:14 tonkachi kernel: [  100.825758] usb 2-4.1: new high
speed USB device using xhci_hcd and address 0
Feb 25 23:32:14 tonkachi kernel: [  100.848327] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.849375] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.850370] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.851366] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.851782] usb 2-4.1: New USB
device found, idVendor=152d, idProduct=2339
Feb 25 23:32:14 tonkachi kernel: [  100.851785] usb 2-4.1: New USB
device strings: Mfr=1, Product=2, SerialNumber=5
Feb 25 23:32:14 tonkachi kernel: [  100.851790] usb 2-4.1: Product: USB
to ATA/ATAPI Bridge
Feb 25 23:32:14 tonkachi kernel: [  100.851792] usb 2-4.1: Manufacturer:
JMicron
Feb 25 23:32:14 tonkachi kernel: [  100.851795] usb 2-4.1: SerialNumber:
6A1713351FFF
Feb 25 23:32:14 tonkachi kernel: [  100.851873] usb 2-4.1: configuration
#1 chosen from 1 choice
Feb 25 23:32:14 tonkachi kernel: [  100.854283] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.855037] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 25 23:32:14 tonkachi kernel: [  100.879271] Initializing USB Mass
Storage driver...
Feb 25 23:32:14 tonkachi kernel: [  100.879988] scsi6 : SCSI emulation
for USB Mass Storage devices
Feb 25 23:32:14 tonkachi kernel: [  100.880141] usbcore: registered new
interface driver usb-storage
Feb 25 23:32:14 tonkachi kernel: [  100.880147] USB Mass Storage support
registered.
Feb 25 23:32:19 tonkachi kernel: [  105.884853] scsi 6:0:0:0: CD-ROM
        hp       DVDRAM GT20L     DC05 PQ: 0 ANSI: 0
Feb 25 23:32:19 tonkachi kernel: <0: `MEM_WRITE_DWORD(3'b000,

32'hffffc90000hi0 00000.1fevhc anl0d0i 02-:e0x t2);

Quoted 12 lines
Feb 25 23:32:19 tonkachi kernel: x1.0:  _ca0 00000000 01000000 02038000
Feb 25 23:32:19 tonkachi kernel: x1.0: `MEM_W_c70 000000 f__h:had
c2c]:00-:e0x  t3);
Feb 25 23:32:19 tonkachi kernel: _tist us:i 00Tx] 5b78b073ndxh0.0
_c.]70h ]00t0:xhcf3) 754'hf);x.23000:02:00.0: `MEM_WRITE_DWORD(3'b000,
32'hffffc90000c7c024, 32'h8, 4'hf);
Feb 25 23:32:19 tonkachi kernel: 603n00nt 0<05.898876] xhci_hcd
0000:00h00MEM_WRITE_10 wn.8eh:0c>78 0 i_0 013Ue9:020)
Feb 25 23:32:19 tonkachi kernel: 02:00.i0h00.0: New dequeue pointer =
0x375b78d0 (DMA)
Feb 25 23:32:19 tonkachi kernel: 19
Feb 25 23:32:19 tonkachi kernel: 3d07` 300ee e_ i7c67 o5.899445] 9fc

It looks like you're getting log corruption from the xHCI driver being too verbose now. :( I've been meaning to make a log level patch for the driver and cut out the less-than-useful bits for while. Let me do a quick pass at that so we can get the interesting information.

Quoted 8 lines

with un-plugging, I get:

Feb 25 23:33:07 tonkachi kernel: [  153.205311] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 23:33:08 tonkachi kernel: [  154.008265] xhci_hcd 0000:02:00.0:
WARN: transfer error on endpoint
Feb 25 23:33:08 tonkachi kernel: [  154.008995] xhci_hcd 0000:02:00.0:

WARN: transfer error on endpoint

There should be a lot more debugging here. Perhaps you were collecting only the warning-level kernel messages? Did you send the full dmesg from /var/log/kern.log or run dmesg -n 8 before capturing the dmesg input?

Actually, I wonder if 2.6.32 stable needs commit bcef3fd from 2.6.33. If the xHCI driver wasn't cleaning up the endpoint rings properly after a transfer error, I suppose the hardware could get wedged.

Quoted 5 lines

at this point, rmmod xhci doesn't even work anymore, I get stuff during / around the rmmod like:

Feb 25 23:34:24 tonkachi kernel: [  230.133711] xhci_hcd 0000:02:00.0:

remove, state 1

Aw, man, it looks like your xHCI disconnected from the bus. Something was seriously wrong with the hardware. Still, the xHCI driver should have failed gracefully in that case. That should have been handled by commits c526d0d, e34b2fb, and e4ab05d, which are in 2.6.32 and 2.6.33.

Quoted 62 lines
Feb 25 23:34:24 tonkachi kernel: [  230.133727] usb usb2: USB
disconnect, address 1
Feb 25 23:34:24 tonkachi kernel: [  230.133731] usb 2-4: USB disconnect,
address 2
Feb 25 23:34:24 tonkachi kernel: [  230.133735] usb 2-4.1: USB

disconnect, address 3

at the end, with rmmod still not returning, but doing a re-plug, I get:

Feb 25 23:36:37 tonkachi kernel: [  363.295298] rmmod         D
ffff88002834fa28     0  2818   2802 0x00000004
Feb 25 23:36:37 tonkachi kernel: [  363.295307]  ffff88022f581b88
0000000000000086 0000000000000000 0000000000000282
Feb 25 23:36:37 tonkachi kernel: [  363.295315]  00000000fffffffe
ffffffff81a0bf78 ffff88023fc3c8a0 00000000ffffe4be
Feb 25 23:36:37 tonkachi kernel: [  363.295323]  ffff8802332403c0
ffff88022f581fd8 000000000000fa28 ffff8802332403c0
Feb 25 23:36:37 tonkachi kernel: [  363.295331] Call Trace:
Feb 25 23:36:37 tonkachi kernel: [  363.295344]  [<ffffffff813b3ff5>]
usb_kill_urb+0x85/0xc0
Feb 25 23:36:37 tonkachi kernel: [  363.295353]  [<ffffffff8107d8b0>] ?
autoremove_wake_function+0x0/0x40
Feb 25 23:36:37 tonkachi kernel: [  363.295360]  [<ffffffff813b43c6>] ?
usb_get_urb+0x16/0x20
Feb 25 23:36:37 tonkachi kernel: [  363.295367]  [<ffffffff813b27db>]
usb_hcd_flush_endpoint+0xcb/0x1b0
Feb 25 23:36:37 tonkachi kernel: [  363.295374]  [<ffffffff813b4d18>]
usb_disable_endpoint+0x58/0x90
Feb 25 23:36:37 tonkachi kernel: [  363.295381]  [<ffffffff813b4dd9>]
usb_disable_device+0x89/0x1f0
Feb 25 23:36:37 tonkachi kernel: [  363.295388]  [<ffffffff813adc3d>]
usb_disconnect+0xfd/0x180
Feb 25 23:36:37 tonkachi kernel: [  363.295394]  [<ffffffff813adbff>]
usb_disconnect+0xbf/0x180
Feb 25 23:36:37 tonkachi kernel: [  363.295400]  [<ffffffff813b1a5d>]
usb_remove_hcd+0xcd/0x130
Feb 25 23:36:37 tonkachi kernel: [  363.295408]  [<ffffffff813c2236>]
usb_hcd_pci_remove+0x26/0xa0
Feb 25 23:36:37 tonkachi kernel: [  363.295416]  [<ffffffff812a0fdf>]
pci_device_remove+0x2f/0x60
Feb 25 23:36:37 tonkachi kernel: [  363.295433]  [<ffffffff81334bd3>]
__device_release_driver+0x53/0xb0
Feb 25 23:36:37 tonkachi kernel: [  363.295440]  [<ffffffff81334cf8>]
driver_detach+0xc8/0xd0
Feb 25 23:36:37 tonkachi kernel: [  363.295448]  [<ffffffff81333c65>]
bus_remove_driver+0x85/0xe0
Feb 25 23:36:37 tonkachi kernel: [  363.295456]  [<ffffffff813352ba>]
driver_unregister+0x5a/0x90
Feb 25 23:36:37 tonkachi kernel: [  363.295464]  [<ffffffff812a12d0>]
pci_unregister_driver+0x40/0xb0
Feb 25 23:36:37 tonkachi kernel: [  363.295476]  [<ffffffffa0048b80>]
xhci_unregister_pci+0x10/0x20 [xhci]
Feb 25 23:36:37 tonkachi kernel: [  363.295485]  [<ffffffffa004e459>]
xhci_hcd_cleanup+0x9/0xb [xhci]
Feb 25 23:36:37 tonkachi kernel: [  363.295493]  [<ffffffff81095768>]
sys_delete_module+0x1a8/0x270
Feb 25 23:36:37 tonkachi kernel: [  363.295500]  [<ffffffff81081bd9>] ?
up_read+0x9/0x10
Feb 25 23:36:37 tonkachi kernel: [  363.295510]  [<ffffffff81011f82>]
Quoted 1 line

system_call_fastpath+0x16/0x1b

If the hardware wasn't responding properly to commands, then URBs wouldn't have been able to be killed, the USB core would have sat around waiting on those URBs, and rmmod could never exit. I need a more detailed log to figure out exactly why the hardware is wedged though. Let me make the less-verbose debugging patch so you don't get log corruption, and then we'll see what's going on.

Sarah Sharp

#20 lore raw
In reply to Ákos Maróy

Hi Ákos~

Quoted 26 lines · Ákos Maróy

Alan,

Quoted 4 lines

You can get more information if you enable CONFIG_USB_DEBUG in your kernel configuration.  The most likely explanation is that the suspend failed because one of the ports on that root hub issued a wakeup request.

I tried, and this is what I seem to be getting now:

Feb 24 23:28:52 tonkachi kernel: [  348.733460] PM: Syncing filesystems ...
Feb 24 23:28:52 tonkachi kernel: [  348.903106] done.
Feb 24 23:28:52 tonkachi kernel: [  348.903123] Freezing user space
processes ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903808] Freezing remaining
freezable tasks ... (elapsed 0.00 seconds) done.
Feb 24 23:28:52 tonkachi kernel: [  348.903952] Suspending console(s)
(use no_console_suspend to debug)
Feb 24 23:28:52 tonkachi kernel: [  348.985903] xhci_hcd 0000:02:00.0:
WARN: short transfer on control ep
Feb 24 23:28:52 tonkachi kernel: [  348.987274] PM: resume devices took
0.060 seconds
Feb 24 23:28:52 tonkachi kernel: [  348.987371] Restarting tasks ...
Feb 24 23:28:52 tonkachi kernel: [  348.988165] done.
Quoted 8 lines

though I don't see the pm_op() error log anymore..

would this make sense?

actually, the whole USB susbsystem seems to be very fragile - I plug in a USB device, and the whole system freezes for about 5 seconds or more. then the device is registered (for example, a mouse). but I unplug and re-plug, and the device doesn't work anymore...

the whole system freezes for about 5 seconds or more?
I meet a very similar issue before on HP Envy 15 laptop when I plugged usb device on xhci port.
My problem was BIOS still controlled xhci host controller. Maybe you can try this patch.
http://markmail.org/message/vqcbzks4gnbrlir3

Quoted 13 lines

or I plug in an external USB DVD drive - but if I unplug it, it is still listed in lsusb..

Akos

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Signature · 2 lines
Best Regards,
Edward
#12 lore raw
In reply to Sarah Sharp
Quoted 8 lines · Sarah Sharp
Quoted 5 lines

at this point, rmmod xhci doesn't even work anymore, I get stuff during / around the rmmod like:

Feb 25 23:34:24 tonkachi kernel: [  230.133711] xhci_hcd 0000:02:00.0:

remove, state 1

Aw, man, it looks like your xHCI disconnected from the bus. Something was seriously wrong with the hardware.

Why do you say that? Isn't this exactly the sort of thing you expect to see in the log when xhci-hcd is unloaded?

Alan Stern

#13 lore raw
Quoted 5 lines · Alan Stern
Quoted 3 lines · Sarah Sharp
Quoted 3 lines

at this point, rmmod xhci doesn't even work anymore, I get stuff during / around the rmmod like:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Feb 25 23:34:24 tonkachi kernel: [  230.133711] xhci_hcd 0000:02:00.0:

remove, state 1

Aw, man, it looks like your xHCI disconnected from the bus. Something was seriously wrong with the hardware.

Why do you say that? Isn't this exactly the sort of thing you expect to see in the log when xhci-hcd is unloaded?

Yes, I forgot he was unloading the driver. That's normal then.

Sarah Sharp

#14 lore raw
In reply to Sarah Sharp

Sarah,

Quoted 3 lines

Actually, I wonder if 2.6.32 stable needs commit bcef3fd from 2.6.33. If the xHCI driver wasn't cleaning up the endpoint rings properly after a transfer error, I suppose the hardware could get wedged.

I see. where would I get this commit from? I have to stick with 2.6.32, as I'm using the binary ATI video driver, which doesn't work with 2.6.33...

Quoted 6 lines

If the hardware wasn't responding properly to commands, then URBs wouldn't have been able to be killed, the USB core would have sat around waiting on those URBs, and rmmod could never exit. I need a more detailed log to figure out exactly why the hardware is wedged though. Let me make the less-verbose debugging patch so you don't get log corruption, and then we'll see what's going on.

let me know how I can use this..

Akos

#21 lore raw
In reply to Edward Shao

Edward,

Quoted 6 lines

the whole system freezes for about 5 seconds or more?
I meet a very similar issue before on HP Envy 15 laptop when I plugged usb device on xhci port.
My problem was BIOS still controlled xhci host controller. Maybe you can try this patch.
http://markmail.org/message/vqcbzks4gnbrlir3

thanks, indeed, this seems to have solved the freezing issue!

Akos

#15 lore raw
In reply to Ákos Maróy
Quoted 9 lines · Ákos Maróy

Sarah,

Quoted 3 lines

Actually, I wonder if 2.6.32 stable needs commit bcef3fd from 2.6.33. If the xHCI driver wasn't cleaning up the endpoint rings properly after a transfer error, I suppose the hardware could get wedged.

I see. where would I get this commit from? I have to stick with 2.6.32, as I'm using the binary ATI video driver, which doesn't work with 2.6.33...

Quoted 8 lines
Quoted 6 lines

If the hardware wasn't responding properly to commands, then URBs wouldn't have been able to be killed, the USB core would have sat around waiting on those URBs, and rmmod could never exit. I need a more detailed log to figure out exactly why the hardware is wedged though. Let me make the less-verbose debugging patch so you don't get log corruption, and then we'll see what's going on.

let me know how I can use this..

Akos,

I've attached two patches that apply against 2.6.32.9. The first limits the amount of debugging from the xHCI driver to prevent log file corruption. The second is a backport of the commit bcef3fd from Linus' 2.6.33 tree. I think this is the fix you need, but I can't be sure until I see the complete log from the first patch.

Please apply the first patch, recompile with CONFIG_USB_XHCI_HCD_DEBUGGING=y, and send me the results of tail -f /var/log/kern.log | tee /tmp/xhci-hp-envy-15.log. You'll need to load the xHCI driver with the log_level module parameter set to 1095, like so:

sudo insmod drivers/usb/host/xhci.ko log_level=1095

That will limit the debugging to output that relates to errors on transfer events, hardware quirks, commands sent to the hardware, and port status reporting.

When the driver is running, try an unplug of your USB DVD device and an xHCI driver module remove.

Then apply the second patch, recompile, and do the same experiment.

Thanks,
Sarah Sharp

Quoted 1 line

From fa51d5ea582c988f0f8f202749fbc42382b224ba Mon Sep 17 00:00:00 2001

From: Sarah Sharp <[email protected]>
Date: Mon, 1 Mar 2010 16:23:53 -0800
Subject: [PATCH 1/2] xhci: Add logging levels and reduce excessive verbosity.

---
 drivers/usb/host/xhci-dbg.c  |  280 ++++++++++++++++++++++++++++--------------
 drivers/usb/host/xhci-hcd.c  |  263 ++++++++++++++++++++-------------------
 drivers/usb/host/xhci-hub.c  |   21 +++-
 drivers/usb/host/xhci-mem.c  |   87 ++++---------
 drivers/usb/host/xhci-pci.c  |   15 +--
 drivers/usb/host/xhci-ring.c |  213 ++++++++++++++++----------------
 drivers/usb/host/xhci.h      |   31 ++++-
 7 files changed, 500 insertions(+), 410 deletions(-)
drivers/usb/host/xhci-dbg.c +185 -95
index 33128d5..ae71c56 100644
@@ -30,80 +30,106 @@ void xhci_dbg_regs(struct xhci_hcd *xhci)
 {
 	u32 temp;
 
-	xhci_dbg(xhci, "// xHCI capability registers at %p:\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"xHCI capability registers at %p:\n",
 			xhci->cap_regs);
 	temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
-	xhci_dbg(xhci, "// @%p = 0x%x (CAPLENGTH AND HCIVERSION)\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"@%p = 0x%x (CAPLENGTH AND HCIVERSION)\n",
 			&xhci->cap_regs->hc_capbase, temp);
-	xhci_dbg(xhci, "//   CAPLENGTH: 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"   CAPLENGTH: 0x%x\n",
 			(unsigned int) HC_LENGTH(temp));
 #if 0
 	xhci_dbg(xhci, "//   HCIVERSION: 0x%x\n",
 			(unsigned int) HC_VERSION(temp));
 #endif
 
-	xhci_dbg(xhci, "// xHCI operational registers at %p:\n", xhci->op_regs);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+		       "xHCI operational registers at %p:\n", xhci->op_regs);
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off);
-	xhci_dbg(xhci, "// @%p = 0x%x RTSOFF\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+		       "@%p = 0x%x RTSOFF\n",
 			&xhci->cap_regs->run_regs_off,
 			(unsigned int) temp & RTSOFF_MASK);
-	xhci_dbg(xhci, "// xHCI runtime registers at %p:\n", xhci->run_regs);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"xHCI runtime registers at %p:\n", xhci->run_regs);
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->db_off);
-	xhci_dbg(xhci, "// @%p = 0x%x DBOFF\n", &xhci->cap_regs->db_off, temp);
-	xhci_dbg(xhci, "// Doorbell array at %p:\n", xhci->dba);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"@%p = 0x%x DBOFF\n", &xhci->cap_regs->db_off, temp);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"Doorbell array at %p:\n", xhci->dba);
 }
 
 static void xhci_print_cap_regs(struct xhci_hcd *xhci)
 {
 	u32 temp;
 
-	xhci_dbg(xhci, "xHCI capability registers at %p:\n", xhci->cap_regs);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"xHCI capability registers at %p:\n", xhci->cap_regs);
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
-	xhci_dbg(xhci, "CAPLENGTH AND HCIVERSION 0x%x:\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"CAPLENGTH AND HCIVERSION 0x%x:\n",
 			(unsigned int) temp);
-	xhci_dbg(xhci, "CAPLENGTH: 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"CAPLENGTH: 0x%x\n",
 			(unsigned int) HC_LENGTH(temp));
-	xhci_dbg(xhci, "HCIVERSION: 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"HCIVERSION: 0x%x\n",
 			(unsigned int) HC_VERSION(temp));
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params1);
-	xhci_dbg(xhci, "HCSPARAMS 1: 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"HCSPARAMS 1: 0x%x\n",
 			(unsigned int) temp);
-	xhci_dbg(xhci, "  Max device slots: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Max device slots: %u\n",
 			(unsigned int) HCS_MAX_SLOTS(temp));
-	xhci_dbg(xhci, "  Max interrupters: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Max interrupters: %u\n",
 			(unsigned int) HCS_MAX_INTRS(temp));
-	xhci_dbg(xhci, "  Max ports: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Max ports: %u\n",
 			(unsigned int) HCS_MAX_PORTS(temp));
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params2);
-	xhci_dbg(xhci, "HCSPARAMS 2: 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"HCSPARAMS 2: 0x%x\n",
 			(unsigned int) temp);
-	xhci_dbg(xhci, "  Isoc scheduling threshold: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Isoc scheduling threshold: %u\n",
 			(unsigned int) HCS_IST(temp));
-	xhci_dbg(xhci, "  Maximum allowed segments in event ring: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Maximum allowed segments in event ring: %u\n",
 			(unsigned int) HCS_ERST_MAX(temp));
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3);
-	xhci_dbg(xhci, "HCSPARAMS 3 0x%x:\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"HCSPARAMS 3 0x%x:\n",
 			(unsigned int) temp);
-	xhci_dbg(xhci, "  Worst case U1 device exit latency: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Worst case U1 device exit latency: %u\n",
 			(unsigned int) HCS_U1_LATENCY(temp));
-	xhci_dbg(xhci, "  Worst case U2 device exit latency: %u\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Worst case U2 device exit latency: %u\n",
 			(unsigned int) HCS_U2_LATENCY(temp));
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
-	xhci_dbg(xhci, "HCC PARAMS 0x%x:\n", (unsigned int) temp);
-	xhci_dbg(xhci, "  HC generates %s bit addresses\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"HCC PARAMS 0x%x:\n", (unsigned int) temp);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  HC generates %s bit addresses\n",
 			HCC_64BIT_ADDR(temp) ? "64" : "32");
 	/* FIXME */
-	xhci_dbg(xhci, "  FIXME: more HCCPARAMS debugging\n");
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  FIXME: more HCCPARAMS debugging\n");
 
 	temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off);
-	xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
 }
 
 static void xhci_print_command_reg(struct xhci_hcd *xhci)
@@ -111,16 +137,22 @@ static void xhci_print_command_reg(struct xhci_hcd *xhci)
 	u32 temp;
 
 	temp = xhci_readl(xhci, &xhci->op_regs->command);
-	xhci_dbg(xhci, "USBCMD 0x%x:\n", temp);
-	xhci_dbg(xhci, "  HC is %s\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"USBCMD 0x%x:\n", temp);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  HC is %s\n",
 			(temp & CMD_RUN) ? "running" : "being stopped");
-	xhci_dbg(xhci, "  HC has %sfinished hard reset\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  HC has %sfinished hard reset\n",
 			(temp & CMD_RESET) ? "not " : "");
-	xhci_dbg(xhci, "  Event Interrupts %s\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Event Interrupts %s\n",
 			(temp & CMD_EIE) ? "enabled " : "disabled");
-	xhci_dbg(xhci, "  Host System Error Interrupts %s\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Host System Error Interrupts %s\n",
 			(temp & CMD_EIE) ? "enabled " : "disabled");
-	xhci_dbg(xhci, "  HC has %sfinished light reset\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  HC has %sfinished light reset\n",
 			(temp & CMD_LRESET) ? "not " : "");
 }
 
@@ -129,18 +161,23 @@ static void xhci_print_status(struct xhci_hcd *xhci)
 	u32 temp;
 
 	temp = xhci_readl(xhci, &xhci->op_regs->status);
-	xhci_dbg(xhci, "USBSTS 0x%x:\n", temp);
-	xhci_dbg(xhci, "  Event ring is %sempty\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"USBSTS 0x%x:\n", temp);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  Event ring is %sempty\n",
 			(temp & STS_EINT) ? "not " : "");
-	xhci_dbg(xhci, "  %sHost System Error\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %sHost System Error\n",
 			(temp & STS_FATAL) ? "WARNING: " : "No ");
-	xhci_dbg(xhci, "  HC is %s\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  HC is %s\n",
 			(temp & STS_HALT) ? "halted" : "running");
 }
 
 static void xhci_print_op_regs(struct xhci_hcd *xhci)
 {
-	xhci_dbg(xhci, "xHCI operational registers at %p:\n", xhci->op_regs);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"xHCI operational registers at %p:\n", xhci->op_regs);
 	xhci_print_command_reg(xhci);
 	xhci_print_status(xhci);
 }
@@ -161,7 +198,8 @@ static void xhci_print_ports(struct xhci_hcd *xhci)
 	addr = &xhci->op_regs->port_status_base;
 	for (i = 0; i < ports; i++) {
 		for (j = 0; j < NUM_PORT_REGS; ++j) {
-			xhci_dbg(xhci, "%p port %s reg = 0x%x\n",
+			xhci_dbg(xhci, (XHCI_LOG_PORTS | XHCI_LOG_REGS),
+					"%p port %s reg = 0x%x\n",
 					addr, names[j],
 					(unsigned int) xhci_readl(xhci, addr));
 			addr++;
@@ -180,35 +218,42 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int
 	if (temp == XHCI_INIT_VALUE)
 		return;
 
-	xhci_dbg(xhci, "  %p: ir_set[%i]\n", ir_set, set_num);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set[%i]\n", ir_set, set_num);
 
-	xhci_dbg(xhci, "  %p: ir_set.pending = 0x%x\n", addr,
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set.pending = 0x%x\n", addr,
 			(unsigned int)temp);
 
 	addr = &ir_set->irq_control;
 	temp = xhci_readl(xhci, addr);
-	xhci_dbg(xhci, "  %p: ir_set.control = 0x%x\n", addr,
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set.control = 0x%x\n", addr,
 			(unsigned int)temp);
 
 	addr = &ir_set->erst_size;
 	temp = xhci_readl(xhci, addr);
-	xhci_dbg(xhci, "  %p: ir_set.erst_size = 0x%x\n", addr,
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set.erst_size = 0x%x\n", addr,
 			(unsigned int)temp);
 
 	addr = &ir_set->rsvd;
 	temp = xhci_readl(xhci, addr);
 	if (temp != XHCI_INIT_VALUE)
-		xhci_dbg(xhci, "  WARN: %p: ir_set.rsvd = 0x%x\n",
+		xhci_dbg(xhci, XHCI_LOG_REGS,
+				"  WARN: %p: ir_set.rsvd = 0x%x\n",
 				addr, (unsigned int)temp);
 
 	addr = &ir_set->erst_base;
 	temp_64 = xhci_read_64(xhci, addr);
-	xhci_dbg(xhci, "  %p: ir_set.erst_base = @%08llx\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set.erst_base = @%08llx\n",
 			addr, temp_64);
 
 	addr = &ir_set->erst_dequeue;
 	temp_64 = xhci_read_64(xhci, addr);
-	xhci_dbg(xhci, "  %p: ir_set.erst_dequeue = @%08llx\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: ir_set.erst_dequeue = @%08llx\n",
 			addr, temp_64);
 }
 
@@ -217,15 +262,18 @@ void xhci_print_run_regs(struct xhci_hcd *xhci)
 	u32 temp;
 	int i;
 
-	xhci_dbg(xhci, "xHCI runtime registers at %p:\n", xhci->run_regs);
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"xHCI runtime registers at %p:\n", xhci->run_regs);
 	temp = xhci_readl(xhci, &xhci->run_regs->microframe_index);
-	xhci_dbg(xhci, "  %p: Microframe index = 0x%x\n",
+	xhci_dbg(xhci, XHCI_LOG_REGS,
+			"  %p: Microframe index = 0x%x\n",
 			&xhci->run_regs->microframe_index,
 			(unsigned int) temp);
 	for (i = 0; i < 7; ++i) {
 		temp = xhci_readl(xhci, &xhci->run_regs->rsvd[i]);
 		if (temp != XHCI_INIT_VALUE)
-			xhci_dbg(xhci, "  WARN: %p: Rsvd[%i] = 0x%x\n",
+			xhci_dbg(xhci, XHCI_LOG_REGS,
+					"  WARN: %p: Rsvd[%i] = 0x%x\n",
 					&xhci->run_regs->rsvd[i],
 					i, (unsigned int) temp);
 	}
@@ -242,7 +290,8 @@ void xhci_print_trb_offsets(struct xhci_hcd *xhci, union xhci_trb *trb)
 {
 	int i;
 	for (i = 0; i < 4; ++i)
-		xhci_dbg(xhci, "Offset 0x%x = 0x%x\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Offset 0x%x = 0x%x\n",
 				i*4, trb->generic.field[i]);
 }
 
@@ -253,22 +302,30 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
 {
 	u64	address;
 	u32	type = xhci_readl(xhci, &trb->link.control) & TRB_TYPE_BITMASK;
+	unsigned int temp;
 
 	switch (type) {
 	case TRB_TYPE(TRB_LINK):
-		xhci_dbg(xhci, "Link TRB:\n");
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Link TRB:\n");
 		xhci_print_trb_offsets(xhci, trb);
 
 		address = trb->link.segment_ptr;
-		xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address);
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Next ring segment DMA address = 0x%llx\n",
+				address);
 
-		xhci_dbg(xhci, "Interrupter target = 0x%x\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Interrupter target = 0x%x\n",
 				GET_INTR_TARGET(trb->link.intr_target));
-		xhci_dbg(xhci, "Cycle bit = %u\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Cycle bit = %u\n",
 				(unsigned int) (trb->link.control & TRB_CYCLE));
-		xhci_dbg(xhci, "Toggle cycle bit = %u\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Toggle cycle bit = %u\n",
 				(unsigned int) (trb->link.control & LINK_TOGGLE));
-		xhci_dbg(xhci, "No Snoop bit = %u\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"No Snoop bit = %u\n",
 				(unsigned int) (trb->link.control & TRB_NO_SNOOP));
 		break;
 	case TRB_TYPE(TRB_TRANSFER):
@@ -277,17 +334,24 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
 		 * FIXME: look at flags to figure out if it's an address or if
 		 * the data is directly in the buffer field.
 		 */
-		xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address);
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"DMA address or buffer contents= %llu\n",
+				address);
 		break;
 	case TRB_TYPE(TRB_COMPLETION):
 		address = trb->event_cmd.cmd_trb;
-		xhci_dbg(xhci, "Command TRB pointer = %llu\n", address);
-		xhci_dbg(xhci, "Completion status = %u\n",
-				(unsigned int) GET_COMP_CODE(trb->event_cmd.status));
-		xhci_dbg(xhci, "Flags = 0x%x\n", (unsigned int) trb->event_cmd.flags);
+		temp = GET_COMP_CODE(trb->event_cmd.status);
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Command TRB pointer = %llu\n", address);
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Completion status = %u\n", temp);
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Flags = 0x%x\n",
+				(unsigned int) trb->event_cmd.flags);
 		break;
 	default:
-		xhci_dbg(xhci, "Unknown TRB with TRB type ID %u\n",
+		xhci_dbg(xhci, (XHCI_LOG_RINGS | XHCI_LOG_TX_VERBOSE),
+				"Unknown TRB with TRB type ID %u\n",
 				(unsigned int) type>>10);
 		xhci_print_trb_offsets(xhci, trb);
 		break;
@@ -315,7 +379,8 @@ void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
 
 	for (i = 0; i < TRBS_PER_SEGMENT; ++i) {
 		trb = &seg->trbs[i];
-		xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr,
+		xhci_dbg(xhci, XHCI_LOG_RINGS, "@%08x %08x %08x %08x %08x\n",
+				addr,
 				lower_32_bits(trb->link.segment_ptr),
 				upper_32_bits(trb->link.segment_ptr),
 				(unsigned int) trb->link.intr_target,
@@ -326,17 +391,17 @@ void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
 
 void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring)
 {
-	xhci_dbg(xhci, "Ring deq = %p (virt), 0x%llx (dma)\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS, "Ring deq = %p (virt), 0x%llx (dma)\n",
 			ring->dequeue,
 			(unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg,
 							    ring->dequeue));
-	xhci_dbg(xhci, "Ring deq updated %u times\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS, "Ring deq updated %u times\n",
 			ring->deq_updates);
-	xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS, "Ring enq = %p (virt), 0x%llx (dma)\n",
 			ring->enqueue,
 			(unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg,
 							    ring->enqueue));
-	xhci_dbg(xhci, "Ring enq updated %u times\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS, "Ring enq updated %u times\n",
 			ring->enq_updates);
 }
 
@@ -357,7 +422,8 @@ void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring)
 	xhci_debug_segment(xhci, first_seg);
 
 	if (!ring->enq_updates && !ring->deq_updates) {
-		xhci_dbg(xhci, "  Ring has not been updated\n");
+		xhci_dbg(xhci, XHCI_LOG_RINGS,
+				"  Ring has not been updated\n");
 		return;
 	}
 	for (seg = first_seg->next; seg != first_seg; seg = seg->next)
@@ -372,7 +438,8 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
 
 	for (i = 0; i < erst->num_entries; ++i) {
 		entry = &erst->entries[i];
-		xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n",
+		xhci_dbg(xhci, XHCI_LOG_RINGS,
+				"@%08x %08x %08x %08x %08x\n",
 				(unsigned int) addr,
 				lower_32_bits(entry->seg_addr),
 				upper_32_bits(entry->seg_addr),
@@ -387,21 +454,25 @@ void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
 	u64 val;
 
 	val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
-	xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS,
+			"xHC command ring deq ptr low bits + flags = @%08x\n",
 			lower_32_bits(val));
-	xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n",
+	xhci_dbg(xhci, XHCI_LOG_RINGS,
+			"xHC command ring deq ptr high bits = @%08x\n",
 			upper_32_bits(val));
 }
 
 /* Print the last 32 bytes for 64-byte contexts */
-static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma)
+static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma,
+		int log_level)
 {
 	int i;
 	for (i = 0; i < 4; ++i) {
-		xhci_dbg(xhci, "@%p (virt) @%08llx "
-			 "(dma) %#08llx - rsvd64[%d]\n",
-			 &ctx[4 + i], (unsigned long long)dma,
-			 ctx[4 + i], i);
+		xhci_dbg(xhci, log_level,
+				"@%p (virt) @%08llx "
+				"(dma) %#08llx - rsvd64[%d]\n",
+				&ctx[4 + i], (unsigned long long)dma,
+				ctx[4 + i], i);
 		dma += 8;
 	}
 }
@@ -417,32 +488,37 @@ void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx)
 		((unsigned long)slot_ctx - (unsigned long)ctx->bytes);
 	int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
 
-	xhci_dbg(xhci, "Slot Context:\n");
-	xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n",
+	xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE, "Slot Context:\n");
+	xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+			"@%p (virt) @%08llx (dma) %#08x - dev_info\n",
 			&slot_ctx->dev_info,
 			(unsigned long long)dma, slot_ctx->dev_info);
 	dma += field_size;
-	xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
+	xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+			"@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
 			&slot_ctx->dev_info2,
 			(unsigned long long)dma, slot_ctx->dev_info2);
 	dma += field_size;
-	xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n",
+	xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+			"@%p (virt) @%08llx (dma) %#08x - tt_info\n",
 			&slot_ctx->tt_info,
 			(unsigned long long)dma, slot_ctx->tt_info);
 	dma += field_size;
-	xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n",
+	xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+			"@%p (virt) @%08llx (dma) %#08x - dev_state\n",
 			&slot_ctx->dev_state,
 			(unsigned long long)dma, slot_ctx->dev_state);
 	dma += field_size;
 	for (i = 0; i < 4; ++i) {
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
 				&slot_ctx->reserved[i], (unsigned long long)dma,
 				slot_ctx->reserved[i], i);
 		dma += field_size;
 	}
 
 	if (csz)
-		dbg_rsvd64(xhci, (u64 *)slot_ctx, dma);
+		dbg_rsvd64(xhci, (u64 *)slot_ctx, dma, XHCI_LOG_DEVICE_STATE);
 }
 
 void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
@@ -462,25 +538,32 @@ void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
 		dma_addr_t dma = ctx->dma +
 			((unsigned long)ep_ctx - (unsigned long)ctx->bytes);
 
-		xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"Endpoint %02d Context:\n", i);
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"@%p (virt) @%08llx (dma) %#08x - ep_info\n",
 				&ep_ctx->ep_info,
 				(unsigned long long)dma, ep_ctx->ep_info);
 		dma += field_size;
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
 				&ep_ctx->ep_info2,
 				(unsigned long long)dma, ep_ctx->ep_info2);
 		dma += field_size;
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08llx - deq\n",
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"@%p (virt) @%08llx (dma) %#08llx - deq\n",
 				&ep_ctx->deq,
 				(unsigned long long)dma, ep_ctx->deq);
 		dma += 2*field_size;
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n",
+		xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+				"@%p (virt) @%08llx (dma) %#08x - tx_info\n",
 				&ep_ctx->tx_info,
 				(unsigned long long)dma, ep_ctx->tx_info);
 		dma += field_size;
 		for (j = 0; j < 3; ++j) {
-			xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
+			xhci_dbg(xhci, XHCI_LOG_DEVICE_STATE,
+					"@%p (virt) @%08llx (dma) %#08x "
+					"- rsvd[%d]\n",
 					&ep_ctx->reserved[j],
 					(unsigned long long)dma,
 					ep_ctx->reserved[j], j);
@@ -488,7 +571,8 @@ void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
 		}
 
 		if (csz)
-			dbg_rsvd64(xhci, (u64 *)ep_ctx, dma);
+			dbg_rsvd64(xhci, (u64 *)ep_ctx, dma,
+					XHCI_LOG_DEVICE_STATE);
 	}
 }
 
@@ -506,23 +590,29 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci,
 	if (ctx->type == XHCI_CTX_TYPE_INPUT) {
 		struct xhci_input_control_ctx *ctrl_ctx =
 			xhci_get_input_control_ctx(xhci, ctx);
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
+		xhci_dbg(xhci, XHCI_LOG_COMMANDS_VERBOSE,
+				"@%p (virt) @%08llx (dma) %#08x - drop flags\n",
 			 &ctrl_ctx->drop_flags, (unsigned long long)dma,
 			 ctrl_ctx->drop_flags);
 		dma += field_size;
-		xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
+		xhci_dbg(xhci, XHCI_LOG_COMMANDS_VERBOSE,
+				"@%p (virt) @%08llx (dma) %#08x - add flags\n",
 			 &ctrl_ctx->add_flags, (unsigned long long)dma,
 			 ctrl_ctx->add_flags);
 		dma += field_size;
 		for (i = 0; i < 6; ++i) {
-			xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd2[%d]\n",
-				 &ctrl_ctx->rsvd2[i], (unsigned long long)dma,
-				 ctrl_ctx->rsvd2[i], i);
+			xhci_dbg(xhci, XHCI_LOG_COMMANDS_VERBOSE,
+					"@%p (virt) @%08llx (dma) %#08x"
+					" - rsvd2[%d]\n",
+					&ctrl_ctx->rsvd2[i],
+					(unsigned long long)dma,
+					ctrl_ctx->rsvd2[i], i);
 			dma += field_size;
 		}
 
 		if (csz)
-			dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
+			dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma,
+					XHCI_LOG_COMMANDS_VERBOSE);
 	}
 
 	slot_ctx = xhci_get_slot_ctx(xhci, ctx);
drivers/usb/host/xhci-hcd.c +136 -127

691 lines not on this page · raw message

drivers/usb/host/xhci-hub.c +15 -6
index eac5b53..de9ed07 100644
@@ -158,7 +158,6 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 		status = 0;
 		addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS*(wIndex & 0xff);
 		temp = xhci_readl(xhci, addr);
-		xhci_dbg(xhci, "get port status, actual port %d status  = 0x%x\n", wIndex, temp);
 
 		/* wPortChange bits */
 		if (temp & PORT_CSC)
@@ -183,7 +182,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			status |= 1 << USB_PORT_FEAT_RESET;
 		if (temp & PORT_POWER)
 			status |= 1 << USB_PORT_FEAT_POWER;
-		xhci_dbg(xhci, "Get port status returned 0x%x\n", status);
+		xhci_dbg(xhci, XHCI_LOG_PORTS,
+				"Get port %d status, actual status  = 0x%x, "
+				"returned status = 0x%x\n",
+				wIndex, temp, status);
 		put_unaligned(cpu_to_le32(status), (__le32 *) buf);
 		break;
 	case SetPortFeature:
@@ -205,14 +207,19 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			xhci_writel(xhci, temp | PORT_POWER, addr);
 
 			temp = xhci_readl(xhci, addr);
-			xhci_dbg(xhci, "set port power, actual port %d status  = 0x%x\n", wIndex, temp);
+			xhci_dbg(xhci, XHCI_LOG_PORTS,
+					"Set port %d power, "
+					"actual status  = 0x%x\n",
+					wIndex, temp);
 			break;
 		case USB_PORT_FEAT_RESET:
 			temp = (temp | PORT_RESET);
 			xhci_writel(xhci, temp, addr);
 
 			temp = xhci_readl(xhci, addr);
-			xhci_dbg(xhci, "set port reset, actual port %d status  = 0x%x\n", wIndex, temp);
+			xhci_dbg(xhci, XHCI_LOG_PORTS, "Set port %d reset, "
+					"actual status  = 0x%x\n",
+					wIndex, temp);
 			break;
 		default:
 			goto error;
@@ -246,8 +253,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 		/* Change bits are all write 1 to clear */
 		xhci_writel(xhci, temp | status, addr);
 		temp = xhci_readl(xhci, addr);
-		xhci_dbg(xhci, "clear port %s change, actual port %d status  = 0x%x\n",
-				port_change_bit, wIndex, temp);
+		xhci_dbg(xhci, XHCI_LOG_PORTS,
+				"Clear port %d %s change,"
+				" actual status  = 0x%x\n",
+				wIndex, port_change_bit, temp);
 		temp = xhci_readl(xhci, addr); /* unblock any posted writes */
 		break;
 	default:
drivers/usb/host/xhci-mem.c +25 -62

298 lines not on this page · raw message

drivers/usb/host/xhci-pci.c +7 -8
index 06595ec..0610bc7 100644
@@ -41,9 +41,9 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
 
 	/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
 	if (!pci_set_mwi(pdev))
-		xhci_dbg(xhci, "MWI active\n");
+		xhci_dbg(xhci, XHCI_LOG_INIT, "MWI active\n");
 
-	xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
+	xhci_dbg(xhci, XHCI_LOG_INIT, "Finished xhci_pci_reinit\n");
 	return 0;
 }
 
@@ -73,7 +73,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
 			pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
 			pdev->revision == 0x0) {
 			xhci->quirks |= XHCI_RESET_EP_QUIRK;
-			xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
+			xhci_dbg(xhci, XHCI_LOG_QUIRKS,
+					"QUIRK: Fresco Logic xHC needs config"
 					" endpoint cmd after reset endpoint\n");
 	}
 
@@ -82,22 +83,20 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
 	if (retval)
 		return retval;
 
-	xhci_dbg(xhci, "Resetting HCD\n");
+	xhci_dbg(xhci, XHCI_LOG_INIT, "Resetting HCD\n");
 	/* Reset the internal HC memory state and registers. */
 	retval = xhci_reset(xhci);
 	if (retval)
 		return retval;
-	xhci_dbg(xhci, "Reset complete\n");
 
-	xhci_dbg(xhci, "Calling HCD init\n");
 	/* Initialize HCD and host controller data structures. */
 	retval = xhci_init(hcd);
 	if (retval)
 		return retval;
-	xhci_dbg(xhci, "Called HCD init\n");
 
 	pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn);
-	xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn);
+	xhci_dbg(xhci, XHCI_LOG_INIT, "Got SBRN %u\n",
+			(unsigned int) xhci->sbrn);
 
 	/* Find any debug ports */
 	return xhci_pci_reinit(xhci, pdev);
drivers/usb/host/xhci-ring.c +105 -108

540 lines not on this page · raw message

drivers/usb/host/xhci.h +27 -4
index 4b254b6..473e485 100644
@@ -1090,6 +1090,19 @@ struct xhci_hcd {
 	unsigned int		quirks;
 #define	XHCI_LINK_TRB_QUIRK	(1 << 0)
 #define XHCI_RESET_EP_QUIRK	(1 << 1)
+	unsigned int		log_level;
+#define XHCI_LOG_QUIRKS			(1 << 0)
+#define XHCI_LOG_COMMANDS		(1 << 1)
+#define XHCI_LOG_COMMANDS_VERBOSE	(1 << 2)
+#define XHCI_LOG_INIT			(1 << 3)
+#define XHCI_LOG_EVENTS			(1 << 4)
+#define XHCI_LOG_DEVICE_STATE		(1 << 5)
+#define XHCI_LOG_TX			(1 << 6)
+#define XHCI_LOG_TX_VERBOSE		(1 << 7)
+#define XHCI_LOG_NOOPS			(1 << 8)
+#define XHCI_LOG_RINGS			(1 << 9)
+#define XHCI_LOG_PORTS			(1 << 10)
+#define XHCI_LOG_REGS			(1 << 11)
 };
 
 /* For testing purposes */
@@ -1112,8 +1125,18 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
 #define XHCI_DEBUG	0
 #endif
 
-#define xhci_dbg(xhci, fmt, args...) \
-	do { if (XHCI_DEBUG) dev_dbg(xhci_to_hcd(xhci)->self.controller , fmt , ## args); } while (0)
+#if XHCI_DEBUG
+#define xhci_dbg(xhci, lvl, fmt, args...)			\
+do {								\
+	if (lvl & xhci->log_level)			\
+		dev_dbg(xhci_to_hcd(xhci)->self.controller ,	\
+				fmt , ## args);			\
+} while (0)
+#else
+#define xhci_dbg(xhci, lvl, fmt, args...)			\
+do {} while (0)
+#endif
+
 #define xhci_info(xhci, fmt, args...) \
 	do { if (XHCI_DEBUG) dev_info(xhci_to_hcd(xhci)->self.controller , fmt , ## args); } while (0)
 #define xhci_err(xhci, fmt, args...) \
@@ -1131,7 +1154,7 @@ static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
 static inline void xhci_writel(struct xhci_hcd *xhci,
 		const unsigned int val, __u32 __iomem *regs)
 {
-	xhci_dbg(xhci,
+	xhci_dbg(xhci, XHCI_LOG_REGS,
 			"`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n",
 			regs, val);
 	writel(val, regs);
@@ -1161,7 +1184,7 @@ static inline void xhci_write_64(struct xhci_hcd *xhci,
 	u32 val_lo = lower_32_bits(val);
 	u32 val_hi = upper_32_bits(val);
 
-	xhci_dbg(xhci,
+	xhci_dbg(xhci, XHCI_LOG_REGS,
 			"`MEM_WRITE_DWORD(3'b000, 64'h%p, 64'h%0lx, 4'hf);\n",
 			regs, (long unsigned int) val);
 	writel(val_lo, ptr);
Signature · 1 line
1.6.3.3
Quoted 1 line

From 1bd817eafb9411f0da8ae97f8e2590864e90bcef Mon Sep 17 00:00:00 2001

From: Sarah Sharp <[email protected]>
Date: Wed, 11 Nov 2009 10:28:44 -0800
Subject: [PATCH 2/2] USB: xhci: Handle errors that cause endpoint halts.

The xHCI 0.95 and 0.96 specification defines several transfer buffer request completion codes that indicate a USB transaction error occurred. When a stall, babble, transaction, or split transaction error completion code is set, the xHCI has halted that endpoint ring. Software must issue a Reset Endpoint command and a Set Transfer Ring Dequeue Pointer command to clean up the halted ring.

The USB device driver is supposed to call into usb_reset_endpoint() when an endpoint stalls. That calls into the xHCI driver to issue the proper commands. However, drivers don't call that function for the other errors that cause the xHC to halt the endpoint ring. If a babble, transaction, or split transaction error occurs, check if the endpoint context reports a halted condition, and clean up the endpoint ring if it does.

---
 drivers/usb/host/xhci-ring.c |   79 ++++++++++++++++++++++++++++++++----------
 1 files changed, 60 insertions(+), 19 deletions(-)
drivers/usb/host/xhci-ring.c +60 -19

112 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#19 lore raw
In reply to Alan Stern

Alan,

Quoted 6 lines · earlier I
Quoted 4 lines

By the way, I noticed above that you have xhci-hcd installed. As far as I know, that driver does not yet support system suspend. You should try unloading xhci-hcd before doing the suspend (both with and without CONFIG_USB_DEBUG).

wow, rmmod xhci - and the suspend goes through fine!

now, I re-installed the system, and suspend doesn't work anymore.

if I have the xhci module loaded, it fails and returns to the screen right away.

if I unload the xhci module, I get to the character console, and then the machine hangs there - nothing happens anymore. only a power cycle helps.

I don't know what was different when at least suspend worked :(

I'll try to do some more debugging..

Akos