Message ID | 1681311127-6891-1-git-send-email-manikanta.guntupalli@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | gpio: zynq: fix zynqmp_gpio not an immutable chip warning | expand |
[AMD Official Use Only - General] > From: Manikanta Guntupalli <manikanta.guntupalli@amd.com> > Date: Wed, Apr 12, 2023 at 8:22 PM > Subject: [PATCH] gpio: zynq: fix zynqmp_gpio not an immutable chip warning > To: <michal.simek@xilinx.com>, <michal.simek@amd.com>, > <git@amd.com>, <shubhrajyoti.datta@xilinx.com>, > <srinivas.neeli@xilinx.com>, <linus.walleij@linaro.org>, <brgl@bgdev.pl>, > <linux-gpio@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, > <linux-kernel@vger.kernel.org> > Cc: <srinivas.goud@amd.com>, <manion05gk@gmail.com>, Manikanta > Guntupalli <manikanta.guntupalli@amd.com> > > > Make the struct irq_chip const and flag it as IRQCHIP_IMMUTABLE to fix > "gpio gpiochip1: (zynqmp_gpio): not an immutable chip" warning. > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
[AMD Official Use Only - General] > -----Original Message----- > From: Datta, Shubhrajyoti <shubhrajyoti.datta@amd.com> > Sent: Monday, April 24, 2023 10:23 AM > To: michal.simek@xilinx.com; Simek, Michal <michal.simek@amd.com>; git > (AMD-Xilinx) <git@amd.com>; shubhrajyoti.datta@xilinx.com; > srinivas.neeli@xilinx.com; linus.walleij@linaro.org; brgl@bgdev.pl; inux- > gpio@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org > Cc: Goud, Srinivas <srinivas.goud@amd.com>; manion05gk@gmail.com; > Guntupalli, Manikanta <manikanta.guntupalli@amd.com> > Subject: RE: [PATCH] gpio: zynq: fix zynqmp_gpio not an immutable chip > warning > > [AMD Official Use Only - General] > > > From: Manikanta Guntupalli <manikanta.guntupalli@amd.com> > > Date: Wed, Apr 12, 2023 at 8:22 PM > > Subject: [PATCH] gpio: zynq: fix zynqmp_gpio not an immutable chip > > warning > > To: <michal.simek@xilinx.com>, <michal.simek@amd.com>, > <git@amd.com>, > > <shubhrajyoti.datta@xilinx.com>, <srinivas.neeli@xilinx.com>, > > <linus.walleij@linaro.org>, <brgl@bgdev.pl>, > > <linux-gpio@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, > > <linux-kernel@vger.kernel.org> > > Cc: <srinivas.goud@amd.com>, <manion05gk@gmail.com>, Manikanta > > Guntupalli <manikanta.guntupalli@amd.com> > > > > > > Make the struct irq_chip const and flag it as IRQCHIP_IMMUTABLE to fix > > "gpio gpiochip1: (zynqmp_gpio): not an immutable chip" warning. > > > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Hi Manikanta, thanks for your patch! On Wed, Apr 12, 2023 at 4:52 PM Manikanta Guntupalli <manikanta.guntupalli@amd.com> wrote: > Make the struct irq_chip const and flag it as IRQCHIP_IMMUTABLE to fix > "gpio gpiochip1: (zynqmp_gpio): not an immutable chip" warning. > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Don't you need to also add gpiochip_disable_irq() in the .irq_mask() callback and gpiochip_enable_irq() in the .irq_unmask() callback as we do in most other conversions? Example: https://lore.kernel.org/linux-gpio/20230414-immutable-irqchips-2-v1-3-6b59a5186b00@linaro.org/ Yours, Linus Walleij
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 06c6401f02b8..6ce652673def 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -151,8 +151,8 @@ struct zynq_platform_data { int bank_max[ZYNQMP_GPIO_MAX_BANK]; }; -static struct irq_chip zynq_gpio_level_irqchip; -static struct irq_chip zynq_gpio_edge_irqchip; +static const struct irq_chip zynq_gpio_level_irqchip; +static const struct irq_chip zynq_gpio_edge_irqchip; /** * zynq_gpio_is_zynq - test if HW is zynq or zynqmp @@ -590,7 +590,7 @@ static void zynq_gpio_irq_relres(struct irq_data *d) } /* irq chip descriptor */ -static struct irq_chip zynq_gpio_level_irqchip = { +static const struct irq_chip zynq_gpio_level_irqchip = { .name = DRIVER_NAME, .irq_enable = zynq_gpio_irq_enable, .irq_eoi = zynq_gpio_irq_ack, @@ -601,10 +601,11 @@ static struct irq_chip zynq_gpio_level_irqchip = { .irq_request_resources = zynq_gpio_irq_reqres, .irq_release_resources = zynq_gpio_irq_relres, .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED | - IRQCHIP_MASK_ON_SUSPEND, + IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; -static struct irq_chip zynq_gpio_edge_irqchip = { +static const struct irq_chip zynq_gpio_edge_irqchip = { .name = DRIVER_NAME, .irq_enable = zynq_gpio_irq_enable, .irq_ack = zynq_gpio_irq_ack, @@ -614,7 +615,8 @@ static struct irq_chip zynq_gpio_edge_irqchip = { .irq_set_wake = zynq_gpio_set_wake, .irq_request_resources = zynq_gpio_irq_reqres, .irq_release_resources = zynq_gpio_irq_relres, - .flags = IRQCHIP_MASK_ON_SUSPEND, + .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio, @@ -962,7 +964,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) /* Set up the GPIO irqchip */ girq = &chip->irq; - girq->chip = &zynq_gpio_edge_irqchip; + gpio_irq_chip_set_chip(girq, &zynq_gpio_edge_irqchip); girq->parent_handler = zynq_gpio_irqhandler; girq->num_parents = 1; girq->parents = devm_kcalloc(&pdev->dev, 1,
Make the struct irq_chip const and flag it as IRQCHIP_IMMUTABLE to fix "gpio gpiochip1: (zynqmp_gpio): not an immutable chip" warning. Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> --- drivers/gpio/gpio-zynq.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)