Commit 28458c80 authored by Michal Schmidt's avatar Michal Schmidt Committed by Jakub Kicinski
Browse files

octeon_ep: cancel tx_timeout_task later in remove sequence



tx_timeout_task is canceled too early when removing the driver. Nothing
prevents .ndo_tx_timeout from triggering and queuing the work again.

Better cancel it after the netdev is unregistered.
It's harmless for octep_tx_timeout_task to run in the window between the
unregistration and cancelation, because it checks netif_running.

Fixes: 862cd659 ("octeon_ep: Add driver framework and device initialization")
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Link: https://lore.kernel.org/r/20230810150114.107765-3-mschmidt@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 519b2279
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1200,12 +1200,12 @@ static void octep_remove(struct pci_dev *pdev)
	if (!oct)
		return;

	cancel_work_sync(&oct->tx_timeout_task);
	cancel_work_sync(&oct->ctrl_mbox_task);
	netdev = oct->netdev;
	if (netdev->reg_state == NETREG_REGISTERED)
		unregister_netdev(netdev);

	cancel_work_sync(&oct->tx_timeout_task);
	oct->poll_non_ioq_intr = false;
	cancel_delayed_work_sync(&oct->intr_poll_task);
	octep_device_cleanup(oct);