mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
net: wangxun: reorder timer and work sync cancellations
When removing the device, timer_delete_sync(&wx->service_timer) is called in .ndo_stop() after cancel_work_sync(&wx->service_task). This may cause new work to be queued after device down. Move unregister_netdev() before cancel_work_sync(), and use timer_shutdown_sync() to prevent the timer from being re-armed. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://patch.msgid.link/20260407025616.33652-7-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b736ebed93
commit
58f6303572
|
|
@ -48,9 +48,10 @@ void wxvf_remove(struct pci_dev *pdev)
|
|||
struct wx *wx = pci_get_drvdata(pdev);
|
||||
struct net_device *netdev;
|
||||
|
||||
cancel_work_sync(&wx->service_task);
|
||||
netdev = wx->netdev;
|
||||
unregister_netdev(netdev);
|
||||
timer_shutdown_sync(&wx->service_timer);
|
||||
cancel_work_sync(&wx->service_task);
|
||||
kfree(wx->vfinfo);
|
||||
kfree(wx->rss_key);
|
||||
kfree(wx->mac_table);
|
||||
|
|
|
|||
|
|
@ -946,12 +946,13 @@ static void txgbe_remove(struct pci_dev *pdev)
|
|||
struct txgbe *txgbe = wx->priv;
|
||||
struct net_device *netdev;
|
||||
|
||||
cancel_work_sync(&wx->service_task);
|
||||
|
||||
netdev = wx->netdev;
|
||||
wx_disable_sriov(wx);
|
||||
unregister_netdev(netdev);
|
||||
|
||||
timer_shutdown_sync(&wx->service_timer);
|
||||
cancel_work_sync(&wx->service_task);
|
||||
|
||||
txgbe_remove_phy(txgbe);
|
||||
wx_free_isb_resources(wx);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user