Bug 8370

Summary: no battery after S4
Product: ACPI Reporter: Rudi Lippert (kernel)
Component: Power-BatteryAssignee: Alexey Starikovskiy (astarikovskiy)
Status: REJECTED INSUFFICIENT_DATA    
Severity: normal CC: acpi-bugzilla, bunk, vladimir.p.lebedev
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.20.3 and many 2.6.* before Subsystem:
Regression: --- Bisected commit-id:
Bug Depends on:    
Bug Blocks: 7216    
Attachments: acpidump with 2.6.20, battery not present
dmesg with 2.6.20, battery not present
dmesg with 2.6.21
acpidump with 2.6.21, battery not present
BAT0/* with 2.6.21, battery not present
acpidump with 2.6.21, after inserting battery in suspend
BAT0/* with 2.6.21, after inserting battery in suspend
acpidump with 2.6.21, battery present
BAT0/* with 2.6.21, battery present
acpidump with 2.6.21, after removing battery in suspend
BAT0/* with 2.6.21, after removing battery in suspend
dmesg with 2.6.21-rc7-mm2
acpidump with 2.6.21-rc7-mm2, after removing battery in suspend
BAT0/* with 2.6.21-rc7-mm2, after removing battery in suspend
first test from comment #17 (2.6.21)
second test from comment #17 (2.6.21)
output of patch -p1
first test
second test

Description Rudi Lippert 2007-04-25 01:04:13 UTC
Most recent kernel where this bug did *NOT* occur: none known
Distribution: Gentoo
Hardware Environment: ASUS laptop with Intel 82801 chipset

Problem Description: When the system is suspended to disk, the battery state is
not refreshed afterwards, i.e. if the battery is inserted while the computer is
powered off, ACPI does not know it's there or how full it is.

Steps to reproduce:
- cat /proc/acpi/battery/*/state
- Remove battery
- echo -n disk > /sys/power/state
- Insert battery
- cat /proc/acpi/battery/*/state (battery is still reported as not present)

This may be related to bug 4132
Comment 1 Vladimir Lebedev 2007-04-26 10:02:13 UTC
  
Please try 2.6.21 kernel and the last 'mm' kernel, attach acpidump and  
dmesg output. Please 'cat /proc/acpi/battery/*' few times and attach the 
results. 
 
  
Comment 2 Rudi Lippert 2007-04-27 01:25:54 UTC
Created attachment 11282 [details]
acpidump with 2.6.20, battery not present

I cannot change kernels at the moment, but I will do some more testing
tomorrow.
Comment 3 Vladimir Lebedev 2007-04-27 02:23:43 UTC
 
Please attach 2.6.20 dmesg output. 
 
Comment 4 Rudi Lippert 2007-04-27 06:20:45 UTC
Created attachment 11288 [details]
dmesg with 2.6.20, battery not present
Comment 5 Rudi Lippert 2007-04-28 00:15:40 UTC
Created attachment 11293 [details]
dmesg with 2.6.21
Comment 6 Rudi Lippert 2007-04-28 00:16:53 UTC
Created attachment 11294 [details]
acpidump with 2.6.21, battery not present
Comment 7 Rudi Lippert 2007-04-28 00:17:53 UTC
Created attachment 11295 [details]
BAT0/* with 2.6.21, battery not present
Comment 8 Rudi Lippert 2007-04-28 00:19:22 UTC
Created attachment 11296 [details]
acpidump with 2.6.21, after inserting battery in suspend
Comment 9 Rudi Lippert 2007-04-28 00:20:17 UTC
Created attachment 11297 [details]
BAT0/* with 2.6.21, after inserting battery in suspend
Comment 10 Rudi Lippert 2007-04-28 00:20:58 UTC
Created attachment 11298 [details]
acpidump with 2.6.21, battery present
Comment 11 Rudi Lippert 2007-04-28 00:21:41 UTC
Created attachment 11299 [details]
BAT0/* with 2.6.21, battery present
Comment 12 Rudi Lippert 2007-04-28 00:22:26 UTC
Created attachment 11300 [details]
acpidump with 2.6.21, after removing battery in suspend
Comment 13 Rudi Lippert 2007-04-28 00:23:15 UTC
Created attachment 11301 [details]
BAT0/* with 2.6.21, after removing battery in suspend
Comment 14 Rudi Lippert 2007-04-28 00:24:16 UTC
Created attachment 11302 [details]
dmesg with 2.6.21-rc7-mm2
Comment 15 Rudi Lippert 2007-04-28 00:25:21 UTC
Created attachment 11303 [details]
acpidump with 2.6.21-rc7-mm2, after removing battery in suspend
Comment 16 Rudi Lippert 2007-04-28 00:28:26 UTC
Created attachment 11304 [details]
BAT0/* with 2.6.21-rc7-mm2, after removing battery in suspend

In this case, ACPI seems to actually notice the battery is missing, which did
not happen in 2.6.20 or 2.6.21. When inserting the battery during suspend with
2.6.21-rc7-mm2, the behavior looks just like 2.6.21 to me. If you want me to
attach the other acpidumps for the mm kernel as well, let me know.
Comment 17 Vladimir Lebedev 2007-04-28 06:45:27 UTC
Please perform the following testing:

a)
remove battery
suspend
insert battery
resume
cat /proc/acpi/battery/*/* and /proc/acpi/ac_adapter/*/*
unplug/plug AC cable
cat /proc/acpi/battery/*/* and /proc/acpi/ac_adapter/*/*
send 'cat' output and dmesg

b)
remove battery
suspend
insert battery
resume
cat /proc/acpi/battery/*/* and /proc/acpi/ac_adapter/*/*
wait for 5 minutes
cat /proc/acpi/battery/*/* and /proc/acpi/ac_adapter/*/*
send 'cat' output and dmesg

Please test both kernels - 2.6.21 and 2.6.21-rc7-mm2.
Comment 18 Vladimir Lebedev 2007-05-17 13:13:47 UTC
Please test with 2.6.21, 2.6.22-rc*, or something later.
If this issue still exists, please re-open this bug report.

Comment 19 Rudi Lippert 2007-05-21 00:07:16 UTC
Created attachment 11557 [details]
first test from comment #17 (2.6.21)
Comment 20 Rudi Lippert 2007-05-21 00:11:05 UTC
Created attachment 11558 [details]
second test from comment #17 (2.6.21)
Comment 21 Rudi Lippert 2007-05-24 04:13:31 UTC
Comment on attachment 11557 [details]
first test from comment #17 (2.6.21)

test passed
Comment 22 Rudi Lippert 2007-05-24 04:14:53 UTC
Comment on attachment 11558 [details]
second test from comment #17 (2.6.21)

test failed
Comment 23 Rafael J. Wysocki 2007-06-04 10:08:39 UTC
Can you please try 2.6.22-rc3 with the patchset from
http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.22-rc3/patches/ applied?
Comment 24 Rudi Lippert 2007-06-04 12:07:40 UTC
Created attachment 11676 [details]
output of patch -p1

For some strange reason some of the patches failagainst a vanilla 2.6.22-rc3.
Should I apply them anyway?
Comment 25 Rudi Lippert 2007-06-04 12:11:50 UTC
Comment on attachment 11676 [details]
output of patch -p1

Sorry, too dumb to patch. I'll be testing it now.
Comment 26 Rudi Lippert 2007-06-04 13:03:56 UTC
Created attachment 11678 [details]
first test

Again, the battery is only detected after toggling the AC adaptor
Comment 27 Rudi Lippert 2007-06-04 13:05:55 UTC
Created attachment 11679 [details]
second test

Battery is not detected at all.

To me (dummy), everything looks the same as with 2.6.21.
Comment 28 Rafael J. Wysocki 2007-08-08 10:19:15 UTC
Can you please try the 2.6.23-rc2 kernel?
Comment 29 Adrian Bunk 2007-09-16 13:41:51 UTC
Please reopen this bug if it's still present with kernel 2.6.23-rc6.