linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Damien Thébault" <damien@dtbo.net>
Cc: "Darren Hart" <dvhart@infradead.org>,
	"Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Pali Rohár" <pali.rohar@gmail.com>,
	"Andy Shevchenko" <andy@infradead.org>,
	"Mario Limonciello" <mario.limonciello@dell.com>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [FIXED][PATCH] dell-laptop: Fix backlight detection
Date: Wed, 18 Jul 2018 13:23:12 +0300	[thread overview]
Message-ID: <CAHp75VcUJ70dtNcGfuJbo473ddOJ4_RdgcNsk_sVE5uVeHf_4Q@mail.gmail.com> (raw)
In-Reply-To: <20180718100601.GA30600@han>

On Wed, Jul 18, 2018 at 1:06 PM, Damien Thébault <damien@dtbo.net> wrote:
> Fix return code check for "max brightness" ACPI call.
>
> The dell laptop ACPI video brightness control is not present on dell
> laptops anymore, but was present in older kernel versions.
>
> The code that checks the return value is incorrect since the SMM
> refactoring.
>
> The old code was:
>   if (buffer->output[0] == 0)
>
> Which was changed to:
>   ret = dell_send_request(...)
>   if (ret)
>
> However, dell_send_request() will return 0 if buffer->output[0] == 0,
> so we must change the check to:
>   if (ret == 0)
>
> This issue was found on a Dell M4800 laptop, and the fix tested on it
> as well.
>

I have pushed this to my review and testing queue, thanks!

But I'm going to push this to Linus this week since it's definitely
stable material.

> Fixes: 549b4930f057 ("dell-smbios: Introduce dispatcher for SMM calls")
> Signed-off-by: Damien Thébault <damien@dtbo.net>
> Tested-by: Damien Thébault <damien@dtbo.net>
> Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
>  drivers/platform/x86/dell-laptop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> index f1fa8612db40..06978c14c83b 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -2185,7 +2185,7 @@ static int __init dell_init(void)
>                 dell_fill_request(&buffer, token->location, 0, 0, 0);
>                 ret = dell_send_request(&buffer,
>                                         CLASS_TOKEN_READ, SELECT_TOKEN_AC);
> -               if (ret)
> +               if (ret == 0)
>                         max_intensity = buffer.output[3];
>         }
>
> --
> 2.18.0
>



-- 
With Best Regards,
Andy Shevchenko

      reply	other threads:[~2018-07-18 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 10:06 [FIXED][PATCH] dell-laptop: Fix backlight detection Damien Thébault
2018-07-18 10:23 ` Andy Shevchenko [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=CAHp75VcUJ70dtNcGfuJbo473ddOJ4_RdgcNsk_sVE5uVeHf_4Q@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=damien@dtbo.net \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@dell.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@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 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).