From: xiong <xiong@qca.qualcomm.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <qca-linux-team@qualcomm.com>, <nic-devel@qualcomm.com>,
xiong <xiong@qca.qualcomm.com>
Subject: [PATCH 07/10] atl1c: cancel task when interface closed
Date: Tue, 1 May 2012 09:38:55 +0800 [thread overview]
Message-ID: <1335836338-9425-8-git-send-email-xiong@qca.qualcomm.com> (raw)
In-Reply-To: <1335836338-9425-1-git-send-email-xiong@qca.qualcomm.com>
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>
---
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 d910dbb..b95ef45 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;
--
1.7.7
next prev parent reply other threads:[~2012-05-01 1:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 1:38 [PATCH 00/10] atl1c: update hardware settings - v4 xiong
2012-05-01 1:38 ` [PATCH 01/10] atl1c: add workaround for issue of bit INTX-disable for MSI interrupt xiong
2012-05-01 1:38 ` [PATCH 02/10] atl1c: add PHY link event(up/down) patch xiong
2012-05-01 1:38 ` [PATCH 03/10] atl1c: clear WoL status when reset pcie xiong
2012-05-01 1:38 ` [PATCH 04/10] atl1c: remove code of closing register writable attribution xiong
2012-05-01 1:38 ` [PATCH 05/10] atl1c: refine mac address related code xiong
2012-05-01 1:38 ` [PATCH 06/10] atl1c: enlarge L1 response waiting timer xiong
2012-05-01 1:38 ` xiong [this message]
2012-05-01 1:38 ` [PATCH 08/10] atl1c: do MAC-reset when PHY link down xiong
2012-05-01 1:38 ` [PATCH 09/10] atl1c: Disable L0S when no cable link xiong
2012-05-01 1:38 ` [PATCH 10/10] atl1c: remove PHY polling from atl1c_change_mtu xiong
2012-05-01 1:45 ` [PATCH 00/10] atl1c: update hardware settings - v4 David Miller
-- strict thread matches above, loose matches on Subject: below --
2012-04-28 1:58 xiong
2012-04-28 1:58 ` [PATCH 07/10] atl1c: cancel task when interface closed xiong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335836338-9425-8-git-send-email-xiong@qca.qualcomm.com \
--to=xiong@qca.qualcomm.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic-devel@qualcomm.com \
--cc=qca-linux-team@qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox