From: Hans de Goede <hdegoede@redhat.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-pwm@vger.kernel.org, linux-acpi@vger.kernel.org,
youling257@gmail.com,
Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Subject: Re: [PATCH 5.3 regression fix] pwm: Fallback to the static lookup-list when acpi_pwm_get fails
Date: Thu, 8 Aug 2019 12:19:53 +0200 [thread overview]
Message-ID: <31c3f15e-649e-a3c1-56e2-0c35fda24ae1@redhat.com> (raw)
In-Reply-To: <20190730154848.5164-1-hdegoede@redhat.com>
Thierry,
Ping? This fixes a somewhat serious regression in 5.3, can we please get
this queued up for merging into 5.3 ?
Regards,
Hans
On 30-07-19 17:48, Hans de Goede wrote:
> Commit 4a6ef8e37c4d ("pwm: Add support referencing PWMs from ACPI")
> made pwm_get unconditionally return the acpi_pwm_get return value if
> the device passed to pwm_get has an ACPI fwnode.Thieer
>
> But even if the passed in device has an ACPI fwnode, it does not
> necessarily have the necessary ACPI package defining its pwm bindings,
> especially since the binding / API of this ACPI package has only been
> introduced very recently.
>
> Up until now X86/ACPI devices which use a separate pwm controller for
> controlling their LCD screen's backlight brightness have been relying
> on the static lookup-list to get their pwm.
>
> pwm_get unconditionally returning the acpi_pwm_get return value breaks
> this, breaking backlight control on these devices.
>
> This commit fixes this by making pwm_get fall back to the static
> lookup-list if acpi_pwm_get returns -ENOENT.
>
> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96571
> Reported-by: youling257@gmail.com
> Fixes: 4a6ef8e37c4d ("pwm: Add support referencing PWMs from ACPI")
> Cc: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/pwm/core.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
> index c3ab07ab31a9..8edfac17364e 100644
> --- a/drivers/pwm/core.c
> +++ b/drivers/pwm/core.c
> @@ -882,8 +882,11 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
> return of_pwm_get(dev, dev->of_node, con_id);
>
> /* then lookup via ACPI */
> - if (dev && is_acpi_node(dev->fwnode))
> - return acpi_pwm_get(dev->fwnode);
> + if (dev && is_acpi_node(dev->fwnode)) {
> + pwm = acpi_pwm_get(dev->fwnode);
> + if (!IS_ERR(pwm) || PTR_ERR(pwm) != -ENOENT)
> + return pwm;
> + }
>
> /*
> * We look up the provider in the static table typically provided by
>
next prev parent reply other threads:[~2019-08-08 10:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 15:48 [PATCH 5.3 regression fix] pwm: Fallback to the static lookup-list when acpi_pwm_get fails Hans de Goede
2019-07-30 16:08 ` Andy Shevchenko
2019-08-05 9:31 ` Nikolaus Voss
2019-08-05 9:55 ` Hans de Goede
2019-08-05 10:11 ` Nikolaus Voss
2019-08-08 10:19 ` Hans de Goede [this message]
2019-08-08 11:21 ` Thierry Reding
2019-08-08 12:14 ` Hans de Goede
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=31c3f15e-649e-a3c1-56e2-0c35fda24ae1@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=nikolaus.voss@loewensteinmedical.de \
--cc=thierry.reding@gmail.com \
--cc=youling257@gmail.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;
as well as URLs for NNTP newsgroup(s).