linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] gpio: max77620: Make the irqchip immutable
@ 2022-05-04 14:44 Jon Hunter
  2022-05-04 15:01 ` Marc Zyngier
  2022-05-05 12:42 ` Bartosz Golaszewski
  0 siblings, 2 replies; 5+ messages in thread
From: Jon Hunter @ 2022-05-04 14:44 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Marc Zyngier
  Cc: linux-gpio, linux-kernel, linux-tegra, Jon Hunter

Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as
immutable") added a warning to indicate if the gpiolib is altering the
internals of irqchips. Following this change the following warning is
now observed for the max77620 gpio driver ...

 WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip,
 	please consider fixing it!

Fix the above warning by making the max77620 gpio driver immutable.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
Changes since V1:
- Dropped irq_print_chip callback
- Fixed up the irq_mask/unmask callbacks

 drivers/gpio/gpio-max77620.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index ebf9dea6546b..c18b60e39a94 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -54,6 +54,7 @@ static void max77620_gpio_irq_mask(struct irq_data *data)
 	struct max77620_gpio *gpio = gpiochip_get_data(chip);
 
 	gpio->irq_enabled[data->hwirq] = false;
+	gpiochip_disable_irq(chip, data->hwirq);
 }
 
 static void max77620_gpio_irq_unmask(struct irq_data *data)
@@ -61,6 +62,7 @@ static void max77620_gpio_irq_unmask(struct irq_data *data)
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct max77620_gpio *gpio = gpiochip_get_data(chip);
 
+	gpiochip_enable_irq(chip, data->hwirq);
 	gpio->irq_enabled[data->hwirq] = true;
 }
 
@@ -119,14 +121,15 @@ static void max77620_gpio_bus_sync_unlock(struct irq_data *data)
 	mutex_unlock(&gpio->buslock);
 }
 
-static struct irq_chip max77620_gpio_irqchip = {
+static const struct irq_chip max77620_gpio_irqchip = {
 	.name		= "max77620-gpio",
 	.irq_mask	= max77620_gpio_irq_mask,
 	.irq_unmask	= max77620_gpio_irq_unmask,
 	.irq_set_type	= max77620_gpio_set_irq_type,
 	.irq_bus_lock	= max77620_gpio_bus_lock,
 	.irq_bus_sync_unlock = max77620_gpio_bus_sync_unlock,
-	.flags		= IRQCHIP_MASK_ON_SUSPEND,
+	.flags		= IRQCHIP_IMMUTABLE | IRQCHIP_MASK_ON_SUSPEND,
+	GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static int max77620_gpio_dir_input(struct gpio_chip *gc, unsigned int offset)
@@ -318,7 +321,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
 	mgpio->gpio_chip.base = -1;
 
 	girq = &mgpio->gpio_chip.irq;
-	girq->chip = &max77620_gpio_irqchip;
+	gpio_irq_chip_set_chip(girq, &max77620_gpio_irqchip);
 	/* This will let us handle the parent IRQ in the driver */
 	girq->parent_handler = NULL;
 	girq->num_parents = 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] gpio: max77620: Make the irqchip immutable
  2022-05-04 14:44 [PATCH V2] gpio: max77620: Make the irqchip immutable Jon Hunter
@ 2022-05-04 15:01 ` Marc Zyngier
  2022-05-05 12:42 ` Bartosz Golaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2022-05-04 15:01 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, linux-kernel,
	linux-tegra

On Wed, 04 May 2022 15:44:06 +0100,
Jon Hunter <jonathanh@nvidia.com> wrote:
> 
> Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as
> immutable") added a warning to indicate if the gpiolib is altering the
> internals of irqchips. Following this change the following warning is
> now observed for the max77620 gpio driver ...
> 
>  WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip,
>  	please consider fixing it!
> 
> Fix the above warning by making the max77620 gpio driver immutable.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

Reviewed-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] gpio: max77620: Make the irqchip immutable
  2022-05-04 14:44 [PATCH V2] gpio: max77620: Make the irqchip immutable Jon Hunter
  2022-05-04 15:01 ` Marc Zyngier
@ 2022-05-05 12:42 ` Bartosz Golaszewski
  2022-05-05 12:54   ` Marc Zyngier
  1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2022-05-05 12:42 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Linus Walleij, Marc Zyngier, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, linux-tegra

On Wed, May 4, 2022 at 4:44 PM Jon Hunter <jonathanh@nvidia.com> wrote:
>
> Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as
> immutable") added a warning to indicate if the gpiolib is altering the
> internals of irqchips. Following this change the following warning is
> now observed for the max77620 gpio driver ...
>
>  WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip,
>         please consider fixing it!
>
> Fix the above warning by making the max77620 gpio driver immutable.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---

Queued for fixes, thanks!

Bart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] gpio: max77620: Make the irqchip immutable
  2022-05-05 12:42 ` Bartosz Golaszewski
@ 2022-05-05 12:54   ` Marc Zyngier
  2022-05-05 12:57     ` Bartosz Golaszewski
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2022-05-05 12:54 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Jon Hunter, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, linux-tegra

On 2022-05-05 13:42, Bartosz Golaszewski wrote:
> On Wed, May 4, 2022 at 4:44 PM Jon Hunter <jonathanh@nvidia.com> wrote:
>> 
>> Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as
>> immutable") added a warning to indicate if the gpiolib is altering the
>> internals of irqchips. Following this change the following warning is
>> now observed for the max77620 gpio driver ...
>> 
>>  WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip,
>>         please consider fixing it!
>> 
>> Fix the above warning by making the max77620 gpio driver immutable.
>> 
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
> 
> Queued for fixes, thanks!

You mean fixes for *5.19*, right?

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] gpio: max77620: Make the irqchip immutable
  2022-05-05 12:54   ` Marc Zyngier
@ 2022-05-05 12:57     ` Bartosz Golaszewski
  0 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2022-05-05 12:57 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Jon Hunter, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, linux-tegra

On Thu, May 5, 2022 at 2:54 PM Marc Zyngier <maz@kernel.org> wrote:
>
> On 2022-05-05 13:42, Bartosz Golaszewski wrote:
> > On Wed, May 4, 2022 at 4:44 PM Jon Hunter <jonathanh@nvidia.com> wrote:
> >>
> >> Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as
> >> immutable") added a warning to indicate if the gpiolib is altering the
> >> internals of irqchips. Following this change the following warning is
> >> now observed for the max77620 gpio driver ...
> >>
> >>  WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip,
> >>         please consider fixing it!
> >>
> >> Fix the above warning by making the max77620 gpio driver immutable.
> >>
> >> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> >> ---
> >
> > Queued for fixes, thanks!
>
> You mean fixes for *5.19*, right?
>

Of course I did. 100%. And I'll stick to this version. :)

(Thanks for the heads-up!)

Bart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-05 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 14:44 [PATCH V2] gpio: max77620: Make the irqchip immutable Jon Hunter
2022-05-04 15:01 ` Marc Zyngier
2022-05-05 12:42 ` Bartosz Golaszewski
2022-05-05 12:54   ` Marc Zyngier
2022-05-05 12:57     ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).