Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp883899pxb; Fri, 22 Apr 2022 13:23:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy16aKkIxYs0JtMCMrNEQN3Xak4cDamFvXGtxFRImK8OFgl78j9TZ/lXwuV7Ipakwi8cYhA X-Received: by 2002:a17:903:1c8:b0:15a:2088:848f with SMTP id e8-20020a17090301c800b0015a2088848fmr6150063plh.30.1650659004649; Fri, 22 Apr 2022 13:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650659004; cv=none; d=google.com; s=arc-20160816; b=cFhAaIrSOZ2Dwm2NmpmP9VD0iH7VBpNSI/cKGQnjmOU2HfLFeaJ9HhyKWigbstOURa cPXZBAJZaYaJsMvHpvXZPAhT+/n2m0la3lODh1eL0JpRK6yVDWGtxefbOEJ3WnjFpT6f R4+xPDxtQSc/TRVG6XB3aTXaepKBxR8fARLcb7OehAORBvhAi3Re5Mpm/0LE+0L3XS7P E5zzK2583WaNrciL9x8fCRD87eyT+9tiOhMVwDyEYEUCTWDR0f2ht4c81Rrw0+uK5ato OFbn5VjCohCAspIkdUBq4X928PJg5kiLmWtJOR+A2Ij54yyvYr8cwlfeQHnCS43jeu1x a2uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:subject:cc:to:from :message-id:date:dkim-signature:dkim-signature; bh=H1bqe7m7tzcdiiyMhmdZu9P/zQzA8HP1WWn/pLXkfYo=; b=I3Wzd9QCGGj6oSH4PuCJML2c1yMPbvFIXWMmgVo8wM1g9JeyEdJVt6++3+GyZmb4YR kyt5O6j2jEpS+lDNFdVmrVTB6+N7bS4XVBvjfc/UjJk1I0G3/zOmPXJ2kX6PVQOyBIqr m6SXXjHWtoIQ9TMWl4iT3+QCwJkAKe4aUsZg3s/iMX9Ra00E0WCinTErO4JXe5q8GzdB HctQCNWwfev0+VliFUX+t5X2PLSe0VRPvyvjd81HWWSbGGP/ewHqCZppvrs6qOyU+6WK igA9Qfc3BS1/ZF2tIqndK93adZXujF1dj+vj1ed+ICbiewTi+fCe9p2xoqkPLyoiA0O0 cAbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=J5RWkiql; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u15-20020a170903124f00b00153b2d1653asi9361373plh.322.2022.04.22.13.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:23:24 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=J5RWkiql; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A1C1236691; Fri, 22 Apr 2022 12:10:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447707AbiDVNGs (ORCPT + 99 others); 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") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 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. 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; } -- 2.31.1