From: Amit Kumar Salecha <amit.salecha@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, dhananjay.phadke@qlogic.com,
ameen.rahman@qlogic.com
Subject: [PATCH NEXT 3/7] qlcnic: clear device reset state after fw recovery
Date: Mon, 1 Feb 2010 06:30:40 -0800 [thread overview]
Message-ID: <1265034644-19461-4-git-send-email-amit.salecha@qlogic.com> (raw)
In-Reply-To: <1265034644-19461-1-git-send-email-amit.salecha@qlogic.com>
o After firmware recovery, clear device reset state transition register.
Otherwise firmware reload can occur unnecessary.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_main.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 05275f2..9a98285 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1866,6 +1866,23 @@ qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state)
qlcnic_api_unlock(adapter);
}
+static int
+qlcnic_clr_drv_state(struct qlcnic_adapter *adapter)
+{
+ u32 val;
+
+ if (qlcnic_api_lock(adapter))
+ return -EBUSY;
+
+ val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE);
+ val &= ~((u32)0x3 << (adapter->portnum * 4));
+ QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val);
+
+ qlcnic_api_unlock(adapter);
+
+ return 0;
+}
+
static void
qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter)
{
@@ -2119,7 +2136,10 @@ qlcnic_attach_work(struct work_struct *work)
done:
adapter->fw_fail_cnt = 0;
clear_bit(__QLCNIC_RESETTING, &adapter->state);
- qlcnic_schedule_work(adapter, qlcnic_fw_poll_work, FW_POLL_DELAY);
+
+ if (!qlcnic_clr_drv_state(adapter))
+ qlcnic_schedule_work(adapter, qlcnic_fw_poll_work,
+ FW_POLL_DELAY);
}
static int
--
1.6.0.2
next prev parent reply other threads:[~2010-02-01 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 14:30 [PATCH NEXT 0/7]qlcnic: add diagnostic tests Amit Kumar Salecha
2010-02-01 14:30 ` [PATCH NEXT 1/7] qlcnic: use DEFINE_PCI_DEVICE_TABLE Amit Kumar Salecha
2010-02-01 14:30 ` [PATCH NEXT 2/7] qlcnic: add ethernet identifier in board info Amit Kumar Salecha
2010-02-01 14:30 ` Amit Kumar Salecha [this message]
2010-02-01 14:30 ` [PATCH NEXT 4/7] qlcnic: protect resoruce cleanup by rtnl lock Amit Kumar Salecha
2010-02-01 14:30 ` [PATCH NEXT 5/7] qlcnic: add LED diagnostic test Amit Kumar Salecha
2010-02-01 14:30 ` [PATCH NEXT 6/7] qlcnic: add interrupt " Amit Kumar Salecha
2010-02-01 14:30 ` [PATCH NEXT 7/7] qlcnic: add loppback " Amit Kumar Salecha
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=1265034644-19461-4-git-send-email-amit.salecha@qlogic.com \
--to=amit.salecha@qlogic.com \
--cc=ameen.rahman@qlogic.com \
--cc=davem@davemloft.net \
--cc=dhananjay.phadke@qlogic.com \
--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