Re: [PATCH net-next 8/8] net: dsa: lan9645x: add port statistics
From: Andrew Lunn
Date: Tue Mar 03 2026 - 15:22:15 EST
> > +void lan9645x_stats_get_stats64(struct lan9645x *lan9645x, int port,
> > + struct rtnl_link_stats64 *stats)
> > +{
> > + u64 *port_cnt;
> > +
> > + /* Avoid stats update, as this is called very often by DSA. */
> > + mutex_lock(&lan9645x->stats->hw_lock);
>
> This is atomic context, you can't acquire a mutex which may be held by a
> process which sleeps, which also puts you to sleep for it.
Which suggests no testing has been done with kernel configuration
options enabled which does checks for this, deadlock detection, etc.
I would suggest PROVE_LOCKING, DEBUG_SPINLOCK, DEBUG_MUTEXES,
DEBUG_ATOMIC_SLEEP.
Andrew