Bug 8351

Summary: battery caching introduces a lock up
Product: ACPI Reporter: Marek Lotke (lollul)
Component: Power-BatteryAssignee: Vladimir Lebedev (vladimir.p.lebedev)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, vladimir.p.lebedev
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.21-rc6-mm broken-out-2007-04-11-02-24 Subsystem:
Regression: --- Bisected commit-id:
Attachments: battery_notify_patch

Description Marek Lotke 2007-04-19 10:33:12 UTC
Most recent kernel where this bug did *NOT* occur:
Distribution: gentoo
Hardware Environment: Lenovo N100 BIOS v2.03
Software Environment:
Problem Description: The patch "ACPI: Cache battery status instead of 
re-evaluating AML" locks up processes reading battery status. Loading with 
parameter battery_update = 5 doesn't help. Reverting this patch 
(b6ce4083ed8e2a01a3a59301eabe0fc1e68a8a84) fixes the issue. 
Here is a call trace:

hald          D F72A1CB4     0  1361   1085 (NOTLB)
       f72a1ccc 00000086 00000002 f72a1cb4 f72a1cb0 00000000 c024e060 00000001
       f7feda00 c1d11030 c1d194dc f7eb65b0 f9727f1e 0000001a f7eb66ac c1c02cc0
       00000001 0000028b c02552b4 00000003 00000000 01000003 c0241e14 fffcdb67
Call Trace:
 [<c024e060>] acpi_ns_opens_scope+0xb/0x43
 [<c02552b4>] acpi_ut_allocate_object_desc_dbg+0x29/0x60
 [<c0241e14>] acpi_ds_init_object_from_op+0x114/0x1e8
 [<c03211c2>] __mutex_lock_slowpath+0x52/0x90
 [<c0242418>] acpi_ds_create_operand+0x1cc/0x1d8
 [<c032100a>] mutex_lock+0xa/0x10
 [<c02594a1>] acpi_battery_notify+0x26/0xa3
 [<c024b380>] acpi_ex_exit_interpreter+0xa/0x2f
 [<c02448ba>] acpi_ev_queue_notify_request+0xd0/0xf2
 [<c024149d>] acpi_ds_exec_end_op+0xc2/0x3d1
 [<c024fe49>] acpi_ps_complete_op+0x1c5/0x1db
 [<c02503dd>] acpi_ps_parse_loop+0x57e/0x735
 [<c023f1b4>] acpi_os_release_object+0x8/0xe
 [<c024f85c>] acpi_ps_parse_aml+0x60/0x237
 [<c0243479>] acpi_ds_init_aml_walk+0xb4/0x102
 [<c0250ab2>] acpi_ps_execute_method+0x11b/0x1bd
 [<c024dd7d>] acpi_ns_evaluate+0x9d/0xfc
 [<c024d9d2>] acpi_evaluate_object+0x126/0x1d0
 [<c0173888>] get_empty_filp+0x58/0x130
 [<c02596f2>] acpi_battery_get_state+0x50/0xb1
 [<c02598cd>] acpi_battery_update+0x2e/0x8b
 [<c0259fed>] acpi_battery_read_state+0x5d/0x249
 [<c01628d6>] __vma_link+0x36/0x70
 [<c01758c9>] cp_new_stat64+0xf9/0x110
 [<c018c938>] seq_read+0x68/0x2b0
 [<c018c8d0>] seq_read+0x0/0x2b0
 [<c01a4cd0>] proc_reg_read+0x70/0xc0
 [<c0172c41>] vfs_read+0xa1/0x130
 [<c01a4c60>] proc_reg_read+0x0/0xc0
 [<c0173171>] sys_read+0x41/0x70
 [<c01041ca>] sysenter_past_esp+0x5f/0x85

Steps to reproduce: 
cat /proc/acpi/battery/BAT1/state (a few times)
Comment 1 Vladimir Lebedev 2007-04-20 00:39:09 UTC
Created attachment 11244 [details]
battery_notify_patch
Comment 2 Vladimir Lebedev 2007-04-20 00:42:25 UTC
Please try battery_notify_patch. 
 
Comment 3 Marek Lotke 2007-04-20 10:27:45 UTC
works nicely with the patch applied. thanks!
Comment 4 Len Brown 2007-04-21 19:43:01 UTC
patch in comment #1 applied to acpi-test
Comment 5 Len Brown 2007-07-25 22:27:27 UTC
patch in comment #1 shipped in 2.6.23-rc1
closed