All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
@ 2016-09-07  8:12 ` Marc Zyngier
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2016-09-07  8:12 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-arm-kernel, linux-kernel

Using a default trigger is a bad idea if using DT to configure
interrupts, as the device's interrupt specifier will always contain
the trigger configuration.

Let's warn about that particular situation, and revert to not
having a default. Hopefully, the couple of drivers still using
this feature will quickly be fixed.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
Send the tested patch this time around...

 drivers/gpio/gpiolib.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 53ff25a..5707b5d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1617,6 +1617,15 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 	if (gpiochip->of_node)
 		of_node = gpiochip->of_node;
 #endif
+	/*
+	 * Specifying a default trigger is a terrible idea if DT is
+	 * used to configure the interrupts, as you may end-up with
+	 * conflicting triggers. Tell the user, and reset to NONE.
+	 */
+	if (WARN(of_node && type != IRQ_TYPE_NONE,
+		 "%s: Ignoring %d default trigger\n", of_node->full_name, type))
+		type = IRQ_TYPE_NONE;
+
 	gpiochip->irqchip = irqchip;
 	gpiochip->irq_handler = handler;
 	gpiochip->irq_default_type = type;
-- 
2.1.4

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

* [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
@ 2016-09-07  8:12 ` Marc Zyngier
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2016-09-07  8:12 UTC (permalink / raw)
  To: linux-arm-kernel

Using a default trigger is a bad idea if using DT to configure
interrupts, as the device's interrupt specifier will always contain
the trigger configuration.

Let's warn about that particular situation, and revert to not
having a default. Hopefully, the couple of drivers still using
this feature will quickly be fixed.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
Send the tested patch this time around...

 drivers/gpio/gpiolib.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 53ff25a..5707b5d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1617,6 +1617,15 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 	if (gpiochip->of_node)
 		of_node = gpiochip->of_node;
 #endif
+	/*
+	 * Specifying a default trigger is a terrible idea if DT is
+	 * used to configure the interrupts, as you may end-up with
+	 * conflicting triggers. Tell the user, and reset to NONE.
+	 */
+	if (WARN(of_node && type != IRQ_TYPE_NONE,
+		 "%s: Ignoring %d default trigger\n", of_node->full_name, type))
+		type = IRQ_TYPE_NONE;
+
 	gpiochip->irqchip = irqchip;
 	gpiochip->irq_handler = handler;
 	gpiochip->irq_default_type = type;
-- 
2.1.4

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

* Re: [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
  2016-09-07  8:12 ` Marc Zyngier
@ 2016-09-07 22:18   ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2016-09-07 22:18 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: linux-arm-kernel, linux-kernel

On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:

> Using a default trigger is a bad idea if using DT to configure
> interrupts, as the device's interrupt specifier will always contain
> the trigger configuration.
>
> Let's warn about that particular situation, and revert to not
> having a default. Hopefully, the couple of drivers still using
> this feature will quickly be fixed.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Send the tested patch this time around...

I got it the first time, don't worry :D

Yours,
Linus Walleij

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

* [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
@ 2016-09-07 22:18   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2016-09-07 22:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:

> Using a default trigger is a bad idea if using DT to configure
> interrupts, as the device's interrupt specifier will always contain
> the trigger configuration.
>
> Let's warn about that particular situation, and revert to not
> having a default. Hopefully, the couple of drivers still using
> this feature will quickly be fixed.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Send the tested patch this time around...

I got it the first time, don't worry :D

Yours,
Linus Walleij

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

* Re: [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
  2016-09-07 22:18   ` Linus Walleij
@ 2016-09-08 17:13     ` Marc Zyngier
  -1 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2016-09-08 17:13 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-arm-kernel, linux-kernel

On 07/09/16 23:18, Linus Walleij wrote:
> On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> 
>> Using a default trigger is a bad idea if using DT to configure
>> interrupts, as the device's interrupt specifier will always contain
>> the trigger configuration.
>>
>> Let's warn about that particular situation, and revert to not
>> having a default. Hopefully, the couple of drivers still using
>> this feature will quickly be fixed.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> Send the tested patch this time around...
> 
> I got it the first time, don't worry :D

Errrr, the first one didn't even compile (I'm such a moron sometimes).
Please apply this one instead, which has actually been compile-tested.

Sorry for the noise.

Thanks,

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

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

* [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
@ 2016-09-08 17:13     ` Marc Zyngier
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2016-09-08 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/09/16 23:18, Linus Walleij wrote:
> On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> 
>> Using a default trigger is a bad idea if using DT to configure
>> interrupts, as the device's interrupt specifier will always contain
>> the trigger configuration.
>>
>> Let's warn about that particular situation, and revert to not
>> having a default. Hopefully, the couple of drivers still using
>> this feature will quickly be fixed.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> Send the tested patch this time around...
> 
> I got it the first time, don't worry :D

Errrr, the first one didn't even compile (I'm such a moron sometimes).
Please apply this one instead, which has actually been compile-tested.

Sorry for the noise.

Thanks,

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

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

* Re: [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
  2016-09-08 17:13     ` Marc Zyngier
@ 2016-09-12  9:05       ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2016-09-12  9:05 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: linux-arm-kernel, linux-kernel

On Thu, Sep 8, 2016 at 7:13 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 07/09/16 23:18, Linus Walleij wrote:
>> On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>>
>>> Using a default trigger is a bad idea if using DT to configure
>>> interrupts, as the device's interrupt specifier will always contain
>>> the trigger configuration.
>>>
>>> Let's warn about that particular situation, and revert to not
>>> having a default. Hopefully, the couple of drivers still using
>>> this feature will quickly be fixed.
>>>
>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>> ---
>>> Send the tested patch this time around...
>>
>> I got it the first time, don't worry :D
>
> Errrr, the first one didn't even compile (I'm such a moron sometimes).
> Please apply this one instead, which has actually been compile-tested.
>
> Sorry for the noise.

Sending premature patches is human.

Backed the buggy one out and applied this instead!

Yours,
Linus Walleij

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

* [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT
@ 2016-09-12  9:05       ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2016-09-12  9:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 8, 2016 at 7:13 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 07/09/16 23:18, Linus Walleij wrote:
>> On Wed, Sep 7, 2016 at 10:12 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>>
>>> Using a default trigger is a bad idea if using DT to configure
>>> interrupts, as the device's interrupt specifier will always contain
>>> the trigger configuration.
>>>
>>> Let's warn about that particular situation, and revert to not
>>> having a default. Hopefully, the couple of drivers still using
>>> this feature will quickly be fixed.
>>>
>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>> ---
>>> Send the tested patch this time around...
>>
>> I got it the first time, don't worry :D
>
> Errrr, the first one didn't even compile (I'm such a moron sometimes).
> Please apply this one instead, which has actually been compile-tested.
>
> Sorry for the noise.

Sending premature patches is human.

Backed the buggy one out and applied this instead!

Yours,
Linus Walleij

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

end of thread, other threads:[~2016-09-12  9:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07  8:12 [PATCH v2] gpio/gpiolib: Forbid irqchip default trigger if probed over DT Marc Zyngier
2016-09-07  8:12 ` Marc Zyngier
2016-09-07 22:18 ` Linus Walleij
2016-09-07 22:18   ` Linus Walleij
2016-09-08 17:13   ` Marc Zyngier
2016-09-08 17:13     ` Marc Zyngier
2016-09-12  9:05     ` Linus Walleij
2016-09-12  9:05       ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.