Subject: Re: [PATCH] net: ks8851: Drop IRQ threading

From: Dmitry Torokhov <[email-masked]>
Date: Fri, 16 Dec 2022 13:54:56 -0800

On Fri, Dec 16, 2022 at 02:23:04PM +0100, Eric Dumazet wrote:
> On Fri, Dec 16, 2022 at 1:47 PM Marek Vasut <[email-masked]> wrote:
> >
> > 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...

> 
> 
> > "
> >
> > Signed-off-by: Marek Vasut <[email-masked]>
> > ---
> > Cc: "David S. Miller" <[email-masked]>
> > Cc: Dmitry Torokhov <[email-masked]>
> > Cc: Eric Dumazet <[email-masked]>
> > Cc: Geoff Levand <[email-masked]>
> > Cc: Jakub Kicinski <[email-masked]>
> > Cc: Linus Walleij <[email-masked]>
> > Cc: Paolo Abeni <[email-masked]>
> > Cc: Petr Machata <[email-masked]>
> > Cc: Wolfram Sang <[email-masked]>
> > To: [email-masked]
> > ---
> >  drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c
> > index cfbc900d4aeb9..1eba4ba0b95cf 100644
> > --- a/drivers/net/ethernet/micrel/ks8851_common.c
> > +++ b/drivers/net/ethernet/micrel/ks8851_common.c
> > @@ -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
> >

Thanks.

-- 
Dmitry