System Suspends/Hibernates when AC is unplugged
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/
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,
Controls : 18
Simple ctrls : 12
Date: Mon Aug 31 22:02:14 2009
DistroRelease: Ubuntu 9.10
HibernationDevice: RESUME=
MachineType: CZC CZC
Package: linux-image-
PccardctlIdent:
PccardctlStatus:
ProcCmdLine: BOOT_IMAGE=
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
RelatedPackageV
linux-
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.
dmi.board.name: CZC
dmi.board.vendor: CZC
dmi.board.version: 1.0
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: CZC
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: CZC
dmi.product.
dmi.sys.vendor: CZC
Changed in linux (Ubuntu): | |
assignee: | Stefan Bader (stefan-bader-canonical) → nobody |
status: | In Progress → Triaged |
Changed in linux (Ubuntu): | |
status: | Invalid → Fix Released |
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 acpi/battery. c~acpi- battery- work-around- negative- s16-battery- current- on-acer
drivers/
drivers/ acpi/battery. c acpi/battery. c~acpi- battery- work-around- negative- s16-battery- current- on-acer acpi/battery. c
---
a/drivers/
+++ a/drivers/
@@ -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 CURRENT 0x0001
+ * or discharging current and/or report 0 as 65536 due to bad math.
+ */
+#define QUIRK_SIGNED16_
struct acpi_battery {
struct mutex lock;
@@ -112,6 +116,7 @@ struct...