From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C0A606A321 for ; Fri, 27 Nov 2026 14:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=t5JK/v9X; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gihniDC1 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=mM+nlrhKbK4WC6Y/6cYKALQYZxBYN1UNsFQbvT8nqEE=; b=t5JK/v9XKFyOsY FGzKHGZxzs0L3lK9kYdWpvFYhixIBFJOWdrswJjmZHsgnOye4wbRJ6HxXsEhwwiH3L8QxajAsFS68 htEHsvL1sq9K+x5spqZcCauPB+MWBbdE8Byt7O1CCCFFJ4Uogeb3WMKElX9A8Vu6QlvAtORWGAPxr lEKlhv2aKrtJqwK7TDptsB7ZGfO22vihesmour5qH3hsrfZKa6+2owmuysoq7bL6ipP/zR+rDk7/S bTcnX1NRYm4Sq+6JrgyP2Uwubkk1jQ3obZFaf7U8VNo9+r+2Ci/IY6B7RtSj9gqZy38Kghh1bJual MLvnntezQcNShbO2rbJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWxJj-0000000GdTH-1QHW; Fri, 27 Nov 2026 14:52:51 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWxJg-0000000GdSM-0VO1 for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2026 14:52:48 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id DD09E40F07; Fri, 27 Nov 2026 14:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 918B11F0089A; Fri, 27 Nov 2026 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795791167; bh=mM+nlrhKbK4WC6Y/6cYKALQYZxBYN1UNsFQbvT8nqEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gihniDC1lmZypNC8Y/eiRa2wq6wsHAkzMRItNiA5EnTIjX6EBSyPeJRmzXNUXBJiJ jk7TaRWQRPDs5y/4NeWndSS30nDjJOPza4+Z03xMJ93On49w82HtG/3k4vO8YRfGI2 XyGIwa9/EYpoJVg8LOUiI+2blmVSZ3YYrXbP3TkbcXiWtXuTU9IqHYhOh9OKmrvdzU Te2vZPqLXJ/oQpdOxUXmQZNeEwSzq/8hcxRWXx39Fqy46OhVHrVLcAMyfZ9o1I0HXQ /bjPFYUWFxMvZxbFhne+xSJbRo0scUTCRibo+8r2XdvxYcNFwmyVxNwq0ymxdjhTFx skhxThoqZA2fw== From: Michael Walle To: William Breathitt Gray , Linus Walleij , Bartosz Golaszewski , Petar Stepanovic , SriNavmani A , Prasad Bolisetty , Tzu-Hao Wei , Karthikeyan Mitran , Mathieu Dubois-Briand , Michael Walle , Lee Jones , Andy Shevchenko , Long Zhao , Joseph Telaak Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFT PATCH v2 02/14] gpio: regmap: remove gpiochip before tearing down irqchip Date: Fri, 27 Nov 2026 15:52:19 +0100 Message-ID: <20261127145232.814492-3-mwalle@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261127145232.814492-1-mwalle@kernel.org> References: <20261127145232.814492-1-mwalle@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Long Zhao gpiochip_remove() calls acpi_gpiochip_free_interrupts() and gpiod_free_irqs(). Both still need the irq domain. regmap_del_irq_chip() removes that domain, so remove the gpiochip first. Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device") Signed-off-by: Long Zhao Signed-off-by: Michael Walle Reviewed-by: Andy Shevchenko --- drivers/gpio/gpio-regmap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 65e87177baf0..c04b79da5cdb 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -593,12 +593,19 @@ EXPORT_SYMBOL_GPL(gpio_regmap_register); */ void gpio_regmap_unregister(struct gpio_regmap *gpio) { + /* + * gpiochip_remove() runs acpi_gpiochip_free_interrupts() and + * gpiod_free_irqs(). Both still need the irq domain. + * regmap_del_irq_chip() removes that domain, so remove the + * gpiochip first. + */ + gpiochip_remove(&gpio->gpio_chip); + #ifdef CONFIG_REGMAP_IRQ if (gpio->irq_chip_data) regmap_del_irq_chip(gpio->regmap_irq_line, gpio->irq_chip_data); #endif - gpiochip_remove(&gpio->gpio_chip); bitmap_free(gpio->fixed_direction_output); bitmap_free(gpio->fixed_direction_mask); kfree(gpio); -- 2.47.3