Release Notes for Ubuntu

XHCI (USB 3.0) kernel Module Prevents Suspend

Reported by Bryn Hughes on 2010-02-17
508
This bug affects 98 people
Affects Status Importance Assigned to Milestone
Linux
Invalid
Undecided
Unassigned
OEM Priority Project
Medium
Chris Van Hoof
Release Notes for Ubuntu
Medium
Unassigned
linux (Ubuntu)
Medium
Unassigned
Lucid
Undecided
Unassigned
Maverick
Medium
Unassigned
Natty
Medium
Unassigned

Bug Description

When the XHCI module is loaded the system cannot suspend.

Manually unloading XHCI will allow suspend to complete normally.

If SUSPEND_MODULES="xhci" is added to /etc/pm/config.d/unload_module then the system can suspend normally.

ProblemType: Bug
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: bhughes 1918 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf2620000 irq 17'
   Mixer name : 'Conexant ID 5069'
   Components : 'HDA:14f15069,17aa218b,00100301'
   Controls : 6
   Simple ctrls : 4
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xcdefc000 irq 16'
   Mixer name : 'Nvidia ID a'
   Components : 'HDA:10de000a,10de0101,00100100'
   Controls : 0
   Simple ctrls : 0
Card1.Amixer.values:

Date: Tue Feb 16 19:29:01 2010
DistroRelease: Ubuntu 10.04
HibernationDevice: RESUME=UUID=3174c6eb-62e1-4894-9adb-d4ad608f4790
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100215)
MachineType: LENOVO 4318CTO
NonfreeKernelModules: nvidia
Package: linux-source (not installed)
ProcCmdLine: BOOT_IMAGE=/vmlinuz-2.6.32-13-generic root=/dev/mapper/systest-root ro quiet splash
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_CA.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-13.18-generic
Regression: No
RelatedPackageVersions: linux-firmware 1.29
Reproducible: Yes
SourcePackage: linux-meta
TestedUpstream: Yes
Uname: Linux 2.6.32-13-generic x86_64
dmi.bios.date: 01/20/2010
dmi.bios.vendor: LENOVO
dmi.bios.version: 6NET46WW (1.09 )
dmi.board.name: 4318CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6NET46WW(1.09):bd01/20/2010:svnLENOVO:pn4318CTO:pvrThinkPadW510:rvnLENOVO:rn4318CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 4318CTO
dmi.product.version: ThinkPad W510
dmi.sys.vendor: LENOVO

Bryn Hughes (linux-nashira) wrote :
Dmitry Pankratov (dremon) wrote :

I have the same issue on Gigabyte P55A-UD4 running Ubuntu 9.10 64-bit, kernel 2.6.31-20-generic.

tags: added: suspend
Andy Whitcroft (apw) wrote :

[This is an automated message. Apologies if it has reached you inappropriately.]

This bug was reported against the linux-meta package when it likely should have been reported against the linux package instead. We are automatically transitioning this to the linux kernel package so that the appropriate teams are notified and made aware of this issue.

If this bug really is a bug in the linux-meta package you can move it back to linux-meta and tag it kj-linux-meta, or contact us on the #ubuntu-kernel channel on the FreeNode IRC server. Thanks.

affects: linux-meta (Ubuntu) → linux (Ubuntu)
Manoj Iyer (manjo) wrote :

Also, can you please retry suspend/resume after you update your kernel to the latest version in the archive ?

Changed in linux (Ubuntu):
status: New → Incomplete
Bryn Hughes (linux-nashira) wrote :

Confirmed that this still occurs with the latest kernel package (as of 2010-03-16)

Looking through the kernel source it appears that there are no hooks even implemented for suspend/resume in the XHCI module.

Martin Spacek (mspacek) on 2010-03-21
Changed in linux (Ubuntu):
status: Incomplete → New
Martin Spacek (mspacek) wrote :

Following the advice of http://www.thinkwiki.org/wiki/Category:W510, I unloaded the xhci module by adding the line:

SUSPEND_MODULES="xhci"

to the file /etc/pm/config.d/unload_modules. That file didn't exist, so I had to create it. Now I can suspend and hibernate fine, although only once. After that, I'm hit by bug #532374.

Strangely enough, even with xhci unloaded, I can still plug an external mouse into either of the two blue USB 3.0 SuperSpeed ports on the left side of the machine, and the mouse works. Haven't tried suspending with the mouse plugged in though.. I guess it works because those ports run in USB 2.0 mode when a USB 2.0 device is plugged in?

ehwelbon (welbon) wrote :

This bug is affecting me with the following PCIe card:
BYTECC Part No. BT-PEU310
09:00.0 USB Controller: NEC Corporation Device 0194 (rev 03)

Get a similar error:

Apr 10 17:00:49 elviscera kernel: [ 574.350075] Suspending console(s) (use no_console_suspend to debug)
Apr 10 17:00:49 elviscera kernel: [ 574.401220] pm_op(): usb_dev_freeze+0x0/0x10 returns -2
Apr 10 17:00:49 elviscera kernel: [ 574.401223] PM: Device usb9 failed to freeze: error -2

$ uname -a
Linux elviscera 2.6.31-20-server #58-Ubuntu SMP Fri Mar 12 05:40:05 UTC 2010 x86_64 GNU/Linux

Jerone Young (jerone) on 2010-04-11
summary: - XHCI (USB 3.0) Module Prevents Suspend
+ XHCI (USB 3.0) kernel Module Prevents Suspend
Pablo Vanwoerkom (guikubivan) wrote :

Martin, I added SUSPEND_MODULES="xhci" to /etc/pm/config.d/00sleep_module (create the file if it doesn't exist), have you tried that?

Dushyant Shringi (dsshringi) wrote :

System config: i7-930, Gigabyte x58a-ud7, Ubuntu Lucid Lynx 10.04 RC

USB 3.0 controller on ga-x58a-ud7 motherboard

create files : /etc/pm/config.d/00sleep_module and /etc/pm/config.d/unload_module
add line to files : SUSPEND_MODULES="xhci" fixed my not hibernating problem. Thank you

Bryn Hughes (linux-nashira) wrote :

Hi everyone,

Please mark this bug as affecting you rather than commenting about the workaround - we know that manually unloading the module or adding SUSPEND_MODULES="xhci" fixes the problem, but this is not the correct solution. The XHCI driver either needs to have suspend implemented, or Ubuntu's suspend scripts need to handle this for us automatically in some manner.

There are potential problems to having this module unloaded in this manner - for instance if you are using a USB 3.0 hard disk you wouldn't want to unload the module manually while you had a filesystem mounted with open files!

Bryn Hughes (linux-nashira) wrote :

Note that the module has been renamed "xhci_hcd" in the latest mainline kernel (2.6.34-rc6).

please also have a look at the duplicate bug: The workaround

echo disable > /sys/bus/usb/devices/usb*/power/wakeup

also fixes the problem. Maybe this is a hint?

Jerone Young (jerone) on 2010-05-17
tags: added: lenovo
Changed in oem-priority:
assignee: nobody → Canonical Platform QA Team (canonical-platform-qa)
importance: Undecided → Medium
Changed in oem-priority:
assignee: Canonical Platform QA Team (canonical-platform-qa) → Canonical Kernel Team (canonical-kernel-team)
Changed in linux (Ubuntu):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Lukas Svoboda (svoboda77) wrote :

echo disabled > /sys/bus/usb/devices/usb1/power/wakeup

solves the problem on Lenovo 3000 V100 laptop. The problematic device is the integrated camera:

Bus 001 Device 002: ID 0402:5602 ALi Corp. Video Camera Controller

Jerone Young (jerone) wrote :

@Lukas
             When you do this does the camera usable after suspsend ? I suspect it will not be.

TheDreamer (thedreamer-lhaven) wrote :

I have a Lenovo 3000 V200 laptop, and I used:

echo disabled > /sys/bus/usb/devices/usb2/power/wakeup

Bryn Hughes (linux-nashira) wrote :

@TheDreamer - with this method do your USB 3.x ports work after resume?

TheDreamer (thedreamer-lhaven) wrote :

Wasn't aware that I had USB 3.x ports, I don't any have USB 3.x devices....also I don't think I've ever used the USB ports on the laptop (except to charge my phone when I'm traveling).

Well, I actually, I guess I have used the USB ports....but only so that I could disable the beeper on some UPSs from a Windows VM in VirtualBox and the initial configuration of an Airport Extreme....but that was pre-Lucid.

mpgarate (mpgarate) wrote :

I have the w510 and none of these workarounds worked for me.

mpgarate (mpgarate) wrote :

I did a fresh install, and then this worked.

Stefan Bader (smb) wrote :

As mentioned in comment #5, the driver code explicitly states that suspend/resume will be implemented later (whenever that will be, has not changed as of today), so the work-around is the way to go until then. Depending on the impact of changes if this happens, this might or might not be applicable for SRU in Lucid, but this needs to be decided then.

And yes, blacklisting the xhci module completely will drive the ports in USB2.0 mode. So if there are no USB3.0 devices, this could be done as well.

Stefan Bader (smb) wrote :

I set this to triaged and leave the Lucid nomination open for now. This falls in the category of "we cannot fix this" as upstream did not implement it. Maybe there is some development there in the Maverick cycle or not. But that is totally open.

Changed in linux (Ubuntu):
assignee: Canonical Kernel Team (canonical-kernel-team) → nobody
importance: Undecided → Medium
status: New → Triaged
Manoj Iyer (manjo) on 2010-05-26
tags: added: kernel-reviewed
Bryn Hughes (linux-nashira) wrote :

Agreed, this is probably not fixable in terms of total functionality under Lucid (and possibly not even under Maverick), however there needs to be some sort of workaround in place especially as this is an LTS release. Within 6 months USB 3.0 ports will start to become standard across the board.

In my humble opinion, blacklisting XHCI is a totally workable solution given that the ports will continue to operate as USB 2.0 ports. There are precious few USB 3.0 devices available yet, and those devices will work fine as USB 2.0 devices if that's all the system is supporting. The most important questions in my mind would be:

- Will the system suspend/resume?
- Do the USB ports work when devices are plugged in to them?

Those two issues are far more important than "Do the ports work at full USB 3.0 speeds even though there are no current devices that can make use of that capacity?"

Martin Spacek (mspacek) wrote :

I just noticed the following firmware update for the NEC USB 3.0 controller for the Thinkpad W510 at http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-75165

Version 3.0.2.5

    * (New) Initial release
    * (New) Mass Storage Class UAS (USB Attached SCSI) is supported.
    * (Fix) Added the workaround of xHCI Driver Unload Problem.

I don't know what exactly this workaround refers to, but it sounds a lot like this bug. The release date is 2010/05/17.I believe my original firmware version was 3.0.2.1. I haven't yet tested this in Ubuntu, since I'm mostly running in Win7 for now. I suppose that to properly test this, I'll have to remove the

SUSPEND_MODULES="xhci"

line from the file

/etc/pm/config.d/unload_modules.

Martin Spacek (mspacek) wrote :

I just gave it a try. Unsurprisingly, this firmware update hasn't resolved this issue.

Tony Espy (awe) on 2010-06-21
Changed in oem-priority:
status: New → Triaged
Alex Gontmakher (gsasha-gmail) wrote :

I have the same issue on Dell Latitude Z600 - at least, I see dmsg lines that hint of the same problem. However, the workarounds listed above do not make my laptop suspend.

Jerone Young (jerone) wrote :

To help someone working on this on the community side. If you look in drivers/usb/host/xhci-pci.c you will find comments " suspend and resume implemented later" in structs hc_driver xhci_pci_hc_driver & xhci_pci_driver where there should be function pointers to functions so that it can suspend.

This is still an issue in 2.6.35 source. This patch though does seem to resolve the issue as it impliments the suspend functions. Though not sure how functional:

http://kerneltrap.org/mailarchive/linux-usb/2010/5/13/6260980

Jeremy Kerr (jk-ozlabs) wrote :

Jerone - the linked patch is version 4; there is a v5 of that series on linux-usb at the moment (http://www.spinics.net/lists/linux-usb/msg33949.html, we'll probably need the rest of that series too). It looks like there are still a few issues to be sorted out before this series will be merged.

Is the SUSPEND_MODULES workaround suitable?

Jerone Young (jerone) wrote :

@Jeremy

       Unfortunetly it's not. The reason is we have seen that unloading the module can have bad effects at times when doing multiple suspends. The safest way is to have the suspend code in the driver.

       Do you know if upstream is looking for testing to help move inclusion along?

Jeremy Kerr (jk-ozlabs) wrote :

The next version of the patchset (v6) has been posted: http://article.gmane.org/gmane.linux.usb.general/35579.

Jerone: I'm sure that upstream will welcome extra testing, but there has not been any requests for such. No news on any progress in inclusion into mainline, unfortunately.

creeson (encomium2001) wrote :

I was getting the messages:
pm_op(): usb_dev_freeze+0x0/0x20 returns -2
PM: Device usb9 failed to freeze async: error -2

This is an usb 3.0 port on a new computer with Ubuntu 10.10

The proposed workaround:
create files : /etc/pm/config.d/00sleep_module and /etc/pm/config.d/unload_module
add line to files : SUSPEND_MODULES="xhci"

did not work for me.

This post caught my eye:
d3mia7 wrote on 2010-05-05: #11
Note that the module has been renamed "xhci_hcd" in the latest mainline kernel (2.6.34-rc6).

There is a typo in this post. The module has been renamed to "xhci-hcd", not "xhci_hcd".

This workaround fixes the problem for me:
create files : /etc/pm/config.d/00sleep_module and /etc/pm/config.d/unload_module
add line to files : SUSPEND_MODULES="xhci-hcd"

Robbie Williamson (robbiew) wrote :

Marking this for the 10.10 release notes, seeing how it's unlikely to be fixed by the release date.

Changed in linux:
status: New → Invalid
Changed in ubuntu-release-notes:
importance: Undecided → Medium
Tadeo.Balderrama (alexdiaz1) wrote :

Sorry if this has already been addressed:
Running 10.04 on Lenovo 3000 V100, machine was going into suspend without issues until I upgraded the kernel to 2.6.32-25-generic a couple of days ago. I tried the solution on post #13 but it gives me:

bash: /sys/bus/usb/devices/usb1/power/wakeup: Permission denied

even when running it under sudo

Robbie Williamson (robbiew) wrote :

Release noting for 10.10:

When the XHCI module is loaded for USB 3.0 operation the system cannot suspend. Manually unloading XHCI will allow suspend to complete normally. To avoid future suspend problems, the workaround is to add:
 SUSPEND_MODULES="xhci"
to /etc/pm/config.d/unload_module then the system can suspend normally.

Changed in ubuntu-release-notes:
status: New → Fix Released
Martin Spacek (mspacek) wrote :

@Robbie: Apparently, the module has been renamed "xhci_hcd". Perhaps that should be indicated in the release notes?

Changed in ubuntu-release-notes:
status: Fix Released → Confirmed
Jeff Burns (admiraljkb) wrote :

@Robbie and @Martin,

Since running out of time before Maverick releases, I updated the Release Notes. :) Please see the following and review for accuracy:
https://wiki.ubuntu.com/MaverickMeerkat/ReleaseNotes#Boot,%20installation,%20upgrade%20and%20post-install

cheers
Jeff Burns

Martin Spacek (mspacek) on 2010-10-09
Changed in ubuntu-release-notes:
status: Confirmed → Fix Released
Jeff Burns (admiraljkb) wrote :

I should've added to my previous post - the workaround for Maverick did work on my Thinkpad W510.
(adding SUSPEND_MODULES="xhci-hcd" to /etc/pm/config.d/unload_module)

Vin Shankar (v-shankar) wrote :

Bug confirmed still present in Maverick release (not that we were expecting anything different - wouldn't have been feasible).
For me, the offending device is an UPEK fingerprint reader. Workaround works as expected.

Jeremy Kerr (jk-ozlabs) wrote :

OK, looks like we've got the XHCI power management patches upstream in 2.6.37-rc1:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5cc103506289de7ee0a0b526ae0381541990cad4

Unfortunately, it looks like there's be quite a few xhci updates to backport if we were looking to add USB 3 suspend/resume to Maverick. These are the xhci-specific changes between maverick and current upstream head:

436a389 usb: Fix linker errors with CONFIG_PM=n
b5b5c3a USB: xhci: Fix compile error when CONFIG_PM=n
5535b1d USB: xHCI: PCI power management implementation
9777e3c USB: xHCI: bus power management implementation
5619253 USB: xHCI: port remote wakeup implementation
be88fe4 USB: xHCI: port power management implementation
c8d4af8 USB: core: use kernel assigned address for devices under xHCI
f0615c4 USB: xHCI: change xhci_reset_device() to allocate new device
6492773 USB: xHCI: Add pointer to udev in struct xhci_virt_device
14184f9 USB: xHCI: update ring dequeue pointer when process missed tds
a1669b2 USB: xhci: Remove buggy assignment in next_trb()
006d582 USB: xhci: Set DMA mask for host.
ed3f245 USB: xhci: Don't flush doorbell writes.
c21599a USB: xhci: Reduce reads and writes of interrupter registers.
257d585 USB: xhci: Make xhci_set_hc_event_deq() static.
c06d68b USB: xhci: Minimize HW event ring dequeue pointer writes.
d6d98a4 USB: xhci: Make xhci_handle_event() static.
27e0dd4 USB: xhci: Remove unnecessary reads of IRQ_PENDING register.
bda5314 USB: xhci: Performance - move xhci_work() into xhci_irq()
9032cd5 USB: xhci: Performance - move interrupt handlers into xhci-ring.c
021bff9 USB: xhci: Performance - move functions that find ep ring.
787f4e5 USB: xHCI: Isoc urb enqueue
a061a5a USB: xHCI: allocate bigger ring for isochronous endpoint
04e5190 USB: xHCI: Isochronous transfer implementation
8e51adc USB: xHCI: Introduce urb_priv structure
d18240d USB: xHCI: Missed Service Error Event process
986a92d USB: xHCI: adds new cases to trb_comp_code switch
7fec325 USB: xHCI: remove redundant print messages
22405ed USB xHCI: handle_tx_event() refactor: process_bulk_intr_td
8af56be USB: xHCI: handle_tx_event() refactor: process_ctrl_td
4422da6 USB: xHCI: handle_tx_event() refactor: finish_td
43b86af USB: xHCI: Supporting MSI/MSI-X
e10fa47 USB: xhci: trivial: use ARRAY_SIZE
541c7d4 USB: convert usb_hcd bitfields into atomic flags
202380d USB: xhci: Remove obsolete debugging printk.

- these changes don't apply directly to the maverick kernel; we'd probably need quite a bit of munging and cherry-picking other patches to get these applied. We *may* be able to just grab the "power management implementation" patches, but we might be missing some important fixes in this case. I'll have an initial look and see if this is feasible.

In general, I'd strongly suggesting sticking to Natty for devices where 3.0 support is necessary.

Jeremy Kerr (jk-ozlabs) wrote :

In other news, the Natty kernel has recently been uploaded, it's based on 2.6.37-rc1, which will have these patches. If you can, please try this kernel with USB 3 suspend/resume and let me know how it goes.

Jeremy Kerr (jk-ozlabs) wrote :

> We *may* be able to just grab the "power management implementation" patches

Nope, we're missing some prerequisites for these patches, so can't do a trivial backport.

Michael Zaugg (AOI) (it-oas) wrote :

When adding "echo disable > /sys/firmware/acpi/interrupts/gpe01" to /etc/rc.local don't forget to change the execution bit with $ chmod u+x /etc/rc.local

Gabou (gabriel-public-3) wrote :

Temporary fix
(Please note the _ in xhci_hcd)

On Ubuntu 10.10

# Be root
sudo su

# Edit this file
vim /etc/pm/sleep.d/05_xhci

Here is the content of this file
------------------------
#!/bin/sh
# Fix some issues with USB3

if [ "$1" = "suspend" ]
then
        modprobe -r xhci_hcd
fi

if [ "$1" = "resume" ]
then
        modprobe xhci_hcd
fi
---------------

# Change access right (not sure it's necessary)
chmod 755 /etc/pm/sleep.d/05_xhci

Jeremy Kerr (jk-ozlabs) wrote :

Gabou: if I'm not mistaken, the SUSPEND_MODULES fix above does exactly that.

Chris Van Hoof (vanhoof) on 2010-11-29
tags: added: hwe-blocker
Martin Spacek (mspacek) wrote :

As mentioned by Jerone Young in comment #28, I've noticed that even with SUSPEND_MODULES="xhci-hcd" in unload_modules, once in a while, after a few suspend/resume cycles, My Thinkpad W510 maverick system will hang while trying to suspend, and has to be hard powered off. This is bad.

I don't run any USB 3.0 devices, and since it seems the patch won't be backported to maverick or lucid, (or at least not for a while), I dove into unloading the xhci_hcd module altogether (not just during suspend), which I discovered is actually a very easy thing to do. It wasn't initially obvious to me, so here it is:

You can temporarily unload the module with "sudo modprobe -r xhci_hcd". So far, after testing for several suspend/resume cycles in a row, I haven't had any problems. However, the two blue NEC USB 3.0 ports on my machine no longer work, even for non-USB 3.0 devices like my mouse. That's OK, since I have another two Intel USB ports I can use, and suspend/resume reliability is way more important to me than having an extra 2 ports. In any case, you can always run "sudo modprobe xhci_hcd" to restore the module and the functioning of the two NEC ports.

Unloading the module with modprobe doesn't stick after a reboot. To make it stick, you need to blacklist xhci_hcd (as mentioned in an earlier post). To blacklist it, create the file:

/etc/modprobe.d/blacklist-xhci_hcd.conf

and add this line to it:

blacklist xhci_hcd

That's it. Note that since I no longer need it, my /etc/pm/config.d/unload_module file is now empty (in fact, I deleted it).

Hope this helps others until the patch becomes widespread.

Martin, you wrote SUSPEND_MODULES="xhci-hcd" instead of SUSPEND_MODULES="xhci_hcd". Could that be a problem ?

Martin Spacek (mspacek) wrote :

Jerome, either seems to work fine (other than the occasional hang). If you look at the modprobe man page, it says that _ and - are synonymous. Although I guess it's better to use _, since that's what all the module names show when you do lsmod.

ptha (peter-hannon) wrote :

Hi all, I'm running 10.10 on an Asus N61JQ laptop. Here are the steps I've taken to get suspend/hibernate working on my laptop. For hibernate, I had to resize my swap as it had been created smaller than my actual RAM size. I tried adding SUSPEND_MODULES="xhci_hcd", which helped but did not resolve the issue completely. I could see the hard drive saving the current state to disk, after a minute there would be no more hard drive activity but a blinking cursor remained on the screen. I would then have to switch off the laptop manually. On turning the laptop back on, the system was correctly restored to its state before I initiated the hibernate. Blacklisting in /etc/modprobe.d didn't make a difference, on hibernating the laptop wouldn't switch off, with a blinking cursor.

I found the solution on ubuntuforums.org, see comment #7 by John Dias: http://ubuntuforums.org/showthread.php?t=1444822

His solution involves a script for unbinding ehci_hcd from the kernel (which should be made executable). I followed his instructions, using xhci_hcd instead of xhci for part 2 and now suspend/hibernate works perfectly.

R. A. Rivas Diaz (rivasdiaz) wrote :

I'm running Ubuntu 10.10 on a Sager laptop and also have this problem.
Adding the script to /etc/pm/sleep.d/ to unload/reload the xhci_hcd module seems to solve the problem for me.
After reading the comments, I'm not sure if it's better to add xhci_hcd to SUSPEND_MODULES.

NakedNous (nakednous) wrote :

ptha workaround did the trick for me. Thanks (asus N53J)

Chris Van Hoof (vanhoof) on 2011-01-05
Changed in oem-priority:
assignee: Canonical Kernel Team (canonical-kernel-team) → Chris Van Hoof (vanhoof)
Chris Van Hoof (vanhoof) wrote :

USB 3.0 Power Management support landed in 2.6.37, and was pulled into natty, marking that task Fix Released. Marking the Maverick/Lucid tasks as won't fix as these changes have been found to be too intrusive to backport.

Changed in linux (Ubuntu Natty):
status: Triaged → Fix Released
Changed in linux (Ubuntu Maverick):
status: Triaged → Won't Fix
Changed in linux (Ubuntu Lucid):
status: New → Won't Fix
Changed in oem-priority:
status: Triaged → Fix Released
racecar56 (racecar56) wrote :

On my GA-770T-USB3 motherboard, adding exactly SUSPEND_MODULES="xhci-hcd" to the exact file /etc/pm/config.d/unload_module works extremely well for me on Maverick with kernel 2.6.35-25-generic.

Jessie Morris (jessieamorris) wrote :

By the way, in Natty (11.04), I had to remove the iwlagn part on the SUSPEND_MODULES while running the newest kernel. If I didn't, Network Manager would sit there saying, "Authorizing" forever.

Logan Rosen (logan) wrote :

Just installed Natty - still had to perform the fixes on Comment #47's forum link in order to get suspend/hibernate working on my ASUS U43F-BBA6.

Martin Spacek (mspacek) wrote :

From what I've seen so far on a fresh install of Natty on my Thinkpad W510, suspend/resume works fine, even after a few tries in a row.

I'm seeing this on a fresh Natty upgrade. Kernel 2.6.38-8. Removing xhci_hcd makes suspend work again.

Neil J. Patel (njpatel) wrote :

This bug is showing up on Oneiric with x220 i7 + USB3. The fix mentioned in the description works...regression in Oneiric kernel?

Markus Reuther (s-markus) wrote :

I am also affected by this problem (or not?) using Natty (fresh install) on my new ThinkPad X220 with i7 and usb 3.0.

The proposed workaround by adding SUSPEND_MODULES="xhci_hcd" to /etc/pm/config.d/unload_module did not work for me.

I tried a lot and found out that suspend to ram works if I disable the options for charging usb devices in hibernate in the bios and manually unload xhci_hcd with modprobe -r xhci_hcd before suspend. I did not plugged in some devices for charging.

Suspend to disk is still not working. After writing the current state do disk my notebook turns off. After truning on it freezes showing some log output. Switching to a terminal is not possible. Only hard turning off is possible.

(By the way, it seems that wpa_supplicant is not resumed correctly since it believes that it is connected to an unreachable wlan.)

During trying I upgraded my kernel to 2.6.39-rc4.

Download full text (4.9 KiB)

Markus, can you tell what exactly is being displayed after suspending?
I have to say that suspend worked for me a while ago (after having
upgraded my Thinkpad W510's BIOS) but now, I'm experiencing a similiar
(if not the same) issue like you: When I press the power button (turn
it on again) or open up the lid (if it has been closed previously), it
freezes showing some (kernel?) log.

>>Only hard turning off is possible.
Exactly.

I'm running the 2.6.38-8-generic kernel btw. Unfortunately, I can't
say whether it was an update that led to this behavior.

On Thu, Jul 7, 2011 at 23:40, Markus Reuther <email address hidden> wrote:
> I am also affected  by this problem (or not?) using Natty (fresh
> install) on my new ThinkPad X220 with i7 and usb 3.0.
>
> The proposed workaround by adding SUSPEND_MODULES="xhci_hcd" to
> /etc/pm/config.d/unload_module did not work for me.
>
> I tried a lot and found out that suspend to ram works if I disable the
> options for charging usb devices in hibernate in the bios and manually
> unload xhci_hcd with modprobe -r xhci_hcd before suspend. I did not
> plugged in some devices for charging.
>
> Suspend to disk is still not working. After writing the current state do
> disk my notebook turns off. After truning on it freezes showing some log
> output. Switching to a terminal is not possible. Only hard turning off
> is possible.
>
> (By the way, it seems that wpa_supplicant is not resumed correctly since
> it believes that it is connected to an unreachable wlan.)
>
> During trying I upgraded my kernel to 2.6.39-rc4.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (664398).
> https://bugs.launchpad.net/bugs/522998
>
> Title:
>  XHCI (USB 3.0) kernel Module Prevents Suspend
>
> Status in The Linux Kernel:
>  Invalid
> Status in OEM Priority Project:
>  Fix Released
> Status in Release Notes for Ubuntu:
>  Fix Released
> Status in “linux” package in Ubuntu:
>  Fix Released
> Status in “linux” source package in Lucid:
>  Won't Fix
> Status in “linux” source package in Maverick:
>  Won't Fix
> Status in “linux” source package in Natty:
>  Fix Released
>
> Bug description:
>  When the XHCI module is loaded the system cannot suspend.
>
>  Manually unloading XHCI will allow suspend to complete normally.
>
>  If SUSPEND_MODULES="xhci" is added to /etc/pm/config.d/unload_module
>  then the system can suspend normally.
>
>  ProblemType: Bug
>  AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
>  AplayDevices:
>   **** List of PLAYBACK Hardware Devices ****
>   card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic]
>     Subdevices: 1/1
>     Subdevice #0: subdevice #0
>  Architecture: amd64
>  ArecordDevices:
>   **** List of CAPTURE Hardware Devices ****
>   card 0: Intel [HDA Intel], device 0: HDA Generic [HDA Generic]
>     Subdevices: 1/1
>     Subdevice #0: subdevice #0
>  AudioDevicesInUse:
>   USER        PID ACCESS COMMAND
>   /dev/snd/controlC0:  bhughes    1918 F.... pulseaudio
>  CRDA: Error: [Errno 2] No such file or directory
>  Card0.Amixer.info:
>   Card hw:0 'Intel'/'HDA Intel at 0xf2620000 irq 17'
>     Mixer name : 'Conexant...

Read more...

Bryn Hughes (linux-nashira) wrote :

Markus / Simon: Do you believe your problems have any relation to your USB 3.0 hardware? Note that this is not a general purpose bug for troubleshooting resume issues.

This bug only covers the specific case of a system with a USB 3.0 controller using the XHCI driver not being able to suspend without unloading the XHCI module beforehand. Other problems should be discussed in the appropriate forums / bug reports / etc.

Markus Reuther (s-markus) wrote :

@Simon
What is shown on resume if it freezes is non-deterministic. I guess it sometimes shows the log messages that where displayed just before suspend. Sometimes the screen is blank.

@d3mia7
After more and more testing, I don't believe that I postet in the correct bug report. I found out that my problem only occurs if I tell the system suspend to disk by FN+F4 or if I tell the system to suspend to disk by the menu from the power off button. If I instead use pm-suspend or pm-hibernate or even pm-suspend-hybrid it seems that all works ok (tested > 5 times). I also noticed that there is no login mask if I use the shell commands. At one time I saw a login mask before it freezes if I used FN+F4. So I guess it has something to do with the procedure done if I use FN+F4. I remember that I was testing hibernate and suspend to ram with the install cd and it worked ok.

So: Is there a difference between FN+F4 and pm-suspend? And if so, what is the difference?

Tomorrow I will test the install cd again and after some more testing I will open a new bug report.

Now I have a guess: @Simon: Did you install fingerprint-gui?

I have a Lenovo Thinkpad W510, and the following works flawlessly for me:

1) As root/sudo, create /etc/pm/sleep.d/20_custom-xhci_hcd with the following contents:

#!/bin/sh
# File: "/etc/pm/sleep.d/20_custom-xhci_hcd".
TMPLIST=/tmp/xhci-dev-list

case "${1}" in
        hibernate|suspend)
    echo -n '' > $TMPLIST
          for i in `ls /sys/bus/pci/drivers/xhci_hcd/ | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
              # Unbind xhci_hcd for first device XXXX:XX:XX.X:
               echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
           echo "$i" >> $TMPLIST
          done
        ;;
        resume|thaw)
    for i in `cat $TMPLIST`; do
              # Bind xhci_hcd for first device XXXX:XX:XX.X:
              echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/bind
    done
    rm $TMPLIST
        ;;
esac

2) sudo chmod 755 /etc/pm/sleep.d/20_custom-xhci_hcd

I didn't need to create the /etc/pm/sleep.d/05_xhci file as suggested by @Gabou, nor did I need to do anything with /etc/modprobe.d/blacklist-xhci_hcd.conf or /etc/pm/config.d/unload_module, as suggested by @Martin. In fact, these three files don't exist on my machine.

For other laptops that have ehci_hcd devices which cause suspend problems, I think this script will work by simply replacing xhci_hcd with ehci_hcd, although this isn't directly relevant to this bug report.

This works even with two usb devices plugged into the ports when I suspend and then resume -- the devices work and don't need to be plugged in or out.

Additionally, the solution in comment #61 works perfectly for with hibernate, although hibernate takes forever to enter into and come out of (almost as much time as a shutdown and restart, with the exception that your applications all come back).

Alex M. Lowe (lengau) wrote :

I have also been experiencing this bug in Oneiric (like #56). Can we reopen this bug for Oneiric?

Ville Ranki (ville-ranki) wrote :

Recently (in a couple of weeks) this bug has appeared in Natty on HP Elitebook 8540p. rmmoding xhci_hcd before suspend helps. Looks like a regression.

Thucydides411 (gregreen) wrote :

There is a fix released for this? It hasn't made its way into Ubuntu then. Klugy hacks are still required to suspend on most modern laptops.

Jeremy Kerr (jk-ozlabs) wrote :

It sounds like a new bug has been introduced; this bug was tracking the lack of PM support in the xhci stack.

If you're experiencing a problem that is resolved by adding xhci_hcd to SUSPEND_MODULES, please file a new bug, and post the bug number here so folks can find it.

Thanks!

Ville Ranki (ville-ranki) wrote :

Could someone change this bug back to "Confirmed" on Ubuntu Oneiric? It is not fixed and makes for example HP Elitebooks unusable.

Ákos Maróy (akos-maroy) wrote :

I seem to have the same issue with 12.10, kernel 3.5.0-19-generic. this is what I get in dmesg when trying to suspend:

[ 40.213352] xhci_hcd 0000:02:00.0: WARN: xHC CMD_RUN timeout
[ 40.213370] suspend_common(): xhci_pci_suspend+0x0/0x40 returns -110
[ 40.213373] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -110
[ 40.213376] dpm_run_callback(): pci_pm_suspend+0x0/0x140 returns -110
[ 40.213379] PM: Device 0000:02:00.0 failed to suspend async: error -110

interestingly, xhci_hcd seems to be not compiled as a module for this kernel? at least, lsmod doesn't show it, "lsmod | grep xhci" returns nothing.

I wonder how one can disable a module if it's compiled into the kernel....

oni (oni303) wrote :

Kernel 3.5.0-24-generic is still affected. After recompiling the kernel with xhci as a module fixes the Problem.
So I suggest to change the default config.

Foo Bar (spam-nanl) wrote :

This still affects 13.04, latest kernel. SUpport compiled into the kernel - no way to disable the module as a workaround.

Bryn Hughes (linux-nashira) wrote :

I don't believe this issue still exists personally. My Lenovo W510 suspends absolutely fine with Precise (12.04). I have tested with the 3.5 kernel as well without issues.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers