Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3194415ybf; Tue, 3 Mar 2020 01:11:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vvZPOeats8Mb6oW2Guvey5zQ3NtFwnivZ5IEymVuxKVkGR6dTi0R114fgcAXG5xdKi03fH/ X-Received: by 2002:aca:c586:: with SMTP id v128mr1863941oif.166.1583226676066; Tue, 03 Mar 2020 01:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583226676; cv=none; d=google.com; s=arc-20160816; b=EeKUw6AjVG1T6ulBlyI2c5r8m1ej12nLcsOfdsX8CBOzq/bkWp4XSgi4owvuKVYk/k zgTsuC6iQM2J6m91+xY6WU3ctel30cYYXuJ2YG9iKkBXOIO1TSCq++81kXIlIpg9uj// 0q99BuLMAQ5+65RXXVn39Bf14RjGCjtvRmPDRp12hUEZotvBpMuSu7ktOwZzRhmd+JkL wn3LmiStjHBXIz8jfyuBNKNARh8dCapqpnxktkaL0MnkP8KbC55S7i3lYamSQ8WitsKc /oRrjb/1RKLcN498zmr4rPvHGnXRg0sGwCkjd4imNrgzk+KHRevx8RsmZSAKx9BU48Ct oB4g== 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; bh=x+VnHUM7Ru5nnGJ5omwHaw/B6CIJ7dlAp7SPnCCDrT8=; b=o/VV/if1d3I7pYwjyhdSdxVK09Ac0xa4CAgMekxzvw/9g6cqp3+PlMF78KgnGCF8Nl SA9Ta6zK/HnM/OMze9UAwz/o3oBW7W4VETaT78of7K1Nn2BYikCumHNpwh7IsXucKwdg 8urqx5uEvPIR92BH1p75vrRFKlgNjzpbv5gSQbq/wtv+vcgZKc+HnqwQW7yWaWzPZgd4 TKrk6fIEic+w3iPDwx186yrjDJW6EfXgiSduvjgNmTVG57Gke3OtOIyTTLCyW+VeFZI5 ThZDtsHyGk1q4FybkjDVXctvfKgVmouuR55QWr/pf/EgjEx7oPY3b//Q2rLLEAvB/oWH LRSg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si6333691otq.216.2020.03.03.01.10.58; Tue, 03 Mar 2020 01:11:16 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgCCJKN convert rfc822-to-8bit (ORCPT + 99 others); Tue, 3 Mar 2020 04:10:13 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:40365 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728031AbgCCJKM (ORCPT ); Tue, 3 Mar 2020 04:10:12 -0500 Received: by mail-ot1-f68.google.com with SMTP id x19so2274046otp.7; Tue, 03 Mar 2020 01:10:11 -0800 (PST) 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=5ic/CV5iEBANwAlsxrIRMOAxvyvHS1HnvZnEEB3hD4E=; b=V++44Y6yVshBDXpDbtDXCdPw4P8ZLTab7yFUDHG2OMkP3xaOAj6zh8BVY5yZx2f17T DP4UbWDCKRRIde8KZjjuYgtvf5o5OMF2KTF+lOFpdAxwy6QyQOqYYEkryOCX8/JvzYDe fQUi6UHyq1J7QL2bcmvWGSXeziu5RpCPbYNkPP4Ksn02olfX3BeY8ndvQCXIimASj10N GBjnZxWbbDju5R/MeCFJ47OyVnL6ntt47od0W3EhItyEfJ+7DMWDwOuIb7J6/4NMEZWz 6eM8opB8Uwmie0Uyzd9q2IFs1rcRMV6KC0Twac81qpc71kcBl5wJcNaHqJPEwsB++YZX OBfg== X-Gm-Message-State: ANhLgQ32qgKenX6SfxypI2rCb1cwtrz72b9sgswLonwDE+qcpEfranHu +YrpRY9VDlZDrONNJ05vhjBSuFUvYsCTzJ2qtds= X-Received: by 2002:a9d:7653:: with SMTP id o19mr2537029otl.118.1583226611337; Tue, 03 Mar 2020 01:10:11 -0800 (PST) MIME-Version: 1.0 References: <2094703.CetWLLyMuz@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 3 Mar 2020 10:09:59 +0100 Message-ID: Subject: Re: [PATCH 0/6] ACPI: EC: Updates related to initialization To: Jian-Hong Pan Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Daniel Drake , Linux ACPI , LKML , Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 3, 2020 at 8:29 AM Jian-Hong Pan wrote: > > Rafael J. Wysocki 於 2020年3月2日 週一 下午7:45寫道: > > > > On Mon, Mar 2, 2020 at 11:38 AM Rafael J. Wysocki wrote: > > > > > > On Mon, Mar 2, 2020 at 6:54 AM Jian-Hong Pan wrote: > > > > > > > > Daniel Drake 於 2020年2月28日 週五 下午5:43寫道: > > > > > > > > > > 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 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.