mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: tianyu.lan@intel.com
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	jan.christian.hoffmann@gmail.com,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI/Battery: Fix parsing _BIX return value
Date: Tue, 30 Jul 2013 16:01:33 +0200	[thread overview]
Message-ID: <14636369.9qhdcKOf8e@vostro.rjw.lan> (raw)
In-Reply-To: <1375149298-28206-1-git-send-email-tianyu.lan@intel.com>

On Tuesday, July 30, 2013 09:54:58 AM tianyu.lan@intel.com wrote:
> From: Lan Tianyu <tianyu.lan@intel.com>
> 
> The _BIX method returns extended battery info as a package. According
> ACPI spec 10.2.2.2, the first member should be "Revision". However,
> current acpi battery driver treats the first member as "Power Unit"
> which should be the second member. So the parsing operation is mismatch.
> This patch is to fix it.
> 
> Reported-and-tested-by: Jan Hoffmann <jan.christian.hoffmann@gmail.com>
> Reference: http://bugzilla.kernel.org/show_bug.cgi?id=60519
> CC: stable@vger.kernel.org  #v2.6.34+
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>

Well, that's one of the most embarrassing bugs I've ever seen. :-)

Queued up as a fix for 3.11.

Thanks,
Rafael


> ---
>  drivers/acpi/battery.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index c760b61..2c9958c 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -117,6 +117,7 @@ struct acpi_battery {
>  	struct acpi_device *device;
>  	struct notifier_block pm_nb;
>  	unsigned long update_time;
> +	int revision;
>  	int rate_now;
>  	int capacity_now;
>  	int voltage_now;
> @@ -359,6 +360,7 @@ static struct acpi_offsets info_offsets[] = {
>  };
>  
>  static struct acpi_offsets extended_info_offsets[] = {
> +	{offsetof(struct acpi_battery, revision), 0},
>  	{offsetof(struct acpi_battery, power_unit), 0},
>  	{offsetof(struct acpi_battery, design_capacity), 0},
>  	{offsetof(struct acpi_battery, full_charge_capacity), 0},
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

           reply	other threads:[~2013-07-30 13:51 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1375149298-28206-1-git-send-email-tianyu.lan@intel.com>]

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=14636369.9qhdcKOf8e@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=jan.christian.hoffmann@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tianyu.lan@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®