linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bcma: gpio: Convert to immutable gpio irqchip
@ 2022-10-12 19:23 Linus Walleij
  2022-10-13 10:21 ` Marc Zyngier
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Linus Walleij @ 2022-10-12 19:23 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless, Linus Walleij, Marc Zyngier, Bartosz Golaszewski

This switches the BCMA gpio irqchip to be immutable.

Tested on the D-Link DWL-6810AP.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/bcma/driver_gpio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index fac8ff983aec..eff6fc330632 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -82,6 +82,7 @@ static void bcma_gpio_irq_unmask(struct irq_data *d)
 	int gpio = irqd_to_hwirq(d);
 	u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
 
+	gpiochip_enable_irq(gc, gpio);
 	bcma_chipco_gpio_polarity(cc, BIT(gpio), val);
 	bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio));
 }
@@ -93,12 +94,15 @@ static void bcma_gpio_irq_mask(struct irq_data *d)
 	int gpio = irqd_to_hwirq(d);
 
 	bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
+	gpiochip_disable_irq(gc, gpio);
 }
 
-static struct irq_chip bcma_gpio_irq_chip = {
+static const struct irq_chip bcma_gpio_irq_chip = {
 	.name		= "BCMA-GPIO",
 	.irq_mask	= bcma_gpio_irq_mask,
 	.irq_unmask	= bcma_gpio_irq_unmask,
+	.flags		= IRQCHIP_IMMUTABLE,
+	GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
@@ -139,7 +143,7 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
 	bcma_chipco_gpio_intmask(cc, ~0, 0);
 	bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
 
-	girq->chip = &bcma_gpio_irq_chip;
+	gpio_irq_chip_set_chip(girq, &bcma_gpio_irq_chip);
 	/* This will let us handle the parent IRQ in the driver */
 	girq->parent_handler = NULL;
 	girq->num_parents = 0;
-- 
2.34.1


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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-12 19:23 [PATCH] bcma: gpio: Convert to immutable gpio irqchip Linus Walleij
@ 2022-10-13 10:21 ` Marc Zyngier
  2022-10-14  9:05 ` Bartosz Golaszewski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2022-10-13 10:21 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rafał Miłecki, linux-wireless, Bartosz Golaszewski

On Wed, 12 Oct 2022 20:23:48 +0100,
Linus Walleij <linus.walleij@linaro.org> wrote:
> 
> This switches the BCMA gpio irqchip to be immutable.
> 
> Tested on the D-Link DWL-6810AP.
> 
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Rafał Miłecki <zajec5@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

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

	M.

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

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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-12 19:23 [PATCH] bcma: gpio: Convert to immutable gpio irqchip Linus Walleij
  2022-10-13 10:21 ` Marc Zyngier
@ 2022-10-14  9:05 ` Bartosz Golaszewski
  2022-10-14  9:08   ` Linus Walleij
  2022-10-15  4:51 ` Kalle Valo
  2022-10-19  6:02 ` Kalle Valo
  3 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2022-10-14  9:05 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Rafał Miłecki, linux-wireless, Marc Zyngier

On Wed, Oct 12, 2022 at 9:25 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This switches the BCMA gpio irqchip to be immutable.
>
> Tested on the D-Link DWL-6810AP.
>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Rafał Miłecki <zajec5@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---

Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>

Why is this here and not in drivers/gpio/?

Bart

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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-14  9:05 ` Bartosz Golaszewski
@ 2022-10-14  9:08   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2022-10-14  9:08 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Rafał Miłecki, linux-wireless, Marc Zyngier

On Fri, Oct 14, 2022 at 11:05 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> On Wed, Oct 12, 2022 at 9:25 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > This switches the BCMA gpio irqchip to be immutable.
> >
> > Tested on the D-Link DWL-6810AP.
> >
> > Cc: Marc Zyngier <maz@kernel.org>
> > Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> > Cc: Rafał Miłecki <zajec5@gmail.com>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
>
> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
>
> Why is this here and not in drivers/gpio/?

I don't remember exactly but I think it was that it would needlessly
expose all of the gory BCMA details into a global header so it was
the lesser evil.

Yours,
Linus Walleij

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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-12 19:23 [PATCH] bcma: gpio: Convert to immutable gpio irqchip Linus Walleij
  2022-10-13 10:21 ` Marc Zyngier
  2022-10-14  9:05 ` Bartosz Golaszewski
@ 2022-10-15  4:51 ` Kalle Valo
  2022-10-15 10:00   ` Marc Zyngier
  2022-10-19  6:02 ` Kalle Valo
  3 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2022-10-15  4:51 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rafał Miłecki, linux-wireless, Marc Zyngier,
	Bartosz Golaszewski

Linus Walleij <linus.walleij@linaro.org> writes:

> This switches the BCMA gpio irqchip to be immutable.
>
> Tested on the D-Link DWL-6810AP.

I'm not familiar with the gpio system, what's the benefit from this? I
can add that to the commit log.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-15  4:51 ` Kalle Valo
@ 2022-10-15 10:00   ` Marc Zyngier
  2022-10-19  6:04     ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2022-10-15 10:00 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Linus Walleij, Rafał Miłecki, linux-wireless,
	Bartosz Golaszewski

On Sat, 15 Oct 2022 05:51:01 +0100,
Kalle Valo <kvalo@kernel.org> wrote:
> 
> Linus Walleij <linus.walleij@linaro.org> writes:
> 
> > This switches the BCMA gpio irqchip to be immutable.
> >
> > Tested on the D-Link DWL-6810AP.
> 
> I'm not familiar with the gpio system, what's the benefit from this? I
> can add that to the commit log.

TL;DR: the GPIO subsystem plays dirty tricks on the irqchip
structures, and we're fixing it one driver at a time.

See merge commit 4bde53ab3370 for all the details.

Thanks,

	M.

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

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

* Re: bcma: gpio: Convert to immutable gpio irqchip
  2022-10-12 19:23 [PATCH] bcma: gpio: Convert to immutable gpio irqchip Linus Walleij
                   ` (2 preceding siblings ...)
  2022-10-15  4:51 ` Kalle Valo
@ 2022-10-19  6:02 ` Kalle Valo
  3 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2022-10-19  6:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Rafał Miłecki, linux-wireless, Linus Walleij,
	Marc Zyngier, Bartosz Golaszewski

Linus Walleij <linus.walleij@linaro.org> wrote:

> This switches the BCMA gpio irqchip to be immutable. The GPIO subsystem plays
> tricks on the irqchip structures, and we're fixing it one driver at a time. See
> merge commit 4bde53ab3370 ("Merge branch irq/gpio-immutable into
> irq/irqchip-next") for all the details.
> 
> Tested on the D-Link DWL-6810AP.
> 
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Rafał Miłecki <zajec5@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Marc Zyngier <maz@kernel.org>
> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>

Patch applied to wireless-next.git, thanks.

55549d6a3052 bcma: gpio: Convert to immutable gpio irqchip

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221012192348.2234478-1-linus.walleij@linaro.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH] bcma: gpio: Convert to immutable gpio irqchip
  2022-10-15 10:00   ` Marc Zyngier
@ 2022-10-19  6:04     ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2022-10-19  6:04 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Linus Walleij, Rafał Miłecki, linux-wireless,
	Bartosz Golaszewski

Marc Zyngier <maz@kernel.org> writes:

> On Sat, 15 Oct 2022 05:51:01 +0100,
> Kalle Valo <kvalo@kernel.org> wrote:
>> 
>> Linus Walleij <linus.walleij@linaro.org> writes:
>> 
>> > This switches the BCMA gpio irqchip to be immutable.
>> >
>> > Tested on the D-Link DWL-6810AP.
>> 
>> I'm not familiar with the gpio system, what's the benefit from this? I
>> can add that to the commit log.
>
> TL;DR: the GPIO subsystem plays dirty tricks on the irqchip
> structures, and we're fixing it one driver at a time.
>
> See merge commit 4bde53ab3370 for all the details.

Thanks, I included this to the commit log.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2022-10-19  6:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 19:23 [PATCH] bcma: gpio: Convert to immutable gpio irqchip Linus Walleij
2022-10-13 10:21 ` Marc Zyngier
2022-10-14  9:05 ` Bartosz Golaszewski
2022-10-14  9:08   ` Linus Walleij
2022-10-15  4:51 ` Kalle Valo
2022-10-15 10:00   ` Marc Zyngier
2022-10-19  6:04     ` Kalle Valo
2022-10-19  6:02 ` Kalle Valo

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).