linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.24-rc1: OOPS at  acpi_battery_update
@ 2007-10-29 10:11 Romano Giannetti
  2007-11-01 23:14 ` Andrew Morton
  0 siblings, 1 reply; 23+ messages in thread
From: Romano Giannetti @ 2007-10-29 10:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-acpi


Hi,

	sometime on resuming from s2ram my laptop spew the following oops.
Config, dmesg etc are at: 

http://www.dea.icai.upcomillas.es/romano/linux/info/2624rc1_6/

[    3.475386] Oops: 0000 [#1] SMP 
[    3.475602] Process kacpi_notify (pid: 50, ti=c2122000 task=c210c030 task.ti=c2122000)
[    3.475608] Stack: c35c5060 c02f2a58 00000046 00000000 6b6b6b6b c2b20298 c2123efc c02f29ac 
[    3.475626]        c02166cb f896f3ca 00000000 f896ff63 00000246 00000000 c2b20298 ffffa512 
[    3.475644]        c2123f04 c02f2a58 c2123f34 f896f3ed c2123f1c c34fbdb8 c2123f20 c02f3e22 
[    3.475662] Call Trace:
[    3.475667]  [show_trace_log_lvl+26/48] show_trace_log_lvl+0x1a/0x30
[    3.475678]  [show_stack_log_lvl+177/224] show_stack_log_lvl+0xb1/0xe0
[    3.475695]  [die+282/560] die+0x11a/0x230
[    3.475687]  [show_registers+193/464] show_registers+0xc1/0x1d0
[    3.475703]  [do_page_fault+415/1648] do_page_fault+0x19f/0x670
[    3.475713]  [error_code+114/120] error_code+0x72/0x78
[    3.475722]  [__mutex_unlock_slowpath+172/336] __mutex_unlock_slowpath+0xac/0x150
[    3.475731]  [mutex_unlock+8/16] mutex_unlock+0x8/0x10
[    3.475739]  [<f896f3ed>] acpi_battery_update+0x1ce/0x23c [battery]
[    3.475753]  [<f896f927>] acpi_battery_notify+0x21/0x78 [battery]
[    3.475764]  [acpi_ev_notify_dispatch+79/90] acpi_ev_notify_dispatch+0x4f/0x5a
[    3.475792]  [worker_thread+157/256] worker_thread+0x9d/0x100
[    3.475774]  [acpi_os_execute_notify+36/47] acpi_os_execute_notify+0x24/0x2f
[    3.475784]  [run_workqueue+288/464] run_workqueue+0x120/0x1d0
[    3.475809]  [kernel_thread_helper+7/16] kernel_thread_helper+0x7/0x10
[    3.475801]  [kthread+66/112] kthread+0x42/0x70
[    3.475821] Code: 8d b4 26 00 00 00 00 55 89 e5 83 ec 18 89 5d f8 89 c3 89 75 fc 0f b6 40 04 89 d6 84 c0 7f 24 8d 43 20 3b 43 20 0f 84 e4 00 00 00 <3b> 76 10 0f 85 93 00 00 00 3b 36 90 74 47 8b 5d f8 8b 75 fc 89 
[    3.475818]  =======================
[    3.475909] EIP: [debug_mutex_wake_waiter+36/352] debug_mutex_wake_waiter+0x24/0x160 SS:ESP 0068:c2123ebc




-- 
Sorry for the disclaimer --- ¡I cannot stop it!



--
La presente comunicación tiene carácter confidencial y es para el exclusivo uso del destinatario indicado en la misma. Si Ud. no es el destinatario indicado, le informamos que cualquier forma de distribución, reproducción o uso de esta comunicación y/o de la información contenida en la misma están estrictamente prohibidos por la ley. Si Ud. ha recibido esta comunicación por error, por favor, notifíquelo inmediatamente al remitente contestando a este mensaje y proceda a continuación a destruirlo. Gracias por su colaboración.

This communication contains confidential information. It is for the exclusive use of the intended addressee. If you are not the intended addressee, please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited by law. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this message. Thank you for your cooperation. 
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-10-29 10:11 2.6.24-rc1: OOPS at acpi_battery_update Romano Giannetti
@ 2007-11-01 23:14 ` Andrew Morton
  2007-11-02 16:08   ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Andrew Morton @ 2007-11-01 23:14 UTC (permalink / raw)
  To: Romano Giannetti; +Cc: linux-kernel, linux-acpi

On Mon, 29 Oct 2007 11:11:04 +0100
Romano Giannetti <romanol@upcomillas.es> wrote:

> 
> Hi,
> 
> 	sometime on resuming from s2ram my laptop spew the following oops.
> Config, dmesg etc are at: 
> 
> http://www.dea.icai.upcomillas.es/romano/linux/info/2624rc1_6/
> 
> [    3.475386] Oops: 0000 [#1] SMP 
> [    3.475602] Process kacpi_notify (pid: 50, ti=c2122000 task=c210c030 task.ti=c2122000)
> [    3.475608] Stack: c35c5060 c02f2a58 00000046 00000000 6b6b6b6b c2b20298 c2123efc c02f29ac 
> [    3.475626]        c02166cb f896f3ca 00000000 f896ff63 00000246 00000000 c2b20298 ffffa512 
> [    3.475644]        c2123f04 c02f2a58 c2123f34 f896f3ed c2123f1c c34fbdb8 c2123f20 c02f3e22 
> [    3.475662] Call Trace:
> [    3.475667]  [show_trace_log_lvl+26/48] show_trace_log_lvl+0x1a/0x30
> [    3.475678]  [show_stack_log_lvl+177/224] show_stack_log_lvl+0xb1/0xe0
> [    3.475695]  [die+282/560] die+0x11a/0x230
> [    3.475687]  [show_registers+193/464] show_registers+0xc1/0x1d0
> [    3.475703]  [do_page_fault+415/1648] do_page_fault+0x19f/0x670
> [    3.475713]  [error_code+114/120] error_code+0x72/0x78
> [    3.475722]  [__mutex_unlock_slowpath+172/336] __mutex_unlock_slowpath+0xac/0x150
> [    3.475731]  [mutex_unlock+8/16] mutex_unlock+0x8/0x10
> [    3.475739]  [<f896f3ed>] acpi_battery_update+0x1ce/0x23c [battery]
> [    3.475753]  [<f896f927>] acpi_battery_notify+0x21/0x78 [battery]
> [    3.475764]  [acpi_ev_notify_dispatch+79/90] acpi_ev_notify_dispatch+0x4f/0x5a
> [    3.475792]  [worker_thread+157/256] worker_thread+0x9d/0x100
> [    3.475774]  [acpi_os_execute_notify+36/47] acpi_os_execute_notify+0x24/0x2f
> [    3.475784]  [run_workqueue+288/464] run_workqueue+0x120/0x1d0
> [    3.475809]  [kernel_thread_helper+7/16] kernel_thread_helper+0x7/0x10
> [    3.475801]  [kthread+66/112] kthread+0x42/0x70
> [    3.475821] Code: 8d b4 26 00 00 00 00 55 89 e5 83 ec 18 89 5d f8 89 c3 89 75 fc 0f b6 40 04 89 d6 84 c0 7f 24 8d 43 20 3b 43 20 0f 84 e4 00 00 00 <3b> 76 10 0f 85 93 00 00 00 3b 36 90 74 47 8b 5d f8 8b 75 fc 89 
> [    3.475818]  =======================
> [    3.475909] EIP: [debug_mutex_wake_waiter+36/352] debug_mutex_wake_waiter+0x24/0x160 SS:ESP 0068:c2123ebc
> 

Did any earlier kernels do this?  In other words, do you believe that this
is a bug which we added after 2.6.23 was released?

Thanks.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] ACPI: Battery: remove cycle from battery removal.
  2007-11-02 14:20 [2.6.24-rc1][BUG] Oops on " Rolf Eike Beer
@ 2007-11-02 15:32 ` Alexey Starikovskiy
  0 siblings, 0 replies; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-02 15:32 UTC (permalink / raw)
  To: LenBrown; +Cc: Linux-acpi

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

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---

 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)


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-01 23:14 ` Andrew Morton
@ 2007-11-02 16:08   ` Rafael J. Wysocki
  2007-11-04  9:34     ` *SPAM* " Romano Giannetti
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2007-11-02 16:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Romano Giannetti, linux-kernel, linux-acpi

On Friday, 2 November 2007 00:14, Andrew Morton wrote:
> On Mon, 29 Oct 2007 11:11:04 +0100
> Romano Giannetti <romanol@upcomillas.es> wrote:
> 
> > 
> > Hi,
> > 
> > 	sometime on resuming from s2ram my laptop spew the following oops.
> > Config, dmesg etc are at: 
> > 
> > http://www.dea.icai.upcomillas.es/romano/linux/info/2624rc1_6/
> > 
> > [    3.475386] Oops: 0000 [#1] SMP 
> > [    3.475602] Process kacpi_notify (pid: 50, ti=c2122000 task=c210c030 task.ti=c2122000)
> > [    3.475608] Stack: c35c5060 c02f2a58 00000046 00000000 6b6b6b6b c2b20298 c2123efc c02f29ac 
> > [    3.475626]        c02166cb f896f3ca 00000000 f896ff63 00000246 00000000 c2b20298 ffffa512 
> > [    3.475644]        c2123f04 c02f2a58 c2123f34 f896f3ed c2123f1c c34fbdb8 c2123f20 c02f3e22 
> > [    3.475662] Call Trace:
> > [    3.475667]  [show_trace_log_lvl+26/48] show_trace_log_lvl+0x1a/0x30
> > [    3.475678]  [show_stack_log_lvl+177/224] show_stack_log_lvl+0xb1/0xe0
> > [    3.475695]  [die+282/560] die+0x11a/0x230
> > [    3.475687]  [show_registers+193/464] show_registers+0xc1/0x1d0
> > [    3.475703]  [do_page_fault+415/1648] do_page_fault+0x19f/0x670
> > [    3.475713]  [error_code+114/120] error_code+0x72/0x78
> > [    3.475722]  [__mutex_unlock_slowpath+172/336] __mutex_unlock_slowpath+0xac/0x150
> > [    3.475731]  [mutex_unlock+8/16] mutex_unlock+0x8/0x10
> > [    3.475739]  [<f896f3ed>] acpi_battery_update+0x1ce/0x23c [battery]
> > [    3.475753]  [<f896f927>] acpi_battery_notify+0x21/0x78 [battery]
> > [    3.475764]  [acpi_ev_notify_dispatch+79/90] acpi_ev_notify_dispatch+0x4f/0x5a
> > [    3.475792]  [worker_thread+157/256] worker_thread+0x9d/0x100
> > [    3.475774]  [acpi_os_execute_notify+36/47] acpi_os_execute_notify+0x24/0x2f
> > [    3.475784]  [run_workqueue+288/464] run_workqueue+0x120/0x1d0
> > [    3.475809]  [kernel_thread_helper+7/16] kernel_thread_helper+0x7/0x10
> > [    3.475801]  [kthread+66/112] kthread+0x42/0x70
> > [    3.475821] Code: 8d b4 26 00 00 00 00 55 89 e5 83 ec 18 89 5d f8 89 c3 89 75 fc 0f b6 40 04 89 d6 84 c0 7f 24 8d 43 20 3b 43 20 0f 84 e4 00 00 00 <3b> 76 10 0f 85 93 00 00 00 3b 36 90 74 47 8b 5d f8 8b 75 fc 89 
> > [    3.475818]  =======================
> > [    3.475909] EIP: [debug_mutex_wake_waiter+36/352] debug_mutex_wake_waiter+0x24/0x160 SS:ESP 0068:c2123ebc
> > 
> 
> Did any earlier kernels do this?  In other words, do you believe that this
> is a bug which we added after 2.6.23 was released?

This might be the same as http://bugzilla.kernel.org/show_bug.cgi?id=9283

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: *SPAM* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-02 16:08   ` Rafael J. Wysocki
@ 2007-11-04  9:34     ` Romano Giannetti
  2007-11-04 13:17       ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Romano Giannetti @ 2007-11-04  9:34 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Andrew Morton, linux-kernel, linux-acpi


On Fri, 2007-11-02 at 17:08 +0100, Rafael J. Wysocki wrote:
> On Friday, 2 November 2007 00:14, Andrew Morton wrote:
> > On Mon, 29 Oct 2007 11:11:04 +0100
[OOPS removed]
> > 
> > Did any earlier kernels do this?  In other words, do you believe that this
> > is a bug which we added after 2.6.23 was released?

Never noticed it before. But it's happening just sometime (I've had it
just two times), so I cannot be sure.

> This might be the same as http://bugzilla.kernel.org/show_bug.cgi?id=9283

Hmmm... there is too little info for my level in that bug report to
understand if it's the same. 

Romano 

-- 
Sorry for the disclaimer --- ¡I cannot stop it!



--
La presente comunicación tiene carácter confidencial y es para el exclusivo uso del destinatario indicado en la misma. Si Ud. no es el destinatario indicado, le informamos que cualquier forma de distribución, reproducción o uso de esta comunicación y/o de la información contenida en la misma están estrictamente prohibidos por la ley. Si Ud. ha recibido esta comunicación por error, por favor, notifíquelo inmediatamente al remitente contestando a este mensaje y proceda a continuación a destruirlo. Gracias por su colaboración.

This communication contains confidential information. It is for the exclusive use of the intended addressee. If you are not the intended addressee, please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited by law. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this message. Thank you for your cooperation. 
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: *SPAM* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-04  9:34     ` *SPAM* " Romano Giannetti
@ 2007-11-04 13:17       ` Rafael J. Wysocki
  2007-11-04 23:29         ` Michael (rabenkind) Brandstetter
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2007-11-04 13:17 UTC (permalink / raw)
  To: Romano Giannetti; +Cc: Andrew Morton, linux-kernel, linux-acpi

On Sunday, 4 of November 2007, Romano Giannetti wrote:
> 
> On Fri, 2007-11-02 at 17:08 +0100, Rafael J. Wysocki wrote:
> > On Friday, 2 November 2007 00:14, Andrew Morton wrote:
> > > On Mon, 29 Oct 2007 11:11:04 +0100
> [OOPS removed]
> > > 
> > > Did any earlier kernels do this?  In other words, do you believe that this
> > > is a bug which we added after 2.6.23 was released?
> 
> Never noticed it before. But it's happening just sometime (I've had it
> just two times), so I cannot be sure.
> 
> > This might be the same as http://bugzilla.kernel.org/show_bug.cgi?id=9283
> 
> Hmmm... there is too little info for my level in that bug report to
> understand if it's the same. 

Then, please apply the patch from

http://bugzilla.kernel.org/attachment.cgi?id=13376&action=view

and see if the problem goes away.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-04 13:17       ` Rafael J. Wysocki
@ 2007-11-04 23:29         ` Michael (rabenkind) Brandstetter
  2007-11-05  0:18           ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Michael (rabenkind) Brandstetter @ 2007-11-04 23:29 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-kernel, linux-acpi

Am Sonntag, 4. November 2007 14:17:23 schrieben Sie:
> On Sunday, 4 of November 2007, Romano Giannetti wrote:
> > On Fri, 2007-11-02 at 17:08 +0100, Rafael J. Wysocki wrote:
> > > On Friday, 2 November 2007 00:14, Andrew Morton wrote:
> > > > On Mon, 29 Oct 2007 11:11:04 +0100

Hello!

> > [OOPS removed]
> >
> > > > Did any earlier kernels do this?  In other words, do you believe that
> > > > this is a bug which we added after 2.6.23 was released?

Yes the kernels prior to 2.6.24-rc1 did not have this bug.

The oops always appear when i plug in or remove the battery.

> > Never noticed it before. But it's happening just sometime (I've had it
> > just two times), so I cannot be sure.
> >
> > > This might be the same as
> > > http://bugzilla.kernel.org/show_bug.cgi?id=9283
> >
> > Hmmm... there is too little info for my level in that bug report to
> > understand if it's the same.
>
> Then, please apply the patch from
>
> http://bugzilla.kernel.org/attachment.cgi?id=13376&action=view
>
> and see if the problem goes away.

The bug went away on my Dell Latitude C610. I applied the patch on two boxes 
(2.6.24-rc1-git12) and the haldaemon is not killed and no oops when i remove 
the battery or plug it in. 

But on the Portege 3110CT the bug remains.

greetz Michael :))
-- 
Duisburger Linux User Group
Free Software Foundation Europe

  /"\        ASCII Ribbon Campaign
  \ /        No HTML/RTF in email
   x         No Word docs in email
  / \        Respect for open standards

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-04 23:29         ` Michael (rabenkind) Brandstetter
@ 2007-11-05  0:18           ` Rafael J. Wysocki
  2007-11-08 15:53             ` Johannes Weiner
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2007-11-05  0:18 UTC (permalink / raw)
  To: Michael (rabenkind) Brandstetter; +Cc: linux-kernel, linux-acpi

On Monday, 5 of November 2007, Michael (rabenkind) Brandstetter wrote:
> Am Sonntag, 4. November 2007 14:17:23 schrieben Sie:
> > On Sunday, 4 of November 2007, Romano Giannetti wrote:
> > > On Fri, 2007-11-02 at 17:08 +0100, Rafael J. Wysocki wrote:
> > > > On Friday, 2 November 2007 00:14, Andrew Morton wrote:
> > > > > On Mon, 29 Oct 2007 11:11:04 +0100
> 
> Hello!
> 
> > > [OOPS removed]
> > >
> > > > > Did any earlier kernels do this?  In other words, do you believe that
> > > > > this is a bug which we added after 2.6.23 was released?
> 
> Yes the kernels prior to 2.6.24-rc1 did not have this bug.
> 
> The oops always appear when i plug in or remove the battery.
> 
> > > Never noticed it before. But it's happening just sometime (I've had it
> > > just two times), so I cannot be sure.
> > >
> > > > This might be the same as
> > > > http://bugzilla.kernel.org/show_bug.cgi?id=9283
> > >
> > > Hmmm... there is too little info for my level in that bug report to
> > > understand if it's the same.
> >
> > Then, please apply the patch from
> >
> > http://bugzilla.kernel.org/attachment.cgi?id=13376&action=view
> >
> > and see if the problem goes away.
> 
> The bug went away on my Dell Latitude C610. I applied the patch on two boxes 
> (2.6.24-rc1-git12) and the haldaemon is not killed and no oops when i remove 
> the battery or plug it in. 
> 
> But on the Portege 3110CT the bug remains.

Well, please create a bug report at http://bugzilla.kernel.org regarding this
bug and place all of the relevant information in there (including what boxes
are fixed by the above patch etc.) Also please add my address to the report's
CC list.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-05  0:18           ` Rafael J. Wysocki
@ 2007-11-08 15:53             ` Johannes Weiner
  2007-11-08 16:16               ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Johannes Weiner @ 2007-11-08 15:53 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Michael (rabenkind) Brandstetter, linux-kernel, linux-acpi

Hi,

is there any reason, why acpi_battery_get_property() should call
acpi_battery_update() at all?

	Hannes

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 16:16               ` Rafael J. Wysocki
@ 2007-11-08 16:11                 ` Alexey Starikovskiy
  2007-11-08 16:46                   ` Johannes Weiner
  2007-11-08 16:35                 ` Alexey Starikovskiy
  1 sibling, 1 reply; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-08 16:11 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Johannes Weiner, Michael (rabenkind) Brandstetter, linux-kernel,
	linux-acpi

Rafael J. Wysocki wrote:
> On Thursday, 8 of November 2007, Johannes Weiner wrote:
>> Hi,
>>
>> is there any reason, why acpi_battery_get_property() should call
>> acpi_battery_update() at all?
> 
> Alex?
If someone wants to read stale values, he could comment out acpi_battery_update.

Regards,
Alex.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 15:53             ` Johannes Weiner
@ 2007-11-08 16:16               ` Rafael J. Wysocki
  2007-11-08 16:11                 ` Alexey Starikovskiy
  2007-11-08 16:35                 ` Alexey Starikovskiy
  0 siblings, 2 replies; 23+ messages in thread
From: Rafael J. Wysocki @ 2007-11-08 16:16 UTC (permalink / raw)
  To: Johannes Weiner, Alexey Starikovskiy
  Cc: Michael (rabenkind) Brandstetter, linux-kernel, linux-acpi

On Thursday, 8 of November 2007, Johannes Weiner wrote:
> Hi,
> 
> is there any reason, why acpi_battery_get_property() should call
> acpi_battery_update() at all?

Alex?

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 16:16               ` Rafael J. Wysocki
  2007-11-08 16:11                 ` Alexey Starikovskiy
@ 2007-11-08 16:35                 ` Alexey Starikovskiy
  2007-11-08 16:58                   ` Johannes Weiner
  2007-11-09  4:34                   ` Andrew Morton
  1 sibling, 2 replies; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-08 16:35 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Johannes Weiner, Michael (rabenkind) Brandstetter, linux-kernel,
	linux-acpi

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

Rafael J. Wysocki wrote:
> On Thursday, 8 of November 2007, Johannes Weiner wrote:
>> Hi,
>>
>> is there any reason, why acpi_battery_get_property() should call
>> acpi_battery_update() at all?
> 
> Alex?
Do you mean "why should it call _whole_ battery update?" ?
get_state should be sufficient in order to not get stale data.

Regards,
Alex.

[-- Attachment #2: remove_cycle_at_battery_removal.patch --]
[-- Type: text/x-patch, Size: 1733 bytes --]

ACPI: Battery: remove cycle from battery removal.

From: Alexey Starikovskiy <astarikovskiy@suse.de>

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

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---

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

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..192c244 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,7 +132,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
-static int acpi_battery_update(struct acpi_battery *battery);
+static int acpi_battery_get_state(struct acpi_battery *battery);
 
 static int acpi_battery_get_property(struct power_supply *psy,
 				     enum power_supply_property psp,
@@ -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_get_state(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)

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 16:11                 ` Alexey Starikovskiy
@ 2007-11-08 16:46                   ` Johannes Weiner
  0 siblings, 0 replies; 23+ messages in thread
From: Johannes Weiner @ 2007-11-08 16:46 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Rafael J. Wysocki, Johannes Weiner,
	Michael (rabenkind) Brandstetter, linux-kernel, linux-acpi

Hi,

On Thu, Nov 08, 2007 at 07:11:53PM +0300, Alexey Starikovskiy wrote:
> Rafael J. Wysocki wrote:
> >On Thursday, 8 of November 2007, Johannes Weiner wrote:
> >>Hi,
> >>
> >>is there any reason, why acpi_battery_get_property() should call
> >>acpi_battery_update() at all?
> >
> >Alex?
> If someone wants to read stale values, he could comment out 
> acpi_battery_update.

Please help me to understand:

When the battery is plugged in, the acpi_battery_notify() is called,
which in turn calls acpi_battery_update(). The latter ensures that the
sysfs files are created if not yet present.

When the battery is removed, acpi_battery_notify is called, which in
turn calls acpi_battery_update(). The latter ensures that the sysfs
files are removed if present.

During runtime - as far as I understood - no sysfs files have to be
created/removed but the saved battery state info becomes stale.

So, would it be enough to call acpi_battery_get_state() in
acpi_battery_get_property() instead of acpi_battery_update()?

If acpi_battery_get_state() does what I think it does, this would
ensure that the battery state is reread and updated when
acpi_battery_get_property() is called.

Hit me.

	Hannes

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 16:35                 ` Alexey Starikovskiy
@ 2007-11-08 16:58                   ` Johannes Weiner
  2007-11-09  4:34                   ` Andrew Morton
  1 sibling, 0 replies; 23+ messages in thread
From: Johannes Weiner @ 2007-11-08 16:58 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Rafael J. Wysocki, Michael (rabenkind) Brandstetter, linux-kernel,
	linux-acpi

Hi Alex,

On Thu, Nov 08, 2007 at 07:35:23PM +0300, Alexey Starikovskiy wrote:
> Rafael J. Wysocki wrote:
> >On Thursday, 8 of November 2007, Johannes Weiner wrote:
> >>Hi,
> >>
> >>is there any reason, why acpi_battery_get_property() should call
> >>acpi_battery_update() at all?
> >
> >Alex?
> Do you mean "why should it call _whole_ battery update?" ?
> get_state should be sufficient in order to not get stale data.

Okay, than I understood it correct.

Acked-by: Johannes Weiner <hannes@saeurebad.de>

Thanks!

	Hannes

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-08 16:35                 ` Alexey Starikovskiy
  2007-11-08 16:58                   ` Johannes Weiner
@ 2007-11-09  4:34                   ` Andrew Morton
  2007-11-09  9:36                     ` Alexey Starikovskiy
  1 sibling, 1 reply; 23+ messages in thread
From: Andrew Morton @ 2007-11-09  4:34 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: rjw, hannes-kernel, listen, linux-kernel, linux-acpi, Len Brown

A> On Thu, 08 Nov 2007 19:35:23 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:
> [remove_cycle_at_battery_removal.patch  text/x-patch (1.7KB)]
> ACPI: Battery: remove cycle from battery removal.
> 
> From: Alexey Starikovskiy <astarikovskiy@suse.de>
> 
> get_property() should not call battery_update() on absent battery to
> avoid cycle and oops.
> 
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

A patch similar to this one but with an identical changelog was merged into
Len's tree on November 2.

If it had been promptly merged into mainline then quite a lot of people's
time would not have been wasted.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-09  4:34                   ` Andrew Morton
@ 2007-11-09  9:36                     ` Alexey Starikovskiy
  2007-11-09  9:49                       ` Andrew Morton
  0 siblings, 1 reply; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-09  9:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: rjw, hannes-kernel, listen, linux-kernel, linux-acpi, Len Brown

Andrew Morton wrote:
> A> On Thu, 08 Nov 2007 19:35:23 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:
>> [remove_cycle_at_battery_removal.patch  text/x-patch (1.7KB)]
>> ACPI: Battery: remove cycle from battery removal.
>>
>> From: Alexey Starikovskiy <astarikovskiy@suse.de>
>>
>> get_property() should not call battery_update() on absent battery to
>> avoid cycle and oops.
>>
>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> 
> A patch similar to this one but with an identical changelog was merged into
> Len's tree on November 2.
> 
> If it had been promptly merged into mainline then quite a lot of people's
> time would not have been wasted.
> 
Andrew,
should I send such patches directly to you/Linus?

Regards,
Alex

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-09  9:36                     ` Alexey Starikovskiy
@ 2007-11-09  9:49                       ` Andrew Morton
  2007-11-13  8:35                         ` Alexey Starikovskiy
  0 siblings, 1 reply; 23+ messages in thread
From: Andrew Morton @ 2007-11-09  9:49 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: rjw, hannes-kernel, listen, linux-kernel, linux-acpi, Len Brown

On Fri, 09 Nov 2007 12:36:43 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:

> Andrew Morton wrote:
> > A> On Thu, 08 Nov 2007 19:35:23 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:
> >> [remove_cycle_at_battery_removal.patch  text/x-patch (1.7KB)]
> >> ACPI: Battery: remove cycle from battery removal.
> >>
> >> From: Alexey Starikovskiy <astarikovskiy@suse.de>
> >>
> >> get_property() should not call battery_update() on absent battery to
> >> avoid cycle and oops.
> >>
> >> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> >> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> > 
> > A patch similar to this one but with an identical changelog was merged into
> > Len's tree on November 2.
> > 
> > If it had been promptly merged into mainline then quite a lot of people's
> > time would not have been wasted.
> > 
> Andrew,
> should I send such patches directly to you/Linus?
> 

Well if Len doesn't object and you're confident in the changes, why not? 
Any time we leave bugs unfixed we drive away testers and that impacts all
parts of the kernel.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-09  9:49                       ` Andrew Morton
@ 2007-11-13  8:35                         ` Alexey Starikovskiy
  2007-11-13  8:59                           ` Andrew Morton
  2007-11-13  9:23                           ` [PATCH] ACPI: Battery: remove cycle from battery removal Alexey Starikovskiy
  0 siblings, 2 replies; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-13  8:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Alexey Starikovskiy, rjw, hannes-kernel, listen, linux-kernel,
	linux-acpi, Len Brown

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

Andrew,

I can not contact with Len for several days, while the oops on battery 
seems quite important.
It also seem to behave well in -mm tree (as part of Len's acpi-test).
Will you send this patch to Linus without approval from Len or should I?

Thanks,
Alex.

Andrew Morton wrote:
> On Fri, 09 Nov 2007 12:36:43 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:
>
>   
>> Andrew Morton wrote:
>>     
>>> A> On Thu, 08 Nov 2007 19:35:23 +0300 Alexey Starikovskiy <astarikovskiy@suse.de> wrote:
>>>       
>>>> [remove_cycle_at_battery_removal.patch  text/x-patch (1.7KB)]
>>>> ACPI: Battery: remove cycle from battery removal.
>>>>
>>>> From: Alexey Starikovskiy <astarikovskiy@suse.de>
>>>>
>>>> get_property() should not call battery_update() on absent battery to
>>>> avoid cycle and oops.
>>>>
>>>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>>>> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
>>>>         
>>> A patch similar to this one but with an identical changelog was merged into
>>> Len's tree on November 2.
>>>
>>> If it had been promptly merged into mainline then quite a lot of people's
>>> time would not have been wasted.
>>>
>>>       
>> Andrew,
>> should I send such patches directly to you/Linus?
>>
>>     
>
> Well if Len doesn't object and you're confident in the changes, why not? 
> Any time we leave bugs unfixed we drive away testers and that impacts all
> parts of the kernel.
>
>   


[-- Attachment #2: remove_cycle_at_battery_removal.patch --]
[-- Type: text/x-patch, Size: 1733 bytes --]

ACPI: Battery: remove cycle from battery removal.

From: Alexey Starikovskiy <astarikovskiy@suse.de>

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

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---

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

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..192c244 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,7 +132,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
-static int acpi_battery_update(struct acpi_battery *battery);
+static int acpi_battery_get_state(struct acpi_battery *battery);
 
 static int acpi_battery_get_property(struct power_supply *psy,
 				     enum power_supply_property psp,
@@ -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_get_state(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)

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: 2.6.24-rc1: OOPS at  acpi_battery_update
  2007-11-13  8:35                         ` Alexey Starikovskiy
@ 2007-11-13  8:59                           ` Andrew Morton
  2007-11-13  9:23                           ` [PATCH] ACPI: Battery: remove cycle from battery removal Alexey Starikovskiy
  1 sibling, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2007-11-13  8:59 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Alexey Starikovskiy, rjw, hannes-kernel, listen, linux-kernel,
	linux-acpi, Len Brown, Linus Torvalds

On Tue, 13 Nov 2007 11:35:18 +0300 Alexey Starikovskiy <aystarik@gmail.com> wrote:

> I can not contact with Len for several days, while the oops on battery 
> seems quite important.
> It also seem to behave well in -mm tree (as part of Len's acpi-test).
> Will you send this patch to Linus without approval from Len or should I?

Please send it yourself - your latest version seems a little different
from the one in git-acpi and I'd just be dangerous trying to work out
which one is needed.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] ACPI: Battery: remove cycle from battery removal.
  2007-11-13  8:35                         ` Alexey Starikovskiy
  2007-11-13  8:59                           ` Andrew Morton
@ 2007-11-13  9:23                           ` Alexey Starikovskiy
  1 sibling, 0 replies; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-13  9:23 UTC (permalink / raw)
  To: torvalds; +Cc: Linux-acpi

get_property() should not call battery_update(),
it also should call get_status() only if battery is present to
avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Johannes Weiner <hannes@saeurebad.de>
---

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

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..192c244 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,7 +132,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
-static int acpi_battery_update(struct acpi_battery *battery);
+static int acpi_battery_get_state(struct acpi_battery *battery);
 
 static int acpi_battery_get_property(struct power_supply *psy,
 				     enum power_supply_property psp,
@@ -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_get_state(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)


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] ACPI: Battery: remove cycle from battery removal.
@ 2007-11-14 17:54 Alexey Starikovskiy
  2007-11-14 21:21 ` Rafael J. Wysocki
  0 siblings, 1 reply; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-14 17:54 UTC (permalink / raw)
  To: LenBrown; +Cc: Linux-acpi

get_property() should not call battery_update(),
it also should call get_status() only if battery is present to
avoid cycle and oops.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Johannes Weiner <hannes@saeurebad.de>
---

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

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index c2ce0ad..192c244 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -132,7 +132,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
-static int acpi_battery_update(struct acpi_battery *battery);
+static int acpi_battery_get_state(struct acpi_battery *battery);
 
 static int acpi_battery_get_property(struct power_supply *psy,
 				     enum power_supply_property psp,
@@ -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_get_state(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)


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] ACPI: Battery: remove cycle from battery removal.
  2007-11-14 21:21 ` Rafael J. Wysocki
@ 2007-11-14 21:06   ` Alexey Starikovskiy
  0 siblings, 0 replies; 23+ messages in thread
From: Alexey Starikovskiy @ 2007-11-14 21:06 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LenBrown, Linux-acpi

Rafael J. Wysocki wrote:
> On Wednesday, 14 of November 2007, Alexey Starikovskiy wrote:
>> get_property() should not call battery_update(),
>> it also should call get_status() only if battery is present to
>> avoid cycle and oops.
>>
>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
>> Acked-by: Johannes Weiner <hannes@saeurebad.de>
> 
> It looks like this patch has been merged as commit
> 9104476e4efbef8a8e32d48ced583603ff32a2db
Yes, I noticed.

Thanks,
Alex.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] ACPI: Battery: remove cycle from battery removal.
  2007-11-14 17:54 Alexey Starikovskiy
@ 2007-11-14 21:21 ` Rafael J. Wysocki
  2007-11-14 21:06   ` Alexey Starikovskiy
  0 siblings, 1 reply; 23+ messages in thread
From: Rafael J. Wysocki @ 2007-11-14 21:21 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: LenBrown, Linux-acpi

On Wednesday, 14 of November 2007, Alexey Starikovskiy wrote:
> get_property() should not call battery_update(),
> it also should call get_status() only if battery is present to
> avoid cycle and oops.
> 
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> Acked-by: Johannes Weiner <hannes@saeurebad.de>

It looks like this patch has been merged as commit
9104476e4efbef8a8e32d48ced583603ff32a2db


> ---
> 
>  drivers/acpi/battery.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index c2ce0ad..192c244 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -132,7 +132,7 @@ static int acpi_battery_technology(struct acpi_battery *battery)
>  	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
>  }
>  
> -static int acpi_battery_update(struct acpi_battery *battery);
> +static int acpi_battery_get_state(struct acpi_battery *battery);
>  
>  static int acpi_battery_get_property(struct power_supply *psy,
>  				     enum power_supply_property psp,
> @@ -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_get_state(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)
> 
> -

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2007-11-14 21:06 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 10:11 2.6.24-rc1: OOPS at acpi_battery_update Romano Giannetti
2007-11-01 23:14 ` Andrew Morton
2007-11-02 16:08   ` Rafael J. Wysocki
2007-11-04  9:34     ` *SPAM* " Romano Giannetti
2007-11-04 13:17       ` Rafael J. Wysocki
2007-11-04 23:29         ` Michael (rabenkind) Brandstetter
2007-11-05  0:18           ` Rafael J. Wysocki
2007-11-08 15:53             ` Johannes Weiner
2007-11-08 16:16               ` Rafael J. Wysocki
2007-11-08 16:11                 ` Alexey Starikovskiy
2007-11-08 16:46                   ` Johannes Weiner
2007-11-08 16:35                 ` Alexey Starikovskiy
2007-11-08 16:58                   ` Johannes Weiner
2007-11-09  4:34                   ` Andrew Morton
2007-11-09  9:36                     ` Alexey Starikovskiy
2007-11-09  9:49                       ` Andrew Morton
2007-11-13  8:35                         ` Alexey Starikovskiy
2007-11-13  8:59                           ` Andrew Morton
2007-11-13  9:23                           ` [PATCH] ACPI: Battery: remove cycle from battery removal Alexey Starikovskiy
  -- strict thread matches above, loose matches on Subject: below --
2007-11-02 14:20 [2.6.24-rc1][BUG] Oops on " Rolf Eike Beer
2007-11-02 15:32 ` [PATCH] ACPI: Battery: remove cycle from " Alexey Starikovskiy
2007-11-14 17:54 Alexey Starikovskiy
2007-11-14 21:21 ` Rafael J. Wysocki
2007-11-14 21:06   ` Alexey Starikovskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).