Re: [patch] net, bcmgenet: Fix locking of netpoll facing functions

From: Mike Galbraith
Date: Thu Aug 28 2025 - 22:41:12 EST


On Thu, 2025-08-28 at 11:59 -0700, Florian Fainelli wrote:
> On 8/26/25 01:24, Mike Galbraith wrote:
> > Lockdep reports ring->lock to not be irq safe during netpoll/netconsole
> > session, resulting in a potential deadlock scenario.
> >
> >   Chain exists of:
> >     &host->lock --> target_list_lock --> &ring->lock
> >    Possible interrupt unsafe locking scenario:
> >          CPU0                    CPU1
> >          ----                    ----
> >     lock(&ring->lock);
> >                                  local_irq_disable();
> >                                  lock(&host->lock);
> >                                  lock(target_list_lock);
> >     <Interrupt>
> >       lock(&host->lock);
> >    *** DEADLOCK ***
> >
> > Prevent that via use of irqsave/restore spinlock variant when polling.
> >
> > Signed-off-by: Mike Galbraith <efault@xxxxxx>
>
> Your patch did not make it to the adequate mailing list which should be
> at least netdev@xxxxxxxxxxxxxxx. This is effectively a partial revert of
> b0447ecb533270cf857ebee1133cb8ff67115423 ("net: bcmgenet: relax lock
> constraints to reduce IRQ latency") therefore I would want Doug to chime
> in and review this.

Ah, just drop it, he'll likely do something way better.

-Mike