From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBAEBC6FA90 for ; Wed, 21 Sep 2022 15:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=20Ff88p17FF1REqVtY3MP2RcNePCmElm9NE67dKopzM=; b=QsdSKuUzGxQlkL z5EM5gB1SZVkuyKQjYYARXzc2aypMz0CV8InASFMV7wz5fiReC6xXHJs06qkVJFM3oJ7cVGD0G/nx w9Hq3xgz5yKQDIaeyYAP8RZPAkYbWRoGikv61/Gx5rBJKptX2uDwMi6KW7FmI/bH1lBHTu4isZakm 49Lm2ZEBCdiY9vUVHER462SlehUXxp2gGcQnPEz+TmboXJfh2rEMBaP0ObTUZ2bpRYDwGhlG/dij+ D4JCYGYSgnUH6+cxIcJ+sLdOcRHl9k6I2R1dgbt1rZ05Nf5usvLsS8d7/BUzYTY2rGSXgriBX2SoQ 15VbDyVmXuB6Piv1mi/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob22e-00BqOO-93; Wed, 21 Sep 2022 15:53:40 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob22b-00BqNw-Jb for linux-arm-kernel@lists.infradead.org; Wed, 21 Sep 2022 15:53:38 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1700163178; Wed, 21 Sep 2022 15:53:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6C6FC433D6; Wed, 21 Sep 2022 15:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663775615; bh=QU8P21MuAyq1H6RBQVtU3ITuaSUzlij2SD4xr4QQmzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RS9XxNVaehHfTtZ6qG9gfFvp8TVd4009nXknORT6xp1Ntuy4zvai4b3gEYqZW7xPn ZlaH8Bn/poJmME3FMZoSfffClN2HRQgf34KjskbljNBgMqtjppqpW0Pry1LM9eOgw5 GL+GgyYh3+iaDYbjM0RK7jfpJXyljEuIn9vmlOrHmLY2223xGx/ojINd/jV8+INCxd kfLYAuNjM6GD/YWl9JUhBSYI2qOonS9oPExTV+eR8bywlEUWe1L6xBVgdbT6N3yGrD EZ+qKse7UzOP2veaY77KLx9YCawTBRDENXjPwCOhW6ZDltd4XH4rXT7YH0p5fzTIO5 7z+dCbWj2KfCA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Walleij , Marc Zyngier , Bartosz Golaszewski , Sasha Levin , linusw@kernel.org, kaloz@openwrt.org, khalasa@piap.pl, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 05/16] gpio: ixp4xx: Make irqchip immutable Date: Wed, 21 Sep 2022 11:53:21 -0400 Message-Id: <20220921155332.234913-5-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220921155332.234913-1-sashal@kernel.org> References: <20220921155332.234913-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_085337_766780_80E98055 X-CRM114-Status: GOOD ( 15.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Linus Walleij [ Upstream commit 94e9bc73d85aa6ecfe249e985ff57abe0ab35f34 ] This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical. Tested on the IXP4xx which uses drivers/ata/pata_ixp4xx_cf.c for a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller. Cc: Marc Zyngier Signed-off-by: Linus Walleij Acked-by: Marc Zyngier Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-ixp4xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c index 312309be0287..56656fb519f8 100644 --- a/drivers/gpio/gpio-ixp4xx.c +++ b/drivers/gpio/gpio-ixp4xx.c @@ -63,6 +63,14 @@ static void ixp4xx_gpio_irq_ack(struct irq_data *d) __raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS); } +static void ixp4xx_gpio_mask_irq(struct irq_data *d) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + + irq_chip_mask_parent(d); + gpiochip_disable_irq(gc, d->hwirq); +} + static void ixp4xx_gpio_irq_unmask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); @@ -72,6 +80,7 @@ static void ixp4xx_gpio_irq_unmask(struct irq_data *d) if (!(g->irq_edge & BIT(d->hwirq))) ixp4xx_gpio_irq_ack(d); + gpiochip_enable_irq(gc, d->hwirq); irq_chip_unmask_parent(d); } @@ -149,12 +158,14 @@ static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type) return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); } -static struct irq_chip ixp4xx_gpio_irqchip = { +static const struct irq_chip ixp4xx_gpio_irqchip = { .name = "IXP4GPIO", .irq_ack = ixp4xx_gpio_irq_ack, - .irq_mask = irq_chip_mask_parent, + .irq_mask = ixp4xx_gpio_mask_irq, .irq_unmask = ixp4xx_gpio_irq_unmask, .irq_set_type = ixp4xx_gpio_irq_set_type, + .flags = IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static int ixp4xx_gpio_child_to_parent_hwirq(struct gpio_chip *gc, @@ -263,7 +274,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) g->gc.owner = THIS_MODULE; girq = &g->gc.irq; - girq->chip = &ixp4xx_gpio_irqchip; + gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip); girq->fwnode = g->fwnode; girq->parent_domain = parent; girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq; -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel