Commit 6954a9e4 authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller
Browse files

ibmvnic: Flush existing work items before device removal



Ensure that all scheduled work items have completed before continuing
with device removal and after further event scheduling has been
halted. This patch fixes a bug where a scheduled driver reset event
is processed following device removal.

Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b65ce380
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5184,6 +5184,9 @@ static int ibmvnic_remove(struct vio_dev *dev)
	adapter->state = VNIC_REMOVING;
	spin_unlock_irqrestore(&adapter->state_lock, flags);

	flush_work(&adapter->ibmvnic_reset);
	flush_delayed_work(&adapter->ibmvnic_delayed_reset);

	rtnl_lock();
	unregister_netdevice(netdev);