All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristian Klausen <kristian@klausen.dk>
To: platform-driver-x86@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH v2] platform/x86: asus-wmi: Support laptops where the first battery is named BATT
Date: Tue, 25 Feb 2020 10:15:01 +0100	[thread overview]
Message-ID: <4e447fb1-a8a5-92e1-85be-6c23de20683c@klausen.dk> (raw)
In-Reply-To: <20200223181832.17131-1-kristian@klausen.dk>

On 23.02.2020 19.18, Kristian Klausen wrote:
> The WMI method to set the charge threshold does not provide a
> way to specific a battery, so we assume it is the first/primary
> battery (by checking if the name is BAT0).
> On some newer ASUS laptops (Zenbook UM431DA) though, the
> primary/first battery isn't named BAT0 but BATT, so we need
> to support that case.
>
> Signed-off-by: Kristian Klausen <kristian@klausen.dk>
> Cc: stable@vger.kernel.org
> ---
> I'm not sure if this is candidate for -stable, it fix a real bug
> (charge threshold doesn't work on newer ASUS laptops) which has been
> reported by a user[1], but is that enough?
> I had a quick look at[2], can this be considered a "something
> critical"? It "bothers people"[1]. My point: I'm not sure..
>
> I'm unsure if there is a bettery way to fix this. Maybe a counter
> would be better (+1 for every new battery)? It would probably need
> to be atomic to prevent race condition (I'm not sure how this code
> is run), but this "fix" is way simpler.
>
> Please do not accept this patch just yet, I'm waiting for the tester
> to either confirm or deny credit[3].

Please add:
Reported-by: Alberto Gomez Marin
Tested-by: Alberto Gomez Marin

Is a email required? The tester prefer not to disclose his email 
address[1]. The tester didn't test this exact patch, but the only change 
is a line break and no parenthesis, so it should be the same[2].
[1] 
https://gist.github.com/klausenbusk/643f15320ae8997427155c38be13e445#gistcomment-3187929
[2] 
https://gist.github.com/klausenbusk/643f15320ae8997427155c38be13e445#gistcomment-3185442

>
> [1] https://gist.github.com/klausenbusk/643f15320ae8997427155c38be13e445#gistcomment-3186025
> [2] https://www.kernel.org/doc/html/v5.5/process/stable-kernel-rules.html
> [3] https://gist.github.com/klausenbusk/643f15320ae8997427155c38be13e445#gistcomment-3186429
>
> v2:
> Add base commit
> Remove uneeded parenthesis and adjust styling
>
>   drivers/platform/x86/asus-wmi.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 612ef5526226..01becbe2a9a8 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -426,8 +426,11 @@ static int asus_wmi_battery_add(struct power_supply *battery)
>   {
>   	/* The WMI method does not provide a way to specific a battery, so we
>   	 * just assume it is the first battery.
> +	 * Note: On some newer ASUS laptops (Zenbook UM431DA), the primary/first
> +	 * battery is named BATT.
>   	 */
> -	if (strcmp(battery->desc->name, "BAT0") != 0)
> +	if (strcmp(battery->desc->name, "BAT0") != 0 &&
> +	    strcmp(battery->desc->name, "BATT") != 0)
>   		return -ENODEV;
>   
>   	if (device_create_file(&battery->dev,
>
> base-commit: 11a48a5a18c63fd7621bb050228cebf13566e4d8

      parent reply	other threads:[~2020-02-25  9:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-23 18:18 [PATCH v2] platform/x86: asus-wmi: Support laptops where the first battery is named BATT Kristian Klausen
2020-02-24  1:10 ` Sasha Levin
2020-02-24  1:10   ` Sasha Levin
2020-02-24  1:14   ` Kristian Klausen
2020-02-25  9:30     ` Andy Shevchenko
2020-02-25  9:51       ` Kristian Klausen
2020-02-25  9:55         ` Andy Shevchenko
2020-03-03 14:46           ` Andy Shevchenko
2020-03-03 18:03             ` Kristian Klausen
2020-02-25  9:15 ` Kristian Klausen [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=4e447fb1-a8a5-92e1-85be-6c23de20683c@klausen.dk \
    --to=kristian@klausen.dk \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@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.