netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mv88e6xxx: question: can switch irq be shared?
@ 2018-08-17  9:30 Marek Behún
  2018-08-17 10:09 ` [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ Marek Behún
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marek Behún @ 2018-08-17  9:30 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, Marek Behún

Hello, I am wondering if the main device irq in
dsa/mv88e6xxx/chip.c can be requested as shared (see patch below).

The reason is that our board is wired so that irqs from all switches
come to the same gpio.

Marek
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index d90656e415b0..1caaa09e391e 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -424,7 +424,8 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip)
 
 	err = request_threaded_irq(chip->irq, NULL,
 				   mv88e6xxx_g1_irq_thread_fn,
-				   IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
+				   IRQF_ONESHOT | IRQF_TRIGGER_FALLING
+				   | IRQF_SHARED,
 				   dev_name(chip->dev), chip);
 	if (err)
 		mv88e6xxx_g1_irq_free_common(chip);

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

* [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ
  2018-08-17  9:30 mv88e6xxx: question: can switch irq be shared? Marek Behún
@ 2018-08-17 10:09 ` Marek Behún
  2018-08-17 16:29   ` David Miller
  2018-08-17 13:22 ` mv88e6xxx: question: can switch irq be shared? Andrew Lunn
  2018-08-17 16:28 ` David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Marek Behún @ 2018-08-17 10:09 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, Marek Behún

On some boards the interrupt can be shared between multiple devices.
For example on Turris Mox the interrupt is shared between all switches.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 8da3d39e3218..b57f5403982a 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -434,7 +434,7 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip)
 
 	err = request_threaded_irq(chip->irq, NULL,
 				   mv88e6xxx_g1_irq_thread_fn,
-				   IRQF_ONESHOT,
+				   IRQF_ONESHOT | IRQF_SHARED,
 				   dev_name(chip->dev), chip);
 	if (err)
 		mv88e6xxx_g1_irq_free_common(chip);
-- 
2.16.4

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

* Re: mv88e6xxx: question: can switch irq be shared?
  2018-08-17  9:30 mv88e6xxx: question: can switch irq be shared? Marek Behún
  2018-08-17 10:09 ` [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ Marek Behún
@ 2018-08-17 13:22 ` Andrew Lunn
  2018-08-17 16:28 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2018-08-17 13:22 UTC (permalink / raw)
  To: Marek Behún; +Cc: netdev

On Fri, Aug 17, 2018 at 11:30:55AM +0200, Marek Behún wrote:
> Hello, I am wondering if the main device irq in
> dsa/mv88e6xxx/chip.c can be requested as shared (see patch below).

This probably works O.K, but its not something anybody else has
done. So there could be some hidden issues.

      Andrew

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

* Re: mv88e6xxx: question: can switch irq be shared?
  2018-08-17  9:30 mv88e6xxx: question: can switch irq be shared? Marek Behún
  2018-08-17 10:09 ` [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ Marek Behún
  2018-08-17 13:22 ` mv88e6xxx: question: can switch irq be shared? Andrew Lunn
@ 2018-08-17 16:28 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-08-17 16:28 UTC (permalink / raw)
  To: marek.behun; +Cc: andrew, netdev

From: Marek Behún <marek.behun@nic.cz>
Date: Fri, 17 Aug 2018 11:30:55 +0200

> -				   IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
> +				   IRQF_ONESHOT | IRQF_TRIGGER_FALLING
> +				   | IRQF_SHARED,

The "|" operator shoudl end a line not start one.

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

* Re: [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ
  2018-08-17 10:09 ` [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ Marek Behún
@ 2018-08-17 16:29   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-08-17 16:29 UTC (permalink / raw)
  To: marek.behun; +Cc: andrew, netdev

From: Marek Behún <marek.behun@nic.cz>
Date: Fri, 17 Aug 2018 12:09:49 +0200

> On some boards the interrupt can be shared between multiple devices.
> For example on Turris Mox the interrupt is shared between all switches.
> 
> Signed-off-by: Marek Behun <marek.behun@nic.cz>

The net-next tree is closed, please resubmit when it opens back
up.

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

end of thread, other threads:[~2018-08-17 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17  9:30 mv88e6xxx: question: can switch irq be shared? Marek Behún
2018-08-17 10:09 ` [PATCH net-next] net: dsa: mv88e6xxx: Share main switch IRQ Marek Behún
2018-08-17 16:29   ` David Miller
2018-08-17 13:22 ` mv88e6xxx: question: can switch irq be shared? Andrew Lunn
2018-08-17 16:28 ` David Miller

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