Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3120450ybf; Mon, 2 Mar 2020 23:30:33 -0800 (PST) X-Google-Smtp-Source: ADFU+vuwJcX0AA6m6r52bgrV180ocbU5z2YYpJ5aRa3tv+vDZG99ppMWxdbk94s9V94UUh8wUXWc X-Received: by 2002:a54:4181:: with SMTP id 1mr1625737oiy.158.1583220633749; Mon, 02 Mar 2020 23:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583220633; cv=none; d=google.com; s=arc-20160816; b=PRyW6JXdKzRlD7kRGQn9uIE+zO3cQqIhjoqw9Lw7blQ9cMvztcCvZAwnvrouBWKul5 JsQCSymbya7WFZktbrQPWlNkcuv+WjNQZrm9XjWJVV+Zz5dX/kM3fSI8ySv1LLGAVFbc AybhMifhYp6uG8/7LndsotZhw7kKPplw+/krUhqW2Xus7x6AV5Gz2oN8kBPWQqhpVfzI PGpoBSyOygC91WPWgzf4rvlXNcr0t6VUBsmRc+JT1aW/ynDQzWaFGFKIQqTAM4EV1a7l eR5O07uHMJbTi40GObYsxijnu7LnjCielYDcp4skH/sYLd2apZZGdkrcGkJ3pVicusl3 15cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FfJGP3VvelPHBu9uAoszVPyAW2vGFIv4G/uor0aD668=; b=bzvmOcSWOHC2t66qrXhzpgNzNfv8tEhGo6/0c6BFtdAcrKonYRmob+wFhGU3wKPYhk N8yZqsY+8n5VqYQNFOqAai1ukKtg20+TkJyF05fNTbwBmKDqiSLoWiCmRCQc30oXX5rj o1lAtgXvj+ioISdwJcjv5Tw2lrayqXLRPJqDew9zIWF/GoBQzupjQ98B2+ltsjoP6LRS m25byF4+yopWGNCiT2+vhMewHBRJOpxvr2JjnYg+m4FxLujQtO0Y7cXJ4WjVGJCRVG6g 9k/L55BcgJ4uJYfVNJrLBdV3EOc0LExxp4CVBjtIXOTwTYNrAEq1bUtgHvauEHGr2PK/ Ipdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=wS4MKI86; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si264705otv.12.2020.03.02.23.30.20; Mon, 02 Mar 2020 23:30:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=wS4MKI86; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727552AbgCCH3j (ORCPT + 99 others); Tue, 3 Mar 2020 02:29:39 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:39002 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726164AbgCCH3i (ORCPT ); Tue, 3 Mar 2020 02:29:38 -0500 Received: by mail-vs1-f66.google.com with SMTP id a19so1731844vsp.6 for ; Mon, 02 Mar 2020 23:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FfJGP3VvelPHBu9uAoszVPyAW2vGFIv4G/uor0aD668=; b=wS4MKI86i7vYgDExykq5E/9nAFZP1oxRif7r7AX+nw2mR4pGHUdQ54RIYxqtwLwneY A5K//2Hg6Cq3gYj2GT5HQ0W+jiSbn7zSEO1wIHugA2IFFR6/VB0MtqnEPNnFUv1Ba4Qi QzriKcACmsM+4l1zZQ3CGfLph9nz1xKozupNGUKPucW+PneR3xFN4GWQNkmkRa+Nh+A7 7w/0Lo2DjYpYQMtfVGLqq93RLdFd5x/80J4zmRxMW7jzhwB5ii3n33303mN4E59Be12d 5RYNVbtl7KHRuKVP0TSN7NPLddqIHzO4qXp3eG6Ebm3QBU9IXP42ewCVg/UbsTrU+k1j X78Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FfJGP3VvelPHBu9uAoszVPyAW2vGFIv4G/uor0aD668=; b=n0euD6L5M+O4+Spop9WncHo+BpKFC6ug90j4y29IUnccsrMSQh0p7J+v66FVtRm0EU STLhE8cbCHHeNhU1+jWpYeVZEquL4WxyO0llctBO1Bq89czoYu4LTN8/0i0Y3VD+FDCV xBe0aNSza3SO/L2/QA5i4SnF2itQQKaSsQKuFVJNXG8B1dFlKy3YHNmbq37aYfJanZbg 5iLNQHcpsl0KzZMFqOK+xUmBwND9Z7FDFoCuYniypbu6T3SZglxhOfHEtOAC/UU7AqKD kW6zRmjHFkxdSL+kooLYA9fU09FO+2QIPn9mjfK8VnW0kVonTD70YiRb93jc0udaKjRI VPwg== X-Gm-Message-State: ANhLgQ1+LUXXwnAWTJQGD973EI5pOdyvgsfCudjjC51+YUI0dmPjbZ6z eTYlVi0ZYqhOqTe9uEw8LbsyH1DnBIa1PTV8V9b/Vw== X-Received: by 2002:a05:6102:3205:: with SMTP id r5mr1609818vsf.206.1583220577377; Mon, 02 Mar 2020 23:29:37 -0800 (PST) MIME-Version: 1.0 References: <2094703.CetWLLyMuz@kreacher> In-Reply-To: From: Jian-Hong Pan Date: Tue, 3 Mar 2020 15:28:48 +0800 Message-ID: Subject: Re: [PATCH 0/6] ACPI: EC: Updates related to initialization To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Daniel Drake , Linux ACPI , LKML , Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rafael J. Wysocki =E6=96=BC 2020=E5=B9=B43=E6=9C=882=E6= =97=A5 =E9=80=B1=E4=B8=80 =E4=B8=8B=E5=8D=887:45=E5=AF=AB=E9=81=93=EF=BC=9A > > On Mon, Mar 2, 2020 at 11:38 AM Rafael J. Wysocki wro= te: > > > > On Mon, Mar 2, 2020 at 6:54 AM Jian-Hong Pan w= rote: > > > > > > Daniel Drake =E6=96=BC 2020=E5=B9=B42=E6=9C=8828= =E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=885:43=E5=AF=AB=E9=81=93=EF=BC= =9A > > > > > > > > On Thu, Feb 27, 2020 at 10:25 PM Rafael J. Wysocki 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 redunda= nt 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.gi= t \ > > > > > 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 thes= e 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 bre= ak 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 =3D 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 =3D 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 =3D 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 =3D install_gpio_irq_event_handler(ec, device= ); - if (!ready) - return -ENXIO; + pr_err("%s: install_gpio_irq_event_handler\n", __func__); + int ret =3D install_gpio_irq_event_handler(ec, devi= ce); + if (ret) + return ret; + ready =3D true; } if (ready) { set_bit(EC_FLAGS_EVENT_HANDLER_INSTALLED, &ec->flag= s); The dmesg shows: [ 0.121117] ACPI: EC: ec_install_handlers: install_gpio_irq_event_handle= r [ 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