diff options
author | Huang, Xiong <xiong@qca.qualcomm.com> | 2012-04-30 17:38:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-01 03:44:15 +0200 |
commit | 0aa76ce3324e324d3091aef0c3e22c249ae4b693 (patch) | |
tree | 8fcc405af661cf33943f1dc3e10489d56a760c36 /drivers/net/ethernet/atheros/atl1c | |
parent | atl1c: enlarge L1 response waiting timer (diff) | |
download | linux-0aa76ce3324e324d3091aef0c3e22c249ae4b693.tar.xz linux-0aa76ce3324e324d3091aef0c3e22c249ae4b693.zip |
atl1c: cancel task when interface closed
common_task might be running while close routine is called,
wait/cancel it.
Signed-off-by: xiong <xiong@qca.qualcomm.com>
Tested-by: Liu David <dwliu@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/atl1c')
-rw-r--r-- | drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index d910dbb8a296..b95ef4505115 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c @@ -330,6 +330,9 @@ static void atl1c_common_task(struct work_struct *work) adapter = container_of(work, struct atl1c_adapter, common_task); netdev = adapter->netdev; + if (test_bit(__AT_DOWN, &adapter->flags)) + return; + if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) { netif_device_detach(netdev); atl1c_down(adapter); @@ -2311,6 +2314,8 @@ static int atl1c_close(struct net_device *netdev) struct atl1c_adapter *adapter = netdev_priv(netdev); WARN_ON(test_bit(__AT_RESETTING, &adapter->flags)); + set_bit(__AT_DOWN, &adapter->flags); + cancel_work_sync(&adapter->common_task); atl1c_down(adapter); atl1c_free_ring_resources(adapter); return 0; |