From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Jian-Hong Pan <jian-hong@endlessm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Daniel Drake <drake@endlessm.com>,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Upstreaming Team <linux@endlessm.com>
Subject: Re: [PATCH 0/6] ACPI: EC: Updates related to initialization
Date: Tue, 3 Mar 2020 10:09:59 +0100 [thread overview]
Message-ID: <CAJZ5v0hie79+jG+3h4t5Q8r0M7E37HY-7i8ijg8DpvS0RXZSiQ@mail.gmail.com> (raw)
In-Reply-To: <CAPpJ_efvF0XzjevA1eL3BUJqBwxRTOPLcqWKN40Azj-n1AtjcA@mail.gmail.com>
On Tue, Mar 3, 2020 at 8:29 AM Jian-Hong Pan <jian-hong@endlessm.com> wrote:
>
> Rafael J. Wysocki <rafael@kernel.org> 於 2020年3月2日 週一 下午7:45寫道:
> >
> > On Mon, Mar 2, 2020 at 11:38 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> > >
> > > On Mon, Mar 2, 2020 at 6:54 AM Jian-Hong Pan <jian-hong@endlessm.com> wrote:
> > > >
> > > > Daniel Drake <drake@endlessm.com> 於 2020年2月28日 週五 下午5:43寫道:
> > > > >
> > > > > On Thu, Feb 27, 2020 at 10:25 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > > > > > The purpose of this series of update of the ACPI EC driver is to make its
> > > > > > initialization more straightforward.
> > > > > >
> > > > > > They fix a couple of issues, clean up some things, remove redundant code etc.
> > > > > >
> > > > > > Please refer to the changelogs of individual patches for details.
> > > > > >
> > > > > > For easier access, the series is available in the git branch at
> > > > > >
> > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
> > > > > > acpi-ec-work
> > > > > >
> > > > > > on top of 5.6-rc3.
> > > > >
> > > > > Jian-Hong, can you please test this on Asus UX434DA?
> > > > > Check if the screen brightness hotkeys are still working after these changes.
> > > >
> > > > Hi Rafael,
> > > >
> > > > Thanks for your patches, but we found an issue:
> > > > The laptops like ASUS UX434DA's screen brightness hotkeys work before
> > > > this patch series. However, the hotkeys are failed with the patch
> > > > "ACPI: EC: Unify handling of event handler installation failures".
> > >
> > > So I have modified the series to avoid the change that can possibly break this.
> > >
> > > Can you please pull the new series from
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
> > > acpi-ec-work
> > >
> > > (same branch) and retest?
> >
> > Note that the current top-most commit in that branch is
> >
> > 0957d98f50da ACPI: EC: Consolidate event handler installation code
>
> I tested the commits in acpi-ec-work branch whose last commit is
> 0957d98f50da ("ACPI: EC: Consolidate event handler installation
> code"). The screen brightness hotkeys are still failed with
> 0957d98f50da ("ACPI: EC: Consolidate event handler installation
> code").
>
> I tweak and add some debug messages:
>
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index 85f1fe8e208a..3887f427283c 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -1443,23 +1443,27 @@ static bool install_gpe_event_handler(struct
> acpi_ec *ec)
> return true;
> }
>
> -static bool install_gpio_irq_event_handler(struct acpi_ec *ec,
> +static int install_gpio_irq_event_handler(struct acpi_ec *ec,
> struct acpi_device *device)
> {
> int irq, ret;
>
> /* ACPI reduced hardware platforms use a GpioInt specified in _CRS. */
> irq = acpi_dev_gpio_irq_get(device, 0);
> - if (irq < 0)
> - return false;
> + if (irq < 0) {
> + pr_err("%s: acpi_dev_gpio_irq_get returns %d\n", __func__, irq);
> + return irq;
> + }
>
> ret = request_irq(irq, acpi_ec_irq_handler, IRQF_SHARED, "ACPI EC", ec);
> - if (ret < 0)
> - return false;
> + if (ret < 0) {
> + pr_err("%s: request_irq returns %d\n", __func__, ret);
> + return ret;
> + }
>
> ec->irq = irq;
>
> - return true;
> + return 0;
> }
>
> /**
> @@ -1517,9 +1521,11 @@ static int ec_install_handlers(struct acpi_ec
> *ec, struct acpi_device *device)
> * fatal, because the EC can be polled for events.
> */
> } else {
> - ready = install_gpio_irq_event_handler(ec, device);
> - if (!ready)
> - return -ENXIO;
> + pr_err("%s: install_gpio_irq_event_handler\n",
> __func__);
> + int ret = install_gpio_irq_event_handler(ec, device);
> + if (ret)
> + return ret;
> + ready = true;
> }
> if (ready) {
> set_bit(EC_FLAGS_EVENT_HANDLER_INSTALLED, &ec->flags);
>
> The dmesg shows:
>
> [ 0.121117] ACPI: EC: ec_install_handlers: install_gpio_irq_event_handler
> [ 0.121133] ACPI: EC: install_gpio_irq_event_handler:
> acpi_dev_gpio_irq_get returns -517
>
> Originally, ec_install_handlers() will return the returned value from
> install_gpio_irq_event_handler() from acpi_dev_gpio_irq_get(), which
> is -EPROBE_DEFER, instead of -ENXIO. However, ec_install_handlers()
> returns -ENXIO directly if install_gpio_irq_event_handler() returns
> false in patch ("ACPI: EC: Consolidate event handler installation
> code"). Here needs some modification.
Thanks, I forgot about the -EPROBE_DEFER case.
next prev parent reply other threads:[~2020-03-03 9:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 22:19 [PATCH 0/6] ACPI: EC: Updates related to initialization Rafael J. Wysocki
2020-02-27 22:21 ` [PATCH 1/6] ACPI: EC: Avoid printing confusing messages in acpi_ec_setup() Rafael J. Wysocki
2020-02-27 22:21 ` [PATCH 2/6] ACPI: EC: Avoid passing redundant argument to functions Rafael J. Wysocki
2020-02-27 22:22 ` [PATCH 3/6] ACPI: EC: Drop AE_NOT_FOUND special case from ec_install_handlers() Rafael J. Wysocki
2020-02-27 22:23 ` [PATCH 4/6] ACPI: EC: Unify handling of event handler installation failures Rafael J. Wysocki
2020-02-27 22:23 ` [PATCH 5/6] ACPI: EC: Simplify acpi_ec_add() Rafael J. Wysocki
2020-02-27 22:24 ` [PATCH 6/6] ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC Rafael J. Wysocki
2020-02-28 9:43 ` [PATCH 0/6] ACPI: EC: Updates related to initialization Daniel Drake
2020-03-02 5:53 ` Jian-Hong Pan
2020-03-02 9:55 ` Rafael J. Wysocki
2020-03-02 10:38 ` Rafael J. Wysocki
2020-03-02 11:45 ` Rafael J. Wysocki
2020-03-03 7:28 ` Jian-Hong Pan
2020-03-03 9:09 ` Rafael J. Wysocki [this message]
2020-03-03 22:23 ` Rafael J. Wysocki
2020-03-04 2:53 ` Jian-Hong Pan
2020-03-04 9:13 ` Rafael J. Wysocki
2020-03-04 10:42 ` [PATCH v2 " Rafael J. Wysocki
2020-03-04 10:44 ` [PATCH v2 1/6] ACPI: EC: Avoid printing confusing messages in acpi_ec_setup() Rafael J. Wysocki
2020-03-04 10:45 ` [PATCH v2 2/6] ACPI: EC: Avoid passing redundant argument to functions Rafael J. Wysocki
2020-03-04 10:46 ` [PATCH v2 3/6] ACPI: EC: Drop AE_NOT_FOUND special case from ec_install_handlers() Rafael J. Wysocki
2020-03-04 10:48 ` [PATCH v2 4/6] ACPI: EC: Simplify acpi_ec_add() Rafael J. Wysocki
2020-03-04 10:49 ` [PATCH v2 5/6] ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC Rafael J. Wysocki
2020-03-04 10:52 ` [PATCH v2 6/6] ACPI: EC: Consolidate event handler installation code Rafael J. Wysocki
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=CAJZ5v0hie79+jG+3h4t5Q8r0M7E37HY-7i8ijg8DpvS0RXZSiQ@mail.gmail.com \
--to=rafael@kernel.org \
--cc=drake@endlessm.com \
--cc=jian-hong@endlessm.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@endlessm.com \
--cc=rjw@rjwysocki.net \
/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).