aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-12 10:45:14 -0500
committerTejun Heo <tj@kernel.org>2010-12-12 10:45:14 -0500
commit9beb4896cec71e40738a7752072174fbf0d5b7b4 (patch)
treeda8c97bcdac4ce10ade54bc80175b9203248e398
parentf5c35cc191afd08d660e6db0fecc9f431dc8f273 (diff)
iseries_veth: don't use flush_scheduled_work()
flush_scheduled_work() is on its way out. Remove its usage from iseries_veth. * Cancelling a delayed work, queueing it for immediate execution if cancelled and then waiting for completion can be done by simply calling flush_delayed_work_sync(). * Explicitly cancel cnx->statemachine_wq on module unload. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Santiago Leon <santil@linux.vnet.ibm.com> Cc: netdev@vger.kernel.org
-rw-r--r--drivers/net/iseries_veth.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 63ac531f5996..9ece1fd9889d 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -885,17 +885,8 @@ static void veth_stop_connection(struct veth_lpar_connection *cnx)
885 veth_kick_statemachine(cnx); 885 veth_kick_statemachine(cnx);
886 spin_unlock_irq(&cnx->lock); 886 spin_unlock_irq(&cnx->lock);
887 887
888 /* There's a slim chance the reset code has just queued the 888 /* ensure the statemachine runs now and waits for its completion */
889 * statemachine to run in five seconds. If so we need to cancel 889 flush_delayed_work_sync(&cnx->statemachine_wq);
890 * that and requeue the work to run now. */
891 if (cancel_delayed_work(&cnx->statemachine_wq)) {
892 spin_lock_irq(&cnx->lock);
893 veth_kick_statemachine(cnx);
894 spin_unlock_irq(&cnx->lock);
895 }
896
897 /* Wait for the state machine to run. */
898 flush_scheduled_work();
899} 890}
900 891
901static void veth_destroy_connection(struct veth_lpar_connection *cnx) 892static void veth_destroy_connection(struct veth_lpar_connection *cnx)
@@ -1653,15 +1644,14 @@ static void __exit veth_module_cleanup(void)
1653 /* Disconnect our "irq" to stop events coming from the Hypervisor. */ 1644 /* Disconnect our "irq" to stop events coming from the Hypervisor. */
1654 HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); 1645 HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan);
1655 1646
1656 /* Make sure any work queued from Hypervisor callbacks is finished. */
1657 flush_scheduled_work();
1658
1659 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) { 1647 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) {
1660 cnx = veth_cnx[i]; 1648 cnx = veth_cnx[i];
1661 1649
1662 if (!cnx) 1650 if (!cnx)
1663 continue; 1651 continue;
1664 1652
1653 /* Cancel work queued from Hypervisor callbacks */
1654 cancel_delayed_work_sync(&cnx->statemachine_wq);
1665 /* Remove the connection from sysfs */ 1655 /* Remove the connection from sysfs */
1666 kobject_del(&cnx->kobject); 1656 kobject_del(&cnx->kobject);
1667 /* Drop the driver's reference to the connection */ 1657 /* Drop the driver's reference to the connection */