Re: [PATCH net-next v11 5/5] net: dsa: yt921x: Add support for Motorcomm YT921x
From: Yangfl
Date: Wed Sep 24 2025 - 08:34:46 EST
On Wed, Sep 24, 2025 at 8:47 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
...
>
> > +static void yt921x_mdio_remove(struct mdio_device *mdiodev)
> > +{
>
> > + 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.