lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Mar 2020 15:28:48 +0800
From:   Jian-Hong Pan <jian-hong@...lessm.com>
To:     "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Daniel Drake <drake@...lessm.com>,
        Linux ACPI <linux-acpi@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux Upstreaming Team <linux@...lessm.com>
Subject: Re: [PATCH 0/6] ACPI: EC: Updates related to initialization

Rafael J. Wysocki <rafael@...nel.org> 於 2020年3月2日 週一 下午7:45寫道:
>
> On Mon, Mar 2, 2020 at 11:38 AM Rafael J. Wysocki <rafael@...nel.org> wrote:
> >
> > On Mon, Mar 2, 2020 at 6:54 AM Jian-Hong Pan <jian-hong@...lessm.com> wrote:
> > >
> > > Daniel Drake <drake@...lessm.com> 於 2020年2月28日 週五 下午5:43寫道:
> > > >
> > > > On Thu, Feb 27, 2020 at 10:25 PM Rafael J. Wysocki <rjw@...ysocki.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.

Jian-Hong Pan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ