Lucid SRU: Intel Core i3/i5/i7 hang on resume from suspend (SCI_EN)

Bug #594837 reported by Kamal Mostafa
100
This bug affects 17 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
High
Unassigned
Nominated for Lucid by Kamal Mostafa

Bug Description

Intel Core i3/i5/i7 machines hang on resume from suspend due to the SCI_EN bit being left unset by the BIOS.

*** This bug relates ONLY to systems with Intel Core i3/i5/i7 CPU's ***

IMPACT:
System hang on resume is a major malfunction.

HOW ADDRESSED:
In Lucid, this is currently addressed for certain specific machines via a quirk table listing machines for which SCI_EN gets forcibly set on resume (see bug 553498 which enables it for "Dell Studio 155x" models). The following patch from upstream needs to be applied to Lucid to address the problem for all machines.

PATCH:
(from 2.6.35-rc1; appears in Maverick already)
commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3
Author: Matthew Garrett <email address hidden>
Date: Tue May 11 13:49:25 2010 -0400

    ACPI: Unconditionally set SCI_EN on resume

This patch applies cleanly to Lucid (2.6.32-23.37).

TEST CASE:
Intel Core i3/i5/i7 machine: Suspend the machine via any method, then wake it. On resume, system powers up but hangs immediately (Dell Studio 155x gets black screen, fan stuck on).

REGRESSION POTENTIAL:
As has been discussed on LKML and linux-acpi, setting SCI_EN is a violation of the ACPI spec, but it (a) works, and (b) follows the example of another major operating system. There exists a potential that this method will cause problems for some machine but none are known at this time.

Tags: patch testcase
Revision history for this message
Dominik (dominik-dbruhn) wrote :

Can we expect to get this patch in lucid or do I have to upgrade to maverick (alpha) do get resume support?

Changed in linux (Ubuntu):
milestone: none → lucid-updates
assignee: nobody → Kamal Mostafa (kamalmostafa)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

I have built a Lucid test kernel including this fix. This kernel is the current 2.6.32-23.37 pre-proposed plus the above mentioned patch ("ACPI: Unconditionally set SCI_EN on resume"):
    http://kernel.ubuntu.com/~kamal/always~sci~en/latest-lucid/
To install this kernel, download the three .deb files and install them using
    sudo dpkg -i *kamal*.deb

@Dominik - we are working on getting this fix into Lucid.

Revision history for this message
John Trostel (jtrostel-gmail) wrote :

doesn't seem to resume on my e6410 with intel graphics. any way I can help troubleshoot?

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

For the record, the e6410 problem mentioned in comment #3 has now been identified as a different issue (bug #595604).

Revision history for this message
Laurent SION (laurent-sion) wrote :

This patch (ACPI: Unconditionally set SCI_EN on resume) solved a similar issue on my E6510: E6510 doesn't resume after the second suspend (bug 594837). Tested with a patched 2.6.32-22.36-generic-pae.

Thanks.

Revision history for this message
Laurent SION (laurent-sion) wrote :

>> (bug 594837)

I meant: bug 591033.

Revision history for this message
Brian (x-brian) wrote :

Kamal's kernel patch solved this issue for me.

I have a Dell E6410:
Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz
nVidia NVS 3100M

My computer would fail to resume from suspend every second attempt. The first attempt following a reboot would suspend/resume correctly, but the next attempt would fail. The suspend seemed to occur properly, but on resume I would see the BIOS self-test and Ubuntu would cold boot.

This also solved an apparently related problem: after the failed suspend (and possibly on normal cold boots?), networking would be disabled. I would have to right-click network-manager and enable networking. That problem is now resolved as well.

I have checked suspend on lid close/resume on open, and suspend from the session menu/resume with power button. Major improvement!

Revision history for this message
Collin Peters (collin-peters) wrote :

I have a HP Probook 4520s with a Core i5 processor. I was suffering from the hang on resume problem and this patched kernel only seems to work some of the time for me. I haven't exactly figured out the pattern yet. Can I send you any logs?

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

Thanks for the feedback, folks. We are still working on the integration plan to get this fix into Lucid, and all your test results have been much appreciated.

@Collin - Since you appear to be experiencing an additional separate problem, I recommend that you report a separate bug report so that your machine logs can be automatically collected (and also reference this bug number in the bug you report). These pages might also be helpful to you:
  https://help.ubuntu.com/community/ReportingBugs
  https://wiki.ubuntu.com/X/Troubleshooting/Freeze

Revision history for this message
Brian Campbell (unlambda) wrote :

Kamal's patch works for me on a Dell Inspiron 1564 with a Core i5 processor. Thanks! Looking forward to seeing this in an update of Lucid.

Revision history for this message
Brian Campbell (unlambda) wrote :

Sorry, I should probably clarify, since I may have gotten confused between several bugs and versions of this patch.

I have taken the earlier kernel build by Kamal, from https://launchpad.net/~kamalmostafa/+archive/linux-kamal-scien/+packages, which was mentioned in bug #578673, and that fixes the problem on my Dell Inspiron 1564. It looks like the build mentioned earlier in this bug is a new build, applying the same patch to a newer kernel. I just want to clarify that it's not actually this build that I applied, but the earlier one.

Revision history for this message
Brian (x-brian) wrote :

Just an FYI:

I switched kernels to: v2.6.35-rc1-lucid
from: http://kernel.ubuntu.com/~kernel-ppa/mainline/
in order to solve a WWAN problem (Gobi 2000) and my computer still seems to suspend/resume just fine. Hopefully all this will be in Ubuntu's standard kernel soon!

I have a Dell E6410:
Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz
nVidia NVS 3100M

Revision history for this message
Brian (x-brian) wrote :

(Up)graded today to kernel 2.6.32-23.37 from 2.6.35-rc1 and resume again fails. I decided the quirks in the upstream kernel were annoying so I (up)graded to the standard Ubuntu kernel.

After doing that, I had to patch the kernel to support my Gobi WWAN. Is there a walk-through of how to apply Kamal's patch to the kernel? Since I need a patch to support my WWAN card, I don't think I can use Kamal's pre-built kernel mentioned above will support my WWAN without being patched.

Here's where I got the patch:
http://kernel.ubuntu.com/~kamal/scien/0001-TESTING-acpi-Unconditionally-set-SCI_EN-on-resume.patch

Since I already got the current (2.6.32-23.37) kernel source, which is what Kamal's patch uses, I should be able to add this patch to the other required patch, yes?

Like:
cd ./linux-source-2.6.32
patch -p1 < ../usb-wwan-2.6.32.diff
patch -p1 < ../0001-TESTING-acpi-Unconditionally-set-SCI_EN-on-resume.patch
....etc. (compiling patched kernel)

Or will that fail? I guess I can try it.... maybe it will work, maybe not. Might need to change the order.

For now WWAN is more important to me than suspend/resume, but I would like to get both working correctly!

Revision history for this message
Brian (x-brian) wrote :

OK Kamal--help here?

* Got this: *
http://kernel.ubuntu.com/~kamal/scien/0001-TESTING-acpi-Unconditionally-set-SCI_EN-on-resume.patch

* Tried this: *
sudo apt-get install linux-source
tar xjf /usr/src/linux-source-2.6.32.tar.bz2
cd linux-source-2.6.32/
patch -p1 < ../0001-TESTING-acpi-Unconditionally-set-SCI_EN-on-resume.patch

* Result was: *
patching file arch/x86/kernel/acpi/sleep.c
patching file drivers/acpi/sleep.c
Hunk #5 FAILED at 353.
Hunk #6 succeeded at 449 (offset 32 lines).
1 out of 6 hunks FAILED -- saving rejects to file drivers/acpi/sleep.c.rej
patching file include/linux/acpi.h

--The rejects were a section that was supposed to remove a bunch of hardware-specific matches for init_set_sci_en_on_resume. Is there another patch I should be using? Is my source different?

I want to be able to patch the kernel so I can use my WWAN, so I need to apply two patches.

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

Folks, while we continue to wait for this patch (Matthew Garrett's "Unconditionally set SCI_EN") to find its way into Lucid, I have set up a PPA which provides a kernel including the patch:

    https://launchpad.net/~kamalmostafa/+archive/linux-kamal-scien

I will update the PPA as soon as I can after each Lucid kernel release until we get the patch into Lucid.

The PPA kernel is the exact same patch we've had for awhile here, just re-applied to the latest Ubuntu Lucid kernel version.

@Brian - I have contacted you offline to discuss your custom kernel build.

Changed in linux (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

For those building their own kernels, the patch itself is attached here.

Source: git commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3

tags: added: patch
Revision history for this message
Brian (x-brian) wrote :

FYI I now have my machine working by applying Kamal's patch to the kernel along with another patch I needed for my Gobi 2000 WWAN adapter (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554099). There's slightly more to getting the WWAN working than patching the kernel, but certain modules must be patched, so I had to apply two patches and build my own kernel in order to fix both problems. Here's what I did:

cd ~
wget http://launchpadlibrarian.net/46353288/usb-wwan-2.6.32.diff
wget http://launchpadlibrarian.net/51310711/0001-ACPI-Unconditionally-set-SCI_EN-on-resume.patch
sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package
sudo apt-get build-dep linux
sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
 # (I had kernel version 2.6.32-23-generic installed)
apt-get source linux-image-$(uname -r)
cd linux-2.6.32/
patch -p1 < ../usb-wwan-2.6.32.diff
patch -p1 < ../0001-ACPI-Unconditionally-set-SCI_EN-on-resume.patch
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
debian/rules updateconfigs
fakeroot debian/rules clean
DEB_BUILD_OPTIONS=parallel=4 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic
 # (I have 4 cores so I can compile with parallel=4)
cd ../
sudo dpkg -i linux-image-2.6.32-23-generic_2.6.32-23.37_amd64.deb
sudo dpkg -i linux-headers-2.6.32-23-generic_2.6.32-23.37_amd64.deb

Then I rebooted, my 2.6.32-23 kernel was replaced with the new one, and both things are working. I have had occasional troubles with reboots not working--it will just hang at the Ubuntu splash screen--but this predated my custom kernel. I have to hold the power button to turn off and then reboot again sometimes. Oh well, I hardly ever reboot anyway.

I didn't have to rebuild linux-restricted-modules and things seem to be working anyway, even though I have an NVidia graphics adapter. That might be because I made no config changes at all, just did the patches. The only new weird thing I've noticed so far is that my network-manager thinks I'm plugged in to ethernet even though I'm not. Hopefully wired ethernet will work!

Revision history for this message
teh603 (darth-giles) wrote :

This PPA appears to have solved it on my Inspiron 1564, which is i3 based.

Revision history for this message
Andrew Pearson (andrewpearson) wrote :

I was wondering if this patch was included in the 2.6.36-997 version of the Kernel from the intel-drm-next PPA found here: http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-next/current/

I have done lots of reading about this (and other) Arrandale problems because I am in the market for a new laptop. From what I read, and according to http://intellinuxgraphics.org/, it seems that this is the go-to Kernel? Anyone have any ideas?

Revision history for this message
Andrew Pearson (andrewpearson) wrote :

I meant 2.6.35, I apologize.

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

@Andrew Pearson-
Yes, this patch is included in the 2.6.35 kernel (and specifically, the patch is included in the Ubuntu-2.6.35-14.19 kernel upon which the current ~kernel-ppa/mainline/drm-intel-next build was based).

Revision history for this message
teh603 (darth-giles) wrote :

So does this mean we're very likely to see it fixed in Maverick? I haven't been able to test Maverick much due to various intel driver issues and x.org breakage problems.

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

@teh603 - This fix is already in Ubuntu Maverick.

Revision history for this message
Adi Roiban (adiroiban) wrote :

I installed the kernel from Kamal's PPA and it solved my resume from sleep problem on my Dell Inspiron N3010 (13r) systems.

Many thanks Kamal!

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

For reference, this fix has been committed to the Ubuntu Lucid kernel development tree as SHA ID b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 (it has not yet been released, but will likely be released very soon).

Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

The "Unconditionally set SCI_EN on resume" fix is now available in the Lucid pre-proposed PPA kernel:
https://launchpad.net/~kernel-ppa/+archive/pre-proposed
(as of 2.6.32-25.43~pre201008210902)

For this reason, I will no longer be maintaining my own PPA for the fix (comment #15).

Revision history for this message
Michal (mikeos) wrote :

Sorry to comment on a fixed bug, but my problem seems to be closely related. My system is Dell Latitude e6410 with Intel i7.

Resume from suspend to memory was not working for me on kernels prior 2.6.36. Since 2.6.36 it works flawlessly but only when resuming with AC adapter plugged-in.

When resuming on batteries (no matter whether previously suspended on AC or batteries) the system completely hangs - either on first attempt or usually on 2nd or 3rd or at max a 5th attempt of sequential suspend/resume cycles.

No success tweaking with /etc/pm/* and /usr/lib/pm-utils/* disabling there actions related to current computer power source.

Finally disabling CPU speed-step in BIOS resolved the problem. Tested with success on 20 sequential suspend/resume cycles on battery power. Evidently this a workaround which is killing the battery :/

I'm not sure what *exactly* the script /usr/lib/pm-utils/sleep.d/94cpufreq is about, but disabling it had no effect. I don't have enough knowledge to perform advanced tests with CPU scaling and governors.

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
assignee: Kamal Mostafa (kamalmostafa) → nobody
Revision history for this message
Brian (x-brian) wrote :

Has there been a regression here? With the latest kernel I am again having problems resuming from suspend on my Dell E6410.

uname -srvmo
Linux 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux

Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :

Not for me. I also have a Dell E6410 and I have just suspended and resumed 5 times in a row without any problems. My laptop has a Core i5, Intel graphics and the regular 1280x800 panel.

Revision history for this message
Brian (x-brian) wrote :

Hmm something else is going on for me then. When I booted with the 2.6.32 kernel I didn't have any trouble with suspend/resume:

uname -srvmo
Linux 2.6.32-27-generic #49-Ubuntu SMP Thu Dec 2 00:51:09 UTC 2010 x86_64 GNU/Linux

I have a Core i7, Nvidia NVS 3100 with 1440x900 panel. I will poke around and see if I can determine why I am having problems again.

Revision history for this message
Tomás Gutiérrez (tomas-gutierrez) wrote :

@Brian,

Good timing on the comment. I was wondering if I screwed something up with my configuration, and was about to post in here again.

I, too, have been having trouble resuming. However, this time around it's as if it never went to sleep. When I open the lid the screen is still active, but frozen. I can't even switch to a different term window.

Unfortunately, right now I don't have time for anything other than a "me too" post. At least you know you're not alone :).

Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :

Brian:

Such issues are usually very specific for each different hardware. As you said your hardware is quite different to mine, hence the different behavior is quite natural. I would suggest that you should look for other bug reports more specific to your hardware or maybe open a new one for it.

This bug report seems too general to be really useful, IMHO.

tags: added: testcase
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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