From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [2.6.24-rc1][BUG] Oops on battery removal
Date: Fri, 02 Nov 2007 16:00:03 +0300 [thread overview]
Message-ID: <472B1F53.5080902@suse.de> (raw)
In-Reply-To: <200711021250.03555.eike-kernel@sf-tec.de>
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
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?
[-- Attachment #2: remove_cycle_at_battery_removal.patch --]
[-- Type: text/x-patch, Size: 985 bytes --]
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 <astarikovskiy@suse.de>
---
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)
next prev parent reply other threads:[~2007-11-02 13:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 7:03 [2.6.24-rc1][BUG] Oops on battery removal Rolf Eike Beer
2007-11-02 8:37 ` Rolf Eike Beer
2007-11-02 9:29 ` Alexey Starikovskiy
2007-11-02 11:49 ` Rolf Eike Beer
2007-11-02 13:00 ` Alexey Starikovskiy [this message]
2007-11-02 13:26 ` Rolf Eike Beer
2007-11-02 13:41 ` Alexey Starikovskiy
2007-11-02 14:20 ` Rolf Eike Beer
2007-11-02 15:32 ` [PATCH] ACPI: Battery: remove cycle from " Alexey Starikovskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=472B1F53.5080902@suse.de \
--to=astarikovskiy@suse.de \
--cc=eike-kernel@sf-tec.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.