From: Len Brown <len.brown@intel.com>
To: akpm@osdl.org
Cc: linux-acpi@vger.kernel.org, jikos@jikos.cz, pavel@ucw.cz, seife@suse.de
Subject: Re: [patch 10/12] acpi: preserve correct battery state through suspend/resume cycles
Date: Sat, 14 Oct 2006 04:07:53 -0400 [thread overview]
Message-ID: <200610140407.53973.len.brown@intel.com> (raw)
In-Reply-To: <200610102120.k9ALKfDU024293@shell0.pdx.osdl.net>
Applied.
thanks,
-Len
On Tuesday 10 October 2006 17:20, akpm@osdl.org wrote:
> From: Jiri Kosina <jikos@jikos.cz>
>
> There is a problem in th following scenario(s):
>
> boot -> suspend -> (un)plug battery -> resume
>
> The problem arises in both cases - i.e. suspend with battery plugged in,
> and resume with battery unplugged, or vice versa.
>
> After resume, when the battery status has changed (plugged in -> unplegged
> or unplugged -> plugged in) during the time when the system was sleeping,
> the /proc/acpi/battery/*/* is wrong (showing the state before suspend, not
> the current state).
>
> The following patch adds ->resume method to the ACPI battery handler, which
> has the only aim - to check whether the battery state has changed during
> sleep, and if so, update the ACPI internal data structures, so that
> information published through /proc/acpi/battery/*/* is correct even after
> suspend/resume cycle, during which the battery was removed/inserted.
>
> The patch is against current ACPI git tree, but applies cleanly also
> against -mm and probably other trees. Please apply.
>
> Signed-off-by: Jiri Kosina <jikos@jikos.cz>
> Cc: "Brown, Len" <len.brown@intel.com>
> Cc: Stefan Seyfried <seife@suse.de>
> Acked-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
>
> drivers/acpi/battery.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+)
>
> diff -puN drivers/acpi/battery.c~acpi-preserve-correct-battery-state-through-suspend-resume-cycles drivers/acpi/battery.c
> --- a/drivers/acpi/battery.c~acpi-preserve-correct-battery-state-through-suspend-resume-cycles
> +++ a/drivers/acpi/battery.c
> @@ -64,6 +64,7 @@ extern void *acpi_unlock_battery_dir(str
>
> static int acpi_battery_add(struct acpi_device *device);
> static int acpi_battery_remove(struct acpi_device *device, int type);
> +static int acpi_battery_resume(struct acpi_device *device, int status);
>
> static struct acpi_driver acpi_battery_driver = {
> .name = ACPI_BATTERY_DRIVER_NAME,
> @@ -71,6 +72,7 @@ static struct acpi_driver acpi_battery_d
> .ids = ACPI_BATTERY_HID,
> .ops = {
> .add = acpi_battery_add,
> + .resume = acpi_battery_resume,
> .remove = acpi_battery_remove,
> },
> };
> @@ -753,6 +755,18 @@ static int acpi_battery_remove(struct ac
> return 0;
> }
>
> +/* this is needed to learn about changes made in suspended state */
> +static int acpi_battery_resume(struct acpi_device *device, int state)
> +{
> + struct acpi_battery *battery;
> +
> + if (!device)
> + return -EINVAL;
> +
> + battery = device->driver_data;
> + return acpi_battery_check(battery);
> +}
> +
> static int __init acpi_battery_init(void)
> {
> int result;
> _
> -
> 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
>
prev parent reply other threads:[~2006-10-14 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-10 21:20 [patch 10/12] acpi: preserve correct battery state through suspend/resume cycles akpm
2006-10-10 22:11 ` Richard Hughes
2006-10-14 8:07 ` Len Brown [this message]
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=200610140407.53973.len.brown@intel.com \
--to=len.brown@intel.com \
--cc=akpm@osdl.org \
--cc=jikos@jikos.cz \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=seife@suse.de \
/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.