Bug 13745 - HP G7000 battery disappears after suspend
Summary: HP G7000 battery disappears after suspend
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Sleep-Wake (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_power-sleep-wake
: 14526 (view as bug list)
Depends on:
Reported: 2009-07-08 19:08 UTC by Alan Jenkins
Modified: 2010-06-02 02:01 UTC (History)
7 users (show)

See Also:
Kernel Version:
Tree: Mainline
Regression: Yes

acpidump output (166.72 KB, application/octet-stream)
2009-07-08 19:08 UTC, Alan Jenkins
dmidecode output (8.54 KB, application/octet-stream)
2009-07-08 19:10 UTC, Alan Jenkins
dmesg from v2.6.31-rc2-146-gfaf80d6 (53.70 KB, application/octet-stream)
2009-07-08 19:57 UTC, Alan Jenkins
dmesg from v2.6.31-rc2-146-gfaf80d6, irqpoll (51.70 KB, application/octet-stream)
2009-07-08 20:14 UTC, Alan Jenkins
dmesg showing boot and suspend after manual revert (53.19 KB, application/octet-stream)
2009-07-08 20:21 UTC, Alan Jenkins
patch adding DMI for michael's hp (1.07 KB, patch)
2009-08-30 02:41 UTC, Len Brown
Details | Diff
patch consolidating above comments (1.26 KB, patch)
2009-11-06 06:44 UTC, Len Brown
Details | Diff
DMI patch for HP-Compaq C700 (12.00 KB, patch)
2009-11-23 16:48 UTC, Len Brown
Details | Diff

Description Alan Jenkins 2009-07-08 19:08:00 UTC
I've borrowed this laptop for a few days.  Linux works pretty well, but I found a problem on newer kernels.  After suspend it claims the battery has been removed.  E.g. /proc/acpi/battery/BAT0/state claims the battery is not present (but it is).  

I bisected it to the commit below.  Manually reverting the patch fixes the problem (in both 2.6.30 and 2.6.31-rc2).

commit d0c71fe7ebc180f1b7bc7da1d39a07fc19eec768
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date:   Sat Oct 4 00:05:05 2008 +0200

    ACPI Suspend: Enable ACPI during resume if SCI_EN is not set

    On some machines, like for example MSI Wind U100, the BIOS doesn't
    enable ACPI before returning control to the OS, which sometimes
    causes resume to fail.  This is against the ACPI specification,
    which clearly states that "When the platform is waking from an S1, S2
    or S3 state, OSPM assumes the hardware is already in the ACPI mode
    and will not issue an ACPI_ENABLE", but it won't hurt to check the
    SCI_EN bit and enable ACPI during resume from S3 if this bit is not

    Fortunately, we already have acpi_enable() for that, so use it in the
    resume code path, before executing _BFS, in analogy with the
    resume-from-hibernation code path.

    NOTE: We aren't supposed to set SCI_EN directly, because it's owned
    by the hardware.

    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    Pavel Machek <pavel@suse.cz>
    Signed-off-by: Len Brown <len.brown@intel.com>
Comment 1 Alan Jenkins 2009-07-08 19:08:37 UTC
Created attachment 22267 [details]
acpidump output
Comment 2 Alan Jenkins 2009-07-08 19:10:01 UTC
Created attachment 22268 [details]
dmidecode output
Comment 3 Rafael J. Wysocki 2009-07-08 19:56:53 UTC
Well, the commit below can't be reverted, because that would cause the boxes
it fixed to stop working.

Now, the only case this patch can make any difference is when the BIOS doesn't
set SCI_EN before returning control the the kernel, which quite evidently is a
BIOS bug.  The fact that the battery doesn't work with this patch applied means
that the BIOS not only doesn't set SCI_EN, but also expects it to remain unset,
which is insane.

IMO this is a "won't fix", sorry.
Comment 4 Alan Jenkins 2009-07-08 19:57:20 UTC
Created attachment 22274 [details]
dmesg from v2.6.31-rc2-146-gfaf80d6

Dmesg showing boot and suspend on a symptomatic kernel
Comment 5 Alan Jenkins 2009-07-08 20:14:40 UTC
Created attachment 22275 [details]
dmesg from v2.6.31-rc2-146-gfaf80d6, irqpoll

irqpoll makes these go away -

[  141.008335] PM: resume devices took 2.512 seconds
[  141.008429] PM: Finishing wakeup.
[  141.008450] Restarting tasks ... done.
[  143.097129] cfg80211: Calling CRDA to update world regulatory domain
[  143.333895] irq 9: nobody cared (try booting with the "irqpoll" option)
[  143.334051] handlers:
[  143.334089] [<ffffffff812658a8>] (acpi_irq+0x0/0x2c)
[  143.334200] Disabling IRQ #9

- but doesn't fix the problem.
Comment 6 Alan Jenkins 2009-07-08 20:21:14 UTC
Created attachment 22276 [details]
dmesg showing boot and suspend after manual revert
Comment 7 Rafael J. Wysocki 2009-07-08 21:03:56 UTC
Hmm.  Can you try to add the system to acpisleep_dmi_table[] (drivers/acpi/sleep.c) with .callback = init_set_sci_en_on_resume and see if that helps?
Comment 8 Rafael J. Wysocki 2009-07-25 20:48:22 UTC
Patch : http://patchwork.kernel.org/patch/35062/
Comment 9 Len Brown 2009-08-02 16:37:26 UTC
Acked-by: Len Brown <len.brown@intel.com>

Rafael is taking this one in his suspend tree
Comment 10 Michael Papazoglou 2009-08-27 12:58:44 UTC
This issue also affects me using an HP Pavilion dv3.  I made a similar change in sleep.c, adding the following lines:

.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard HP Pavilion dv3 Notebook PC",
.matches = {
	DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
	DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv3 Notebook PC"),

which successfully fixes the problem on my HP Pavilion dv3 Notebook PC.  Is it possible to add this patch to sleep.c?
Comment 11 Len Brown 2009-08-30 02:36:26 UTC
PM / ACPI: HP G7000 Notebook needs a SCI_EN resume quirk
shipped in v2.6.31-rc5
Comment 12 Len Brown 2009-08-30 02:41:37 UTC
Created attachment 22909 [details]
patch adding DMI for michael's hp

Please verify that this patch works.
Comment 13 Michael Papazoglou 2009-08-30 18:43:32 UTC

The patch you provided works. 

Thank you

> Date: Sun, 30 Aug 2009 02:41:38 +0000
> From: bugzilla-daemon@bugzilla.kernel.org
> To: mpapazoglou@live.com
> Subject: [Bug 13745] HP G7000 battery disappears after suspend
> http://bugzilla.kernel.org/show_bug.cgi?id=13745
> --- Comment #12 from Len Brown <len.brown@intel.com>  2009-08-30 02:41:37 ---
> Created an attachment (id=22909)
>  --> (http://bugzilla.kernel.org/attachment.cgi?id=22909)
> patch adding DMI for michael's hp
> Michael,
> Please verify that this patch works.
> -- 
> Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.

Get back to school stuff for them and cashback for you.
Comment 14 Len Brown 2009-09-24 21:56:51 UTC
commit eb0ca849863ecdc593ba7faa95fda5695af891c8
Author: Len Brown <len.brown@intel.com>
Date:   Sat Aug 29 22:39:06 2009 -0400

    ACPI: sleep: another HP DMI entry for init_set_sci_en_on_resume
    DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv3 Notebook PC")

shipped in linux-2.6.31-git14

Comment 15 Vaibhav Verma 2009-10-25 15:24:55 UTC
This thing also seemed to affect me in my HP dv4-1241tx machine.... making the following changes to drivers/acpi/sleep.c resolved the problem

.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard HP Pavilion dv4 Notebook PC",
.matches = {
    DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
    DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),

Applying this change into the code and recompiling the kernel fixed the problem.
Comment 16 Wael Nasreddine 2009-10-26 21:29:37 UTC
This also affects HP dv7-1199EF, adding the below section worked for me

.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard HP Pavilion dv7 Notebook PC",
.matches = {
    DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
    DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7 Notebook PC"),

Here's a link to the patch I've created adding dv3, dv4 and dv7

Comment 17 alebetco 2009-11-04 20:38:20 UTC
This also affects Compaq presario CQ40 series, adding the below section worked for me

.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC",
.matches = {
    DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
    DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"),
Comment 18 Len Brown 2009-11-06 06:44:50 UTC
Created attachment 23674 [details]
patch consolidating above comments

this patch patch add adds the dv7 and CQ40 entries above to the
dv4 patch here http://bugzilla.kernel.org/show_bug.cgi?id=13449

applied to acpi tree.
Comment 19 Zhang Rui 2009-11-17 01:42:16 UTC
*** Bug 14526 has been marked as a duplicate of this bug. ***
Comment 20 Eric Yager 2009-11-19 00:39:18 UTC
The HP C700 series is also affected by this bug.  In this case the CPU fan is also completely inoperative and the processor will quickly overheat.  Other users have reported the problem in the bug reports below.


I have compiled a new kernel with an entry in sleep.c for this series of laptop to force on the SCI_EN bit after resume.  This fixes the issue with my HP C751NR. 

        .callback = init_set_sci_en_on_resume,
        .ident = "Hewlett-Packard Compaq Presario C700 Notebook PC",
        .matches = {
            DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
            DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario C700 Notebook PC"),
Comment 21 Len Brown 2009-11-23 16:48:54 UTC
Created attachment 23893 [details]
DMI patch for  HP-Compaq C700

Somebody please verify that this patch adding the HP-Compaq C700
helps those systems.
Comment 22 Len Brown 2009-12-09 19:41:21 UTC
commit 87c687be055e67bc04189ce476690be73d16063e
    ACPI: DMI init_set_sci_en_on_resume for HP-Compaq C700

shipped in linux-2.6.32
Comment 23 Len Brown 2010-06-02 02:01:22 UTC
This related patch shipped in 2.6.35-rc1:

commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3
Author: Matthew Garrett <mjg@redhat.com>
Date:   Tue May 11 13:49:25 2010 -0400

    ACPI: Unconditionally set SCI_EN on resume

Note You need to log in before you can comment on or make changes to this bug.