Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6939860rwr; Wed, 10 May 2023 01:16:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sHZ490c0XqlfGac15cxPeLmAJAOxvl1S4pKh+GsISIySSfxubipS9E5JdsybwszTQo6qL X-Received: by 2002:a17:902:d2c4:b0:1ac:5717:fd2 with SMTP id n4-20020a170902d2c400b001ac57170fd2mr14367700plc.47.1683706601584; Wed, 10 May 2023 01:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683706601; cv=none; d=google.com; s=arc-20160816; b=Nke2CzeHmYtl2YL3SDm4vCMvAYRLDN7B9j7lEGxM/rcs/6B8l2BPhhZ5SOn4ImzC0P x0XwYE/g2P9Kw9AaJtAoWOdcY7id30+AOnmkSJIu0BRxbjW2yhxqUb5z5rBgqiD9ghLU pn0UtWHpAuRRb0zW6GpBFJ7R8tppsGS1dg9pK/sGnnAjoZCpHqhZdBbfksQy3xB2g/FQ uE7cpB/ZkhKuNbcJfYtBDR2dj1zXha/mWvJi5pxEjA0gA+ZNHgqNUZ51/b7x7ft9Wqx3 WyNIz8neoH8k5OVQwGQYbICQ6I73tWYix6iJAHnhw7uGHCB2OnagvjD/syq8AEnn653F rVVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=NqrDJz8RnJkpVBsn12vOmKn0Bdg2NXXKzxyGeZJCRrk=; b=O2GVOw2XefeoIO7fp6k24itOkUzEm1OBqJg+bUZDYv3132IZ5pZ7Hv65hLV2K0njMH qkFL1ML6LeLqROa2wWvcHRMqb8852uvHvQipfyx75rdHIJprHsSveStG5XpEIcSLHXCM XWv0b/QvV4Shjf4dmxi8U69MtKb8ojGKlDSW12UtZsB85FHrzC1C78MZgb4lS2IVT6DQ H39qRWdsI0m4EbYQZNv0ezhAncXOY9gHUa28ZJd7wpBX7fNcxiACvGHhtPYgNlkFd9A7 R0nwobpuUh0MvMrdcyHg/m6rvNkr7OKVVmxWCaHcUdTH7v5bj5FOqBrxdiVCIwjOM8k/ so5Q== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a170902c20d00b001ac53744492si3504332pll.2.2023.05.10.01.16.26; Wed, 10 May 2023 01:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230335AbjEJHm2 (ORCPT + 99 others); Wed, 10 May 2023 03:42:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235765AbjEJHm1 (ORCPT ); Wed, 10 May 2023 03:42:27 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09EEF26A2 for ; Wed, 10 May 2023 00:42:25 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 321ea111-ef06-11ed-b3cf-005056bd6ce9; Wed, 10 May 2023 10:42:21 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Wed, 10 May 2023 10:42:20 +0300 To: Chris Packham Cc: linus.walleij@linaro.org, brgl@bgdev.pl, mkshah@codeaurora.org, Ben Brown , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpiolib: Don't implicitly disable irq when masking Message-ID: References: <20230510001151.3946931-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230510001151.3946931-1-chris.packham@alliedtelesis.co.nz> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE 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 Wed, May 10, 2023 at 12:11:51PM +1200, Chris Packham kirjoitti: > When preparing to kexec into a new kernel the kexec code will mask all > interrupts for all interrupt domains before disabling them. In the case > of a gpio chip which has a mix of gpio and irq pins a warning would be > triggered as follows > [root@localhost ~]# echo c >/proc/sysrq-trigger Besides the very noisy traceback in the commit message (read https://kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages) see below. > This is because gpiochip_irq_mask was being used to mask all possible We refer to the functions in the form as follows gpiochip_irq_mask(). > irqs in the domain but gpiochip_disable_irq will WARN if any of those IRQs gpiochip_disable_irq() > gpios haven't been requested as interrupts yet. Remove the call to GPIOs > gpiochip_disable_irq to stop the warning. gpiochip_disable_irq() > Fixes: a8173820f441 ("gpio: gpiolib: Allow GPIO IRQs to lazy disable") > Signed-off-by: Chris Packham > --- > drivers/gpio/gpiolib.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 8c041a8dd9d8..903f5185ae55 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1451,7 +1451,6 @@ static void gpiochip_irq_mask(struct irq_data *d) > > if (gc->irq.irq_mask) > gc->irq.irq_mask(d); > - gpiochip_disable_irq(gc, d->hwirq); > } At the same time the gpiochip_irq_unmask() has the symmetrical call. Why? Also it's obvious that you have used outdated repository. You need to rebase against subsystem tree for-next branch. P.S. It's also makes sense to Cc to Marc Zyngier . -- With Best Regards, Andy Shevchenko