From nobody Sun May 10 22:40:17 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEC6FC4332F for ; Fri, 22 Apr 2022 13:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447709AbiDVNGs (ORCPT ); Fri, 22 Apr 2022 09:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233857AbiDVNGr (ORCPT ); Fri, 22 Apr 2022 09:06:47 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0AC57B39; Fri, 22 Apr 2022 06:03:53 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 98A55210F3; Fri, 22 Apr 2022 13:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1650632632; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=H1bqe7m7tzcdiiyMhmdZu9P/zQzA8HP1WWn/pLXkfYo=; b=J5RWkiqlBExJLpBho9/3ZPQWJhjHuql4zJlrvsoSHlrLKWXhjCvuOwVBmu7lDooDxglPun yrEpJpuYrM4mpaoAhEpCeNoGRijXAs6boRjwRCcX99UFAjwfRaQR6Qn8lVxF/EUNOW12Jv ecoRgFrKDw35YywYYsPKLc3Y6UTmvXY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1650632632; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=H1bqe7m7tzcdiiyMhmdZu9P/zQzA8HP1WWn/pLXkfYo=; b=bMnml4oY+vqWPIqgMN4xzg/twuo3jEtitCrRgIvPuCYnWfQJ985kFzYsD3FCPp0CNJnfa+ 1j4blzIL1YPGxbDA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 8C8C52C142; Fri, 22 Apr 2022 13:03:52 +0000 (UTC) Date: Fri, 22 Apr 2022 15:03:52 +0200 Message-ID: From: Takashi Iwai To: Linus Walleij , Bartosz Golaszewski Cc: Shreeya Patel , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev Subject: [REGRESSION] Missing IRQ via amd_gpio User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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... thanks, Takashi -- 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.=20 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=3D1198697 Signed-off-by: Takashi Iwai Reviewed-by: Takashi Iwai Tested-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, =20 gpiochip_set_irq_hooks(gc); =20 - 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, =20 gc->irq.initialized =3D true; =20 + acpi_gpiochip_request_interrupts(gc); + return 0; } =20 --=20 2.31.1