Skip to contentSkip to conversation

net: ks8851: Drop IRQ threading

PATCH In review Marek Vasut 3 participants 6 messages Dec 16, 2022 – May 31, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ks8851: Drop IRQ threading

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!! "

---
Cc: "David S. Miller" <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Geoff Levand <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Petr Machata <[email protected]>
Cc: Wolfram Sang <[email protected]>
To: [email protected]

---
 drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/micrel/ks8851_common.c +1 -3
index cfbc900d4aeb9..1eba4ba0b95cf 100644
@@ -443,9 +443,7 @@ static int ks8851_net_open(struct net_device *dev)
 	unsigned long flags;
 	int ret;
 
-	ret = request_threaded_irq(dev->irq, NULL, ks8851_irq,
-				   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-				   dev->name, ks);
+	ret = request_irq(dev->irq, ks8851_irq, IRQF_TRIGGER_LOW, dev->name, ks);
 	if (ret < 0) {
 		netdev_err(dev, "failed to get irq\n");
 		return ret;
Signature · 1 line
2.35.1
#1 lore raw
Quoted 4 lines · Marek Vasut

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!

This changelog is a bit terse.

Why can other drivers use request_threaded_irq(), but not this one ?

Quoted 36 lines

"

---
Cc: "David S. Miller" <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Geoff Levand <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Petr Machata <[email protected]>
Cc: Wolfram Sang <[email protected]>
To: [email protected]

---
 drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/micrel/ks8851_common.c +1 -4
index cfbc900d4aeb9..1eba4ba0b95cf 100644
@@ -443,9 +443,7 @@ static int ks8851_net_open(struct net_device *dev)
        unsigned long flags;
        int ret;
 
-       ret = request_threaded_irq(dev->irq, NULL, ks8851_irq,
-                                  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-                                  dev->name, ks);
+       ret = request_irq(dev->irq, ks8851_irq, IRQF_TRIGGER_LOW, dev->name, ks);
        if (ret < 0) {
                netdev_err(dev, "failed to get irq\n");
                return ret;
--

2.35.1

#2 lore raw
Quoted 9 lines · Eric Dumazet
Quoted 4 lines · Marek Vasut

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!

This changelog is a bit terse.

Why can other drivers use request_threaded_irq(), but not this one ?

This one actually *has* to use threading, as (as far as I can see) the "lock" that is being taken in ks8851_irq for the SPI variant of the device is actually a mutex, so we have to be able to sleep in the interrupt handler...

Quoted 28 lines
Quoted 28 lines

"

---
Cc: "David S. Miller" <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Geoff Levand <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Petr Machata <[email protected]>
Cc: Wolfram Sang <[email protected]>
To: [email protected]

---
 drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/micrel/ks8851_common.c +0 -0
index cfbc900d4aeb9..1eba4ba0b95cf 100644
@@ -443,9 +443,7 @@ static int ks8851_net_open(struct net_device *dev)
        unsigned long flags;
        int ret;
 
Quoted 10 lines
Quoted 10 lines
drivers/net/ethernet/micrel/ks8851_common.c +1 -4
-       ret = request_threaded_irq(dev->irq, NULL, ks8851_irq,
-                                  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-                                  dev->name, ks);
+       ret = request_irq(dev->irq, ks8851_irq, IRQF_TRIGGER_LOW, dev->name, ks);
        if (ret < 0) {
                netdev_err(dev, "failed to get irq\n");
                return ret;
--

2.35.1

Thanks.

Signature · 1 line
Dmitry
#3 lore raw
Quoted 7 lines · Dmitry Torokhov
Quoted 6 lines · Eric Dumazet
Quoted 4 lines · Marek Vasut

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!

Quoted 8 lines
Quoted 3 lines

This changelog is a bit terse.

Why can other drivers use request_threaded_irq(), but not this one ?

This one actually *has* to use threading, as (as far as I can see) the "lock" that is being taken in ks8851_irq for the SPI variant of the device is actually a mutex, so we have to be able to sleep in the interrupt handler...

So maybe we should use threaded one for the SPI variant and non-threaded one for the Parallel bus variant ?

#4 lore raw
Quoted 12 lines · Marek Vasut
Quoted 11 lines · Dmitry Torokhov
Quoted 9 lines · Eric Dumazet
Quoted 4 lines · Marek Vasut

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!

This changelog is a bit terse.

Why can other drivers use request_threaded_irq(), but not this one ?

Quoted 7 lines
Quoted 4 lines

This one actually *has* to use threading, as (as far as I can see) the "lock" that is being taken in ks8851_irq for the SPI variant of the device is actually a mutex, so we have to be able to sleep in the interrupt handler...

So maybe we should use threaded one for the SPI variant and non-threaded one for the Parallel bus variant ?

I do not think the threading itself is the issue. I did a quick search and "Non-RCU local softirq work is pending" seems to be a somewhat common issue in network drivers. I think you should follow for example thread in https://lore.kernel.org/all/87y28b9nyn.ffs@tglx/t/ and collect the trace data and bug tglx and Paul. I see you are even on CC in that thread...

Thanks.

Signature · 1 line
Dmitry
#5 lore raw
Quoted 21 lines · Dmitry Torokhov
Quoted 12 lines · Marek Vasut
Quoted 11 lines · Dmitry Torokhov
Quoted 9 lines · Eric Dumazet
Quoted 4 lines · Marek Vasut

Request non-threaded IRQ in the KSZ8851 driver, this fixes the following warning:
"
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!

This changelog is a bit terse.

Why can other drivers use request_threaded_irq(), but not this one ?

Quoted 7 lines
Quoted 4 lines

This one actually *has* to use threading, as (as far as I can see) the "lock" that is being taken in ks8851_irq for the SPI variant of the device is actually a mutex, so we have to be able to sleep in the interrupt handler...

So maybe we should use threaded one for the SPI variant and non-threaded one for the Parallel bus variant ?

Quoted 6 lines

I do not think the threading itself is the issue. I did a quick search and "Non-RCU local softirq work is pending" seems to be a somewhat common issue in network drivers. I think you should follow for example thread in https://lore.kernel.org/all/87y28b9nyn.ffs@tglx/t/ and collect the trace data and bug tglx and Paul. I see you are even on CC in that thread...

I ran into this again, with Linux 6.1.30, the machine with this MAC just flat out freezes when the MAC comes up, if I add this patch the machine works as it should. I don't have a good explanation however. Any ideas?