[PATCH v3 net-next 0/2] Fixes to allow mv88e6xxx module to be reloaded

STALE3130d

Revision v3 of 3 in this series.

7 messages, 3 authors, 2018-03-26 · open the first message on its own page

[PATCH v3 net-next 0/2] Fixes to allow mv88e6xxx module to be reloaded

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-25 21:43:41

As reported by Uwe Kleine-König, the interrupt trigger is first
configured by DT and then reconfigured to edge. This results in a
failure on EPROBE_DEFER, or if the module is unloaded and reloaded.

A second crash happens on module reload due to a missing call to the
common IRQ free code when using polled interrupts.

With these fixes in place, it becomes possible to load and unload the
kernel modules a few times without it crashing.

v2: Fix the ü in Künig a couple of times
v3: But the ü should be an ö!

Andrew Lunn (2):
  net: dsa: mv88e6xxx: Use the DT IRQ trigger mode
  net: dsa: mv88e6xxx: Call the common IRQ free code

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

-- 
2.16.2

[PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Use the DT IRQ trigger mode

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-25 21:43:57

By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
we override the trigger mode provided in device tree. And the
interrupt is actually active low, which is what all the current device
tree descriptions use.

Suggested-by: Uwe Kleine-König <redacted>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
v2: Fix the ü in Künig
v3: Which should actually be an ö
---
 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 fd78378ad6b1..3ba77067a3dc 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -425,7 +425,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_TRIGGER_FALLING,
+				   IRQF_ONESHOT,
 				   dev_name(chip->dev), chip);
 	if (err)
 		mv88e6xxx_g1_irq_free_common(chip);
-- 
2.16.2

[PATCH v3 net-next 2/2] net: dsa: mv88e6xxx: Call the common IRQ free code

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-25 21:44:12

When free'ing the polled IRQs, call the common irq free code.
Otherwise the interrupts are left registered, and when we come to load
the driver a second time, we get an Opps.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 3ba77067a3dc..9a5d786b4885 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -467,6 +467,8 @@ static int mv88e6xxx_irq_poll_setup(struct mv88e6xxx_chip *chip)
 
 static void mv88e6xxx_irq_poll_free(struct mv88e6xxx_chip *chip)
 {
+	mv88e6xxx_g1_irq_free_common(chip);
+
 	kthread_cancel_delayed_work_sync(&chip->irq_poll_work);
 	kthread_destroy_worker(chip->kworker);
 }
-- 
2.16.2

Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Use the DT IRQ trigger mode

From: Uwe Kleine-König <hidden>
Date: 2018-03-25 21:54:29

On Sun, Mar 25, 2018 at 11:43:14PM +0200, Andrew Lunn wrote:
By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
we override the trigger mode provided in device tree. And the
interrupt is actually active low, which is what all the current device
tree descriptions use.

Suggested-by: Uwe Kleine-König <redacted>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Thanks Andrew for the respin.

Acked-by: Uwe Kleine-König <redacted>
Tested-by: Uwe Kleine-König <redacted>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Use the DT IRQ trigger mode

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-25 22:02:42

On Sun, Mar 25, 2018 at 11:54:24PM +0200, Uwe Kleine-König wrote:
On Sun, Mar 25, 2018 at 11:43:14PM +0200, Andrew Lunn wrote:
quoted
By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
we override the trigger mode provided in device tree. And the
interrupt is actually active low, which is what all the current device
tree descriptions use.

Suggested-by: Uwe Kleine-König <redacted>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Thanks Andrew for the respin.
Hi Uwe

Sorry for getting your name wrong so many time. I should know better,
'little king' makes sense.

	Andrew

Re: [PATCH v3 net-next 1/2] net: dsa: mv88e6xxx: Use the DT IRQ trigger mode

From: Uwe Kleine-König <hidden>
Date: 2018-03-25 22:04:58

Hi Andrew,

On Mon, Mar 26, 2018 at 12:02:37AM +0200, Andrew Lunn wrote:
On Sun, Mar 25, 2018 at 11:54:24PM +0200, Uwe Kleine-König wrote:
quoted
On Sun, Mar 25, 2018 at 11:43:14PM +0200, Andrew Lunn wrote:
quoted
By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
we override the trigger mode provided in device tree. And the
interrupt is actually active low, which is what all the current device
tree descriptions use.

Suggested-by: Uwe Kleine-König <redacted>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Thanks Andrew for the respin.
Sorry for getting your name wrong so many time. I should know better,
'little king' makes sense.
No problem. Making mistakes is fine if you're ready to correct them :-)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Re: [PATCH v3 net-next 0/2] Fixes to allow mv88e6xxx module to be reloaded

From: David Miller <davem@davemloft.net>
Date: 2018-03-26 00:43:59

From: Andrew Lunn <andrew@lunn.ch>
Date: Sun, 25 Mar 2018 23:43:13 +0200
As reported by Uwe Kleine-König, the interrupt trigger is first
configured by DT and then reconfigured to edge. This results in a
failure on EPROBE_DEFER, or if the module is unloaded and reloaded.

A second crash happens on module reload due to a missing call to the
common IRQ free code when using polled interrupts.

With these fixes in place, it becomes possible to load and unload the
kernel modules a few times without it crashing.

v2: Fix the ü in Künig a couple of times
v3: But the ü should be an ö!
Series applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help