Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp951081pxb; Fri, 22 Apr 2022 15:09:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMFEguGPV0i1rfvdW7gy9volkv/HHOnNhQ3IuA9F4ooYLs+NAXrAJr9/aDbN055vhI2ieZ X-Received: by 2002:a05:6a00:809:b0:50c:e99d:b37d with SMTP id m9-20020a056a00080900b0050ce99db37dmr6259458pfk.57.1650665366458; Fri, 22 Apr 2022 15:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650665366; cv=none; d=google.com; s=arc-20160816; b=ixRLMV62LJ1W09BI3YZVFgOfxYjrLwkc+0UVpV2EFjKsLszBzR7nmYWC9tcUsMM3Fx qK6KuMZhHoVrxBpREWlAo6E/cKn0R5y4lTnyUE9QjlUJA0QLkxYyLMSfX27Wh47/Jqbp gg3j0euQx8SzJ0Zjdk1wjCYMOoG5mw+ayEhCJmtxeEtHQ09Ru+rd5bchVgxlTVQscWcc EWTrJ5xIM3yZNB0aCLgLhjFRW1PXz1IQqcF7WIroIGtW14PZitTCD9aZ+jbE+H96iIA5 aqCiWL7e63O6uADdRWyFjM2eRAbLtHf92AVyx5f92B3i4CCABY44M8cg5ZJUQH8NPOB/ 2nMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=l5ix6pbNFp+/nPGxT7xcmV9fUCildrI0krOclaIJODE=; b=XocYwRD0IbjVXGBHmZB7f9NQbJRrKJKfx+W534d/QwcPdJYDBC/SWRHF49wsMgojji QIbQRCAd9b7V9S/z4SoyLqzYWHPDikt7O1WFfu7qyRTdg7sn14KsqGx74V3For/l3TAp GxudcMecUmzdKIxHjWmfrO+yjMhfIZoXstVSOuOHtFK2qyE+fv0g29JHgV/Pg2eHKVrE 7O0I6bCcdS0bYMKfuLBAm/Z4oPGOOjgMrN0mF6Sdd924+DsQ2m4my+34bXf1iS0lECG0 mzSl+MROYhlK3KhLHrNMsh/3iS/E+0EL7HYHru6kYGngnWHrCX83xeLy+D+D1IMC13bP E2rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b16-20020a170902e95000b0015a81cfcfd8si6640757pll.608.2022.04.22.15.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:09:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB34E282097; Fri, 22 Apr 2022 13:15:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448653AbiDVOcU (ORCPT + 99 others); Fri, 22 Apr 2022 10:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1445426AbiDVOcS (ORCPT ); Fri, 22 Apr 2022 10:32:18 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 273ED5BD21; Fri, 22 Apr 2022 07:29:25 -0700 (PDT) Received: from [2a02:8108:963f:de38:6624:6d8d:f790:d5c]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1nhuHj-0000bB-DF; Fri, 22 Apr 2022 16:29:23 +0200 Message-ID: <2ce27899-684f-4fe2-4401-a66649b35d60@leemhuis.info> Date: Fri, 22 Apr 2022 16:29:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [REGRESSION] Missing IRQ via amd_gpio Content-Language: en-US From: Thorsten Leemhuis To: Takashi Iwai Cc: Shreeya Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev, Mario Limonciello , Linus Walleij , Bartosz Golaszewski References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1650637765;661b59ac; X-HE-SMSGID: 1nhuHj-0000bB-DF X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.04.22 16:17, Thorsten Leemhuis wrote: > Hi Takashi! Thx for CCing the regression list. > > On 22.04.22 15:03, Takashi Iwai wrote: >> Hi, >> >> we received a bug report for 5.17.3 kernel showing a new error: >> >> amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517 >> >> Not only an error message but in practice this leads to a missing IRQ >> assignment; the IRQ 27 is no longer assigned to amd_gpio driver. >> >> As the error number (EPROBE_DEFER) indicates, this seems to be the >> side-effect of the recent fix, the upstream commit 5467801f1fcb >> ("gpio: Restrict usage of GPIO chip irq members before >> initialization"). As far as I understand, the problem is in >> acpi_gpiochip_request_interrupts() call that is called from >> gpiochip_add_irqchip() itself. Since it's called before the >> initialized flag set, it always fails now. >> >> Below is a temporary quick fix and it seems working. But I'm not sure >> whether I overlooked something obvious... > > A patch that afaics will fix this hopefully should get merged really > soon now: > > https://lore.kernel.org/all/20220422131452.20757-1-mario.limonciello@amd.com/ > > See also v1: > > https://lore.kernel.org/all/20220414025705.598-1-mario.limonciello@amd.com/ Sorry, I shouldn't have stripped the rest of the message, mario might be interested in at least the link, so here it is: >> -- 8< -- >> From: Takashi Iwai >> Subject: [PATCH] gpio: Fix missing IRQ assginment for ACPI gpiochip >> >> The recent fix for gpiolib caused an error like: >> amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517 >> It indicates -EPROBE_DEFER, and since the function >> acpi_gpiochip_request_interrupts() doesn't handle the deferred probe, >> this leads to the missing IRQs. >> >> The problem is that acpi_gpiochip_request_interrupts() itself is >> called from gpiochip_add_irqchip() but before gc->irq.initialized flag >> is set. For fixing the regression, let's move the call of >> acpi_gpiochip_request_interrupts() after the initialized flag setup. >> >> Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") >> BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1198697 >> Signed-off-by: Takashi Iwai >> --- >> drivers/gpio/gpiolib.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c >> index 085348e08986..b7694171655c 100644 >> --- a/drivers/gpio/gpiolib.c >> +++ b/drivers/gpio/gpiolib.c >> @@ -1601,8 +1601,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, >> >> gpiochip_set_irq_hooks(gc); >> >> - acpi_gpiochip_request_interrupts(gc); >> - >> /* >> * Using barrier() here to prevent compiler from reordering >> * gc->irq.initialized before initialization of above >> @@ -1612,6 +1610,8 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, >> >> gc->irq.initialized = true; >> >> + acpi_gpiochip_request_interrupts(gc); >> + >> return 0; >> }