From: <jie.yang@atheros.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: atl1c: Do not call cancel_work_sync from the work itself
Date: Mon, 3 Aug 2009 13:32:19 +0800 [thread overview]
Message-ID: <12492775393830-git-send-email-jie.yang@atheros.com> (raw)
Signed-off-by: jie yang <jie.yang>@atheros.com
---
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
index 2a1120a..53242dc 100644
--- a/drivers/net/atl1c/atl1c.h
+++ b/drivers/net/atl1c/atl1c.h
@@ -427,6 +427,7 @@ struct atl1c_hw {
#define ATL1C_ASPM_CTRL_MON 0x0200
#define ATL1C_HIB_DISABLE 0x0400
#define ATL1C_LINK_CAP_1000M 0x0800
+#define ATL1C_RESET_IN_WORK 0x1000
#define ATL1C_FPGA_VERSION 0x8000
u16 cmb_tpd;
u16 cmb_rrd;
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 1d601ce..dec88fa 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -321,7 +321,10 @@ static void atl1c_del_timer(struct atl1c_adapter *adapter)
static void atl1c_cancel_work(struct atl1c_adapter *adapter)
{
- cancel_work_sync(&adapter->reset_task);
+ if (adapter->hw.ctrl_flags & ATL1C_RESET_IN_WORK)
+ adapter->hw.ctrl_flags &= ~ATL1C_RESET_IN_WORK;/* clear the flag */
+ else
+ cancel_work_sync(&adapter->reset_task);
cancel_work_sync(&adapter->link_chg_task);
}
@@ -1544,6 +1547,7 @@ static irqreturn_t atl1c_intr(int irq, void *data)
/* reset MAC */
hw->intr_mask &= ~ISR_ERROR;
AT_WRITE_REG(hw, REG_IMR, hw->intr_mask);
+ adapter->hw.ctrl_flags |= ATL1C_RESET_IN_WORK;
schedule_work(&adapter->reset_task);
break;
}
next reply other threads:[~2009-08-03 5:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 5:32 jie.yang [this message]
2009-08-03 20:20 ` atl1c: Do not call cancel_work_sync from the work itself David Miller
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=12492775393830-git-send-email-jie.yang@atheros.com \
--to=jie.yang@atheros.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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