Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Rolf Eike Beer
Alexey Starikovskiy wrote:
> Rolf Eike Beer wrote:
> > Alexey Starikovskiy wrote:
> >> Rolf Eike Beer wrote:
> >>> Alexey Starikovskiy wrote:
>  Rolf Eike Beer wrote:
> > Rolf Eike Beer wrote:
> >> Hi,
> >>
> >> this happened while I removed my battery on bootup. Complete dmesg
> >> is attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
> >> d919fd433b5823d1cf9d0688eb2eec183de9b74c).
> >
> > Ok, I found out that it has nothing to do with the actual removal as
> > it seems. When I start the laptop with battery already detached I get
> > the same error.
> 
>  Please check if this patch helps.
> >>>
> >>> It made things worse:
> >>
> >> How about this patch?
> >
> > Ehm, that is the same patch as before!
>
> Yes, sorry... Two patches in parallel -- not good.

Tested-by: Rolf Eike Beer <[EMAIL PROTECTED]>

It makes the crash go away. But there is something weird going on. Before I 
logged into X I did an "cat /proc/acpi/battery/BAT1/*" and it showed the 
battery as present with some (random?) values. Now I'm in X and everything 
looks fine there (as in "not present").

Eike


signature.asc
Description: This is a digitally signed message part.


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Alexey Starikovskiy

Rolf Eike Beer wrote:

Alexey Starikovskiy wrote:

Rolf Eike Beer wrote:

Alexey Starikovskiy wrote:

Rolf Eike Beer wrote:

Rolf Eike Beer wrote:

Hi,

this happened while I removed my battery on bootup. Complete dmesg is
attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
d919fd433b5823d1cf9d0688eb2eec183de9b74c).

Ok, I found out that it has nothing to do with the actual removal as it
seems. When I start the laptop with battery already detached I get the
same error.

Please check if this patch helps.

It made things worse:

How about this patch?


Ehm, that is the same patch as before!

Yes, sorry... Two patches in parallel -- not good.

Btw: it has an empty From: line

I know, thanks.


Eike

Patch updated.
ACPI: Battery: remove cycle from battery removal.

From:  <>

get_property() should not call battery_update() on absent battery to
avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/battery.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..ca37db4 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -140,10 +140,11 @@ static int acpi_battery_get_property(struct power_supply *psy,
 {
 	struct acpi_battery *battery = to_acpi_battery(psy);
 
-	if ((!acpi_battery_present(battery)) &&
-	 psp != POWER_SUPPLY_PROP_PRESENT)
+	if (acpi_battery_present(battery)) {
+		/* run battery update only if it is present */
+		acpi_battery_update(battery);
+	} else if (psp != POWER_SUPPLY_PROP_PRESENT)
 		return -ENODEV;
-	acpi_battery_update(battery);
 	switch (psp) {
 	case POWER_SUPPLY_PROP_STATUS:
 		if (battery->state & 0x01)
@@ -457,6 +458,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
 		return;
 	device_remove_file(battery->bat.dev, &alarm_attr);
 	power_supply_unregister(&battery->bat);
+	battery->bat.dev = NULL;
 }
 
 static int acpi_battery_update(struct acpi_battery *battery)


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Rolf Eike Beer
Alexey Starikovskiy wrote:
> Rolf Eike Beer wrote:
> > Alexey Starikovskiy wrote:
> >> Rolf Eike Beer wrote:
> >>> Rolf Eike Beer wrote:
>  Hi,
> 
>  this happened while I removed my battery on bootup. Complete dmesg is
>  attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
>  d919fd433b5823d1cf9d0688eb2eec183de9b74c).
> >>>
> >>> Ok, I found out that it has nothing to do with the actual removal as it
> >>> seems. When I start the laptop with battery already detached I get the
> >>> same error.
> >>
> >> Please check if this patch helps.
> >
> > It made things worse:
>
> How about this patch?

Ehm, that is the same patch as before!

Btw: it has an empty From: line

Eike


signature.asc
Description: This is a digitally signed message part.


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Alexey Starikovskiy

Rolf Eike Beer wrote:

Alexey Starikovskiy wrote:

Rolf Eike Beer wrote:

Rolf Eike Beer wrote:

Hi,

this happened while I removed my battery on bootup. Complete dmesg is
attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
d919fd433b5823d1cf9d0688eb2eec183de9b74c).

Ok, I found out that it has nothing to do with the actual removal as it
seems. When I start the laptop with battery already detached I get the
same error.



Please check if this patch helps.


It made things worse:

How about this patch?
ACPI: Battery: remove cycle from battery removal.

From:  <>

get_property() should not call battery_update() on absent battery to
avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/battery.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..50cdf6f 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -140,10 +140,11 @@ static int acpi_battery_get_property(struct power_supply *psy,
 {
 	struct acpi_battery *battery = to_acpi_battery(psy);
 
-	if ((!acpi_battery_present(battery)) &&
-	 psp != POWER_SUPPLY_PROP_PRESENT)
+	if (acpi_battery_present(battery)) {
+		/* run battery update only if it is present */
+		acpi_battery_update(battery);
+	} else if (psp != POWER_SUPPLY_PROP_PRESENT)
 		return -ENODEV;
-	acpi_battery_update(battery);
 	switch (psp) {
 	case POWER_SUPPLY_PROP_STATUS:
 		if (battery->state & 0x01)


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Rolf Eike Beer
Alexey Starikovskiy wrote:
> Rolf Eike Beer wrote:
> > Rolf Eike Beer wrote:
> >> Hi,
> >>
> >> this happened while I removed my battery on bootup. Complete dmesg is
> >> attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
> >> d919fd433b5823d1cf9d0688eb2eec183de9b74c).
> >
> > Ok, I found out that it has nothing to do with the actual removal as it
> > seems. When I start the laptop with battery already detached I get the
> > same error.

> Please check if this patch helps.

It made things worse:

Nov  2 12:37:20 donald kernel: ACPI: EC: non-query interrupt received, 
switching to interrupt mode
Nov  2 12:37:20 donald acpid: received event "battery BAT1 0080 "
Nov  2 12:37:20 donald acpid: notifying client 2856[101:102]
Nov  2 12:37:20 donald acpid: notifying client 2911[0:0]
Nov  2 12:37:20 donald acpid: notifying client 3048[0:0]
Nov  2 12:37:20 donald acpid: completed event "battery BAT1 0080 "
Nov  2 12:37:20 donald kernel: WARNING: 
at /home/eike/repos/linux-2.6/lib/kref.c:33 kref_get()
Nov  2 12:37:20 donald kernel:  [] show_trace_log_lvl+0x1a/0x2f
Nov  2 12:37:20 donald kernel:  [] show_trace+0x12/0x14
Nov  2 12:37:20 donald kernel:  [] dump_stack+0x16/0x18
Nov  2 12:37:20 donald kernel:  [] kref_get+0x37/0x43
Nov  2 12:37:20 donald kernel:  [] kobject_get+0x12/0x17
Nov  2 12:37:20 donald kernel:  [] get_device+0x13/0x1d
Nov  2 12:37:20 donald kernel:  [] device_remove_file+0xe/0x2a
Nov  2 12:37:20 donald kernel:  [] sysfs_remove_battery+0x17/0x22 
[battery]
Nov  2 12:37:20 donald kernel:  [] acpi_battery_update+0x3f/0x255 
[battery]
Nov  2 12:37:20 donald kernel:  [] acpi_battery_read+0x11/0x20 
[battery]
Nov  2 12:37:20 donald powersaved[3048]: WARNING (filter_function:201) Hal 
service stopped. Battery information no longer available
Nov  2 12:37:20 donald kernel:  [] acpi_battery_read_state+0xf/0x11 
[battery]
Nov  2 12:37:20 donald kernel:  [] seq_read+0xea/0x264
Nov  2 12:37:20 donald kernel:  [] proc_reg_read+0x63/0x76
Nov  2 12:37:20 donald kernel:  [] vfs_read+0xa6/0x12f
Nov  2 12:37:20 donald kernel:  [] sys_read+0x3d/0x61
Nov  2 12:37:20 donald kernel:  [] sysenter_past_esp+0x5f/0x85
Nov  2 12:37:20 donald kernel:  ===
Nov  2 12:37:20 donald kernel: WARNING: 
at /home/eike/repos/linux-2.6/lib/kref.c:33 kref_get()
Nov  2 12:37:20 donald kernel:  [] show_trace_log_lvl+0x1a/0x2f
Nov  2 12:37:20 donald kernel:  [] show_trace+0x12/0x14
Nov  2 12:37:20 donald kernel:  [] dump_stack+0x16/0x18
Nov  2 12:37:20 donald kernel:  [] kref_get+0x37/0x43
Nov  2 12:37:20 donald kernel:  [] kobject_get+0x12/0x17
Nov  2 12:37:20 donald kernel:  [] get_device+0x13/0x1d
Nov  2 12:37:20 donald kernel:  [] device_remove_file+0xe/0x2a
Nov  2 12:37:20 donald kernel:  [] 
power_supply_remove_attrs+0x16/0x37 [power_supply]
Nov  2 12:37:20 donald kernel:  [] power_supply_unregister+0x12/0x1d 
[power_supply]
Nov  2 12:37:20 donald kernel:  [] sysfs_remove_battery+0x1f/0x22 
[battery]
Nov  2 12:37:20 donald kernel:  [] acpi_battery_update+0x3f/0x255 
[battery]
Nov  2 12:37:20 donald kernel:  [] acpi_battery_read+0x11/0x20 
[battery]
Nov  2 12:37:20 donald kernel:  [] acpi_battery_read_state+0xf/0x11 
[battery]
Nov  2 12:37:20 donald kernel:  [] seq_read+0xea/0x264
Nov  2 12:37:20 donald kernel:  [] proc_reg_read+0x63/0x76
Nov  2 12:37:20 donald kernel:  [] vfs_read+0xa6/0x12f
Nov  2 12:37:20 donald kernel:  [] sys_read+0x3d/0x61
Nov  2 12:37:20 donald kernel:  [] sysenter_past_esp+0x5f/0x85
Nov  2 12:37:20 donald kernel:  ===

tons more of stuff like this, system us unusable with this kernel now. In the 
meantime I upgraded to current git, last commit is now 
b4d367fb20ed19be4a53fa88b407248aeb8bd461

Eike


signature.asc
Description: This is a digitally signed message part.


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Alexey Starikovskiy

Rolf Eike Beer wrote:

Rolf Eike Beer wrote:

Hi,

this happened while I removed my battery on bootup. Complete dmesg is
attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
d919fd433b5823d1cf9d0688eb2eec183de9b74c).


Ok, I found out that it has nothing to do with the actual removal as it seems. 
When I start the laptop with battery already detached I get the same error.


Eike

Please check if this patch helps.

Thanks,
Alex.
ACPI: Battery: remove cycle from battery removal.

From:  <>

get_property() should not call battery_update() on absent battery to
avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/battery.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..50cdf6f 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -140,10 +140,11 @@ static int acpi_battery_get_property(struct power_supply *psy,
 {
 	struct acpi_battery *battery = to_acpi_battery(psy);
 
-	if ((!acpi_battery_present(battery)) &&
-	 psp != POWER_SUPPLY_PROP_PRESENT)
+	if (acpi_battery_present(battery)) {
+		/* run battery update only if it is present */
+		acpi_battery_update(battery);
+	} else if (psp != POWER_SUPPLY_PROP_PRESENT)
 		return -ENODEV;
-	acpi_battery_update(battery);
 	switch (psp) {
 	case POWER_SUPPLY_PROP_STATUS:
 		if (battery->state & 0x01)


Re: [2.6.24-rc1][BUG] Oops on battery removal

2007-11-02 Thread Rolf Eike Beer
Rolf Eike Beer wrote:
> Hi,
>
> this happened while I removed my battery on bootup. Complete dmesg is
> attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was
> d919fd433b5823d1cf9d0688eb2eec183de9b74c).

Ok, I found out that it has nothing to do with the actual removal as it seems. 
When I start the laptop with battery already detached I get the same error.

Eike


signature.asc
Description: This is a digitally signed message part.


[2.6.24-rc1][BUG] Oops on battery removal

2007-11-01 Thread Rolf Eike Beer
Hi,

this happened while I removed my battery on bootup. Complete dmesg is 
attached. Kernel is 2.6.24-rc1-git of yesterday (last commit was 
d919fd433b5823d1cf9d0688eb2eec183de9b74c).

Greetings,

Eike

BUG: unable to handle kernel NULL pointer dereference at virtual address 
001c
printing eip: c02a82cb *pde =  
Oops:  [#1] SMP 
Modules linked in: iptable_filter ip_tables ip6table_filter ip6_tables 
x_tables ipv6 af_packet cpufreq_conservative cpufreq_ondemand 
cpufreq_userspace cpufreq_powersave acpi_cpufreq speedstep_lib freq_table 
snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device twofish twofish_common cbc 
blkcipher dm_crypt nls_utf8 ntfs ext3 jbd loop mmc_block pcmcia container 
battery iwl3945 firmware_class yenta_socket button ohci1394 backlight output 
ac power_supply rsrc_nonstatic pcmcia_core mmc_core ieee1394 intel_agp joydev 
agpgart snd_hda_intel sr_mod cdrom r8169 snd_pcm snd_timer mac80211 snd 
soundcore snd_page_alloc i2c_i801 i2c_core cfg80211 serio_raw sg usbhid 
ehci_hcd uhci_hcd sd_mod usbcore dm_snapshot edd dm_mod fan ata_piix libata 
scsi_mod thermal processor

Pid: 47, comm: kacpi_notify Not tainted (2.6.24-rc1-git #68)
EIP: 0060:[] EFLAGS: 00010286 CPU: 0
EIP is at klist_del+0xc/0x39
EAX:  EBX:  ECX:  EDX: 
ESI: c2e2bc00 EDI: c2e2bc20 EBP: c1c88d7c ESP: c1c88d70
 DS: 007b ES: 007b FS: 00d8 GS:  SS: 0068
Process kacpi_notify (pid: 47, ti=c1c88000 task=c1cb5350 task.ti=c1c88000)
Stack: c2e2bc00 c2e2bc00 c1ce960c c1c88d90 c0231ab6 c2e2bc00 c2e2ba00 c1c88e1c 
   c1c88d9c c0231ced c2e2ba1c c1c88da8 f8bee01a c2e2ba00 c1c88db4 f8c3904b 
   c2e2ba00 c1c88de4 f8c391a2 c01d47bc c01d47bc 0001  80d0 
Call Trace:
 [] show_trace_log_lvl+0x1a/0x2f
 [] show_stack_log_lvl+0x9b/0xa3
 [] show_registers+0xa7/0x179
 [] die+0x114/0x1f5
 [] do_page_fault+0x4b0/0x589
 [] error_code+0x72/0x78
 [] device_del+0x1a/0x246
 [] device_unregister+0xb/0x15
 [] power_supply_unregister+0x1a/0x1d [power_supply]
 [] sysfs_remove_battery+0x1f/0x22 [battery]
 [] acpi_battery_update+0x3f/0x255 [battery]
 [] acpi_battery_get_property+0x2b/0x149 [battery]
 [] power_supply_show_property+0x32/0xf0 [power_supply]
 [] power_supply_uevent+0xfd/0x187 [power_supply]
 [] dev_uevent+0xca/0xe8
 [] kobject_uevent_env+0x15a/0x376
 [] kobject_uevent+0xa/0xc
 [] device_del+0x21d/0x246
 [] device_unregister+0xb/0x15
 [] power_supply_unregister+0x1a/0x1d [power_supply]
 [] sysfs_remove_battery+0x1f/0x22 [battery]
 [] acpi_battery_update+0x3f/0x255 [battery]
 [] acpi_battery_notify+0x1e/0x73 [battery]
 [] acpi_ev_notify_dispatch+0x4f/0x5a
 [] acpi_os_execute_notify+0x24/0x2f
 [] run_workqueue+0x7d/0x110
 [] worker_thread+0xbe/0xcd
 [] kthread+0x3b/0x64
 [] kernel_thread_helper+0x7/0x10
 ===
Code: 08 e8 63 20 00 00 83 7d f0 00 74 09 85 ff 74 05 89 f8 ff 55 f0 8b 45 ec 
5a 59 5b 5e 5f 5d c3 55 89 e5 57 89 c7 56 53 8b 18 89 d8 <8b> 73 1c e8 7b 20 
00 00 89 f8 e8 58 ff ff ff 85 c0 b8 00 00 00 
EIP: [] klist_del+0xc/0x39 SS:ESP 0068:c1c88d70
CPU0 attaching NULL sched-domain.
CPU1 attaching NULL sched-domain.
CPU0 attaching sched-domain:
 domain 0: span 3
  groups: 1 2
CPU1 attaching sched-domain:
 domain 0: span 3
  groups: 2 1
BUG: unable to handle kernel NULL pointer dereference at virtual address 
001c
printing eip: c02a82cb *pde =  
Oops:  [#2] SMP 
Modules linked in: iptable_filter ip_tables ip6table_filter ip6_tables 
x_tables ipv6 af_packet cpufreq_conservative cpufreq_ondemand 
cpufreq_userspace cpufreq_powersave acpi_cpufreq speedstep_lib freq_table 
snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device twofish twofish_common cbc 
blkcipher dm_crypt nls_utf8 ntfs ext3 jbd loop mmc_block pcmcia container 
battery iwl3945 firmware_class yenta_socket button ohci1394 backlight output 
ac power_supply rsrc_nonstatic pcmcia_core mmc_core ieee1394 intel_agp joydev 
agpgart snd_hda_intel sr_mod cdrom r8169 snd_pcm snd_timer mac80211 snd 
soundcore snd_page_alloc i2c_i801 i2c_core cfg80211 serio_raw sg usbhid 
ehci_hcd uhci_hcd sd_mod usbcore dm_snapshot edd dm_mod fan ata_piix libata 
scsi_mod thermal processor

Pid: 2773, comm: hald Tainted: G  D (2.6.24-rc1-git #68)
EIP: 0060:[] EFLAGS: 00010286 CPU: 1
EIP is at klist_del+0xc/0x39
EAX:  EBX:  ECX:  EDX: 
ESI: c2e2bc00 EDI: c2e2bc20 EBP: c33b9e8c ESP: c33b9e80
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process hald (pid: 2773, ti=c33b9000 task=c3304d30 task.ti=c33b9000)
Stack: c2e2bc00 c2e2bc00 c1ce960c c33b9ea0 c0231ab6 c2e2bc00 c2e2ba00 0001 
   c33b9eac c0231ced c2e2ba1c c33b9eb8 f8bee01a c2e2ba00 c33b9ec4 f8c3904b 
   c39b3ec0 c33b9ef4 f8c391a2 c0163a98 c27f1cbc 0246 c3bf9cf8 c33b9efc 
Call Trace:
 [] show_trace_log_lvl+0x1a/0x2f
 [] show_stack_log_lvl+0x9b/0xa3
 [] show_registers+0xa7/0x179
 [] die+0x114/0x1f5
 [] do_page_fault+0x4b0/0x589
 [] error_code+0x72/0x78
 [] device_del+0x1a/0x246
 [] device_unregister+0xb/0x15
 [] pow