Re: [PATCH net-next 3/3] ionic: cancel delayed work earlier in remove
From: Joe Damato
Date: Thu Jun 12 2025 - 10:07:13 EST
On Mon, Jun 09, 2025 at 02:46:44PM -0700, Shannon Nelson wrote:
> Cancel any entries on the delayed work queue before starting
> to tear down the lif to be sure there is no race with any
> other events.
>
> Signed-off-by: Shannon Nelson <shannon.nelson@xxxxxxx>
> ---
> drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> index 4c377bdc62c8..136bfa3516d0 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> @@ -409,6 +409,7 @@ static void ionic_remove(struct pci_dev *pdev)
> timer_shutdown_sync(&ionic->watchdog_timer);
>
> if (ionic->lif) {
> + cancel_work_sync(&ionic->lif->deferred.work);
> /* prevent adminq cmds if already known as down */
> if (test_and_clear_bit(IONIC_LIF_F_FW_RESET, ionic->lif->state))
> set_bit(IONIC_LIF_F_FW_STOPPING, ionic->lif->state);
Wanted to note that it seems this could be called twice in this path?
Once above and then a second time in ionic_lif_deinit, although
ionic_lif_deinit seems to be called from other paths (like fw down?), so
that's probably OK.
Reviewed-by: Joe Damato <joe@xxxxxxx>