System Suspends/Hibernates when AC is unplugged

Bug #421985 reported by Pete Graner
136
This bug affects 27 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

With Karmic and a running system if I unplug the power from the machine it immediately hibernates. I checked all the gnome-power-manager settings and I changed the "On Battery" from Hibernate to Suspend and when I pull the power the system suspends.

The system is a cheap netbook called a Colovo the model number is CMT-101A.

ProblemType: Bug
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: pgraner 2861 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xfe938000 irq 16'
   Mixer name : 'Realtek ALC662 rev1'
   Components : 'HDA:10ec0662,10ec0662,00100101'
   Controls : 18
   Simple ctrls : 12
Date: Mon Aug 31 22:02:14 2009
DistroRelease: Ubuntu 9.10
HibernationDevice: RESUME=UUID=0ac1f2d6-55f9-41a5-8234-007ff4c01750
MachineType: CZC CZC
Package: linux-image-2.6.31-8-generic 2.6.31-8.28
PccardctlIdent:

PccardctlStatus:

ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-8-generic root=UUID=6ddfc801-e516-4dc6-82c1-d889a234c427 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-8.28-generic
RelatedPackageVersions:
 linux-backports-modules-2.6.31-8-generic N/A
 linux-firmware 1.16
RfKill:

SourcePackage: linux
Uname: Linux 2.6.31-8-generic i686
dmi.bios.date: 07/16/2009
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 080015
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: CZC
dmi.board.vendor: CZC
dmi.board.version: 1.0
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 10
dmi.chassis.vendor: CZC
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr080015:bd07/16/2009:svnCZC:pnCZC:pvr1.0:rvnCZC:rnCZC:rvr1.0:cvnCZC:ct10:cvr1.0:
dmi.product.name: CZC
dmi.product.version: 1.0
dmi.sys.vendor: CZC

Revision history for this message
Pete Graner (pgraner) wrote :
Revision history for this message
Pete Graner (pgraner) wrote : [Fwd: [Fwd: [patch 1/9] acpi battery: work around negative s16 battery current on Acer]]
Download full text (4.7 KiB)

Pasting in for completeness since this started as a mail thread.

-------- Original Message --------
Subject: [Fwd: [patch 1/9] acpi battery: work around negative s16
battery current on Acer]
Date: Mon, 31 Aug 2009 14:09:22 +0200
From: Stefan Bader <email address hidden>
To: Pete Graner <email address hidden>

Hi Pete,

while walking over the linux-acpi list, this has been just accepted and it
looks pretty much like fitting. From your acpi dump I see it is using mA
and
does a calculation which takes a 16bit value from the EC and then subtracts
65536 from that. Though that should not directly cause a battery critical
warning (this is stored in another bit of the EC), but maybe gnome power
manager tries to be smart about the discharge rate. It might be an
interesting
experiment to have the battery info logged in a tight loop and then
unplug ac.
At least a bit of it should make it to disk before suspending.

-Stefan

-------- Original Message --------
Subject: [patch 1/9] acpi battery: work around negative s16 battery
current on Acer
Date: Thu, 06 Aug 2009 15:57:48 -0700
From: <email address hidden>
To: <email address hidden>
CC: <email address hidden>, <email address hidden>,
<email address hidden>, <email address hidden>

From: Hector Martin <email address hidden>

Acer Aspire 8930G laptops (and possibly others) report the battery current
as a 16-bit signed negative when it is charging. It also reports it as
0x10000 when the current is 0. This patch adds a quirk for this which
takes the absolute value of the reported current cast to an s16. This is
a DSDT bug present in the latest BIOS revision (the EC register is 16 bits
signed and the DSDT attempts to take the 16-bit two's complement of this,
which works for discharge but not charge. It also breaks zero values
because a 32-bit register is used and the high bits aren't thrown away).

I've enabled this for all Acer systems which report in mA units. This
should be safe since it won't break compliant systems unless they report a
current above 32A, which is insane. The patch also detects the valid
32-bit value -1, which indicates unknown status, and does not attempt the
fix in that case (note that this does not conflict with 16-bit -1, which
is 65535 as read normally and gets translated to 1mA).

Signed-off-by: Hector Martin <email address hidden>
Cc: Alexey Starikovskiy <email address hidden>
Cc: Len Brown <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
---

  drivers/acpi/battery.c | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)

diff -puN
drivers/acpi/battery.c~acpi-battery-work-around-negative-s16-battery-current-on-acer

drivers/acpi/battery.c
---
a/drivers/acpi/battery.c~acpi-battery-work-around-negative-s16-battery-current-on-acer
+++ a/drivers/acpi/battery.c
@@ -85,6 +85,10 @@ static const struct acpi_device_id batte

  MODULE_DEVICE_TABLE(acpi, battery_device_ids);

+/* For buggy DSDTs that report negative 16-bit values for either charging
+ * or discharging current and/or report 0 as 65536 due to bad math.
+ */
+#define QUIRK_SIGNED16_CURRENT 0x0001

  struct acpi_battery {
   struct mutex lock;
@@ -112,6 +116,7 @@ struct...

Read more...

Revision history for this message
Pete Graner (pgraner) wrote :

More more experimentation:

1. Wrote a test script (attached) that grabbed the output of /proc/acpi/battery in a loop then pulled the power plug. Never was actually able to capture the discharge event.

2. I found that:

 * If I boot the machine with AC attached, then pull the power plug the system will suspend.
 * If I boot the machine from battery (no AC attached), then pull the power plug the system will *not* suspend or just work as expected.

I've attached the output of:

grep -r . /proc/acpi/battery

from the case where the system was booted on AC and one where the system was booted on battery.

Revision history for this message
Pete Graner (pgraner) wrote :
Revision history for this message
Pete Graner (pgraner) wrote :
Revision history for this message
Stefan Bader (smb) wrote :

Test kernel with signed16 patch available at http://people.canonical.com/~smb/bug421985/

Changed in linux (Ubuntu):
assignee: nobody → Stefan Bader (stefan-bader-canonical)
status: New → In Progress
Revision history for this message
DS (ddswanson) wrote :

This bug also affects my mother-in-laws

hp pavilion ze4900.

Revision history for this message
Hilmy (hilmyh) wrote :

I also get this on my Acer Aspire One D150.

Revision history for this message
hectoralex (u2alex) wrote :

This bug is also manifesting itself on my Dell Inspiron 700m... my Dell D820, mini9, Sony VGN-t250, VGN-c140, do not manifest this bug.

Revision history for this message
Fred (ian-bews) wrote :

I'm getting this in Lucid on an Advent 4211 (MSI Wind u100?).

Whenever I pull the power cable (even when fully charged) I get notified of critical batter power 1% and the system hibernates.

Jaunty worked fine for me and I've not tried Karmic on this laptop.

Revision history for this message
Fred (ian-bews) wrote :

This looks similar to:
#471111
#490632
#516023

Revision history for this message
T.F. Torrey (tftorrey) wrote :

This also affects my Dell Inspiron 710m.

Revision history for this message
lohapuk (lohapuk) wrote :

This also affects me rock xtreme ctx pro

Revision history for this message
Konstantin Lavrov (lacosta) wrote :

Just subscribe here. I have LG X110 but already post my comment to 473552 and 516023.

Like Fred I not tested my netbook with Karmic because of lots of Karmic's problems with Wind 100 and clones.

Seems this bug is fully equal to 516023 though only 473552 is confirmed.

Revision history for this message
DanJHamilton (dan-spamilton) wrote :

This also affects my Dell Inspiron 710m.

Revision history for this message
David Tombs (dgtombs) wrote :

Since Fred marked this as a dupe with no comment, I am un-marking since this bug has some development activity going on.

Revision history for this message
David Tombs (dgtombs) wrote :

Can anyone experiencing the issue confirm that the patched kernel by Stefan <http://people.canonical.com/~smb/bug421985/> fixes it?

Revision history for this message
David Tombs (dgtombs) wrote :

See <https://bugs.launchpad.net/ubuntu/+source/devicekit-power/+bug/473552/comments/28> for some feedback about the patched kernel. Seems it might have caused some other issues.

Revision history for this message
Ben Shephard (ben-bshephard) wrote :

 I tried Stefan's kernel patch on David's recommendation see <https://bugs.launchpad.net/ubuntu/+source/devicekit-power/+bug/473552/comments/28> and since installing my machine seems fairly stable when running on battery. I've gone through several charge / discharge cycles now without the machine suddenly performing the action set for critical battery level in power management options however when on charge the charge rate is still being reported at about 720 watts. Also the CPU temperature being reported is way out of whack at 51000 degrees meaning my fan is constantly running

Revision history for this message
Ben Shephard (ben-bshephard) wrote :

I've now moved to Fedora 12 and the install has revealed the cause of my fan control problem. The fan running constantly and possibly the high temperature value is down the the acer aspire one BIOS upgrade I did just after applying the patch which breaks all third party fan control apps including in windows.

As for the original power management bug I've noticed that the AC being unplugged after a charge wasn't properly detected just as in Ubuntu. I'm going to run this for a while and keep an eye on the rate of charge / discharge. The charge rate was also 720 watts when I checked earlier so I'm looking to see if it suddenly reports the battery being critically low again. It seems the power history graph is not installed by default on fedora so I can't check that. I've not found any way of of installing this on fedora as yet.

Revision history for this message
Oliver Etchebarne (drmad) wrote :

I've been posting my netbook details on similar bug report #481312. I have a Acer Aspire One D150-1452 and Ubuntu 10.04 affected by this bug.

Revision history for this message
David Tombs (dgtombs) wrote :

@Christiaan: Please comment when marking as duplicate, this bug might be a different issue.

@Pete: You have obviously researched this quite a bit. Do you think this is related to bug 531190?

Stefan Bader (smb)
Changed in linux (Ubuntu):
assignee: Stefan Bader (stefan-bader-canonical) → nobody
status: In Progress → Triaged
Revision history for this message
David Tombs (dgtombs) wrote :

From IRC:

pgraner: Ah sorry I did forget about it, the colovo fried it power supply so its not operational anymore

I'm going to invalidate this bug since it's no longer reproducible for now. If you get your power supply fixed, Pete, let us know!

Changed in linux (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Gena Thompson (unseeliebean) wrote :

this bug also affects my HP G61.

Revision history for this message
Sarah Weiss (sam81452667) wrote :

bug affects me too, running ubuntu 10.04 on advent 4213

Revision history for this message
Anthony Vickers (tattyheaded) wrote :

This bug also affects the Medion Akoya E1210 (MSI Wind u100 clone) with latest bios firmware.

Pete Graner (pgraner)
Changed in linux (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Karolis (karolismatjosaitis) wrote :

Bug affects me to. Running Ubuntu 11.10. Found temporary solution: removing indicator-power package.

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.