Re: [PATCH net-next v11 5/5] net: dsa: yt921x: Add support for Motorcomm YT921x

From: Jakub Kicinski
Date: Wed Sep 24 2025 - 20:36:13 EST


On Wed, 24 Sep 2025 20:33:57 +0800 Yangfl wrote:
> On Wed, Sep 24, 2025 at 8:47 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> > > + cancel_delayed_work_sync(&pp->mib_read);
> > > + }
> > > +
> > > + dsa_unregister_switch(&priv->ds);
> >
> > The work canceling looks racy, the port can come up in between
> > cancel_work and dsa_unregister ? disable_delayed_work.. will likely
> > do the job.
>
> Are you sure about this? There are many others who use
> cancel_delayed_work_sync in their teardown methods (for example
> ar9331_sw_remove). If that is true, they should be fixed too.

Not at all! I'll gladly accept an explanation of why the code is
correct. "Someone else is doing it too" is not an explanation.