> -----Original Message-----
> From: Jakub Kicinski <[email protected]>
> Sent: Friday, October 17, 2025 7:06 PM
> To: Haiyang Zhang <[email protected]>
> Cc: [email protected]; [email protected]; Haiyang Zhang
> <[email protected]>; Paul Rosswurm <[email protected]>; Dexuan
> Cui <[email protected]>; KY Srinivasan <[email protected]>;
> [email protected]; [email protected]; [email protected];
> [email protected]; Long Li <[email protected]>;
> [email protected]; [email protected];
> [email protected]; Konstantin Taranov
> <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; Shiraz Saleem <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: [EXTERNAL] Re: [PATCH net-next,v2] net: mana: Support HW link
> state events
>
> On Tue, 14 Oct 2025 14:26:49 -0700 Haiyang Zhang wrote:
> > From: Haiyang Zhang <[email protected]>
> >
> > Handle the HW link state events received from HW channel, and
> > set the proper link state, also stop/wake queues accordingly.
>
> Why do you have to stop / start the queues? I think it's unusual.
> Let the packets get dropped, sending out potentially old packets
> when link comes back is not going to make anyone happier.
Will do.
>
> > +static void mana_link_state_handle(struct work_struct *w)
> > +{
> > + struct mana_port_context *apc;
> > + struct mana_context *ac;
> > + struct net_device *ndev;
> > + bool link_up;
> > + int i;
> > +
> > + ac = container_of(w, struct mana_context, link_change_work);
> > +
> > + if (ac->mana_removing)
> > + return;
> > +
> > + rtnl_lock();
> > +
>
> > @@ -3500,6 +3556,10 @@ void mana_remove(struct gdma_dev *gd, bool
> suspending)
> > int err;
> > int i;
> >
> > + ac->mana_removing = true;
> > +
> > + cancel_work_sync(&ac->link_change_work);
>
> Looks racy, the work needs @ac to check the ->mana_removing but
> mana_remove() frees @ac. Just use disable_work_sync() please.
Good idea. Will update the patch.
Thanks,
- Haiyang