Re: [PATCH net-next 8/8] net: dsa: lan9645x: add port statistics

From: Jens Emil Schulz Ostergaard

Date: Wed Mar 04 2026 - 11:00:33 EST


On Tue, 2026-03-03 at 21:21 +0100, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> > > +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

I will run our testsuite with those options enabled.

Thanks,
Emil