netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <sony.chacko@qlogic.com>,
	<shahed.shaikh@qlogic.com>, <Dept_NX_Linux_NIC_Driver@qlogic.com>,
	Manish Chopra <manish.chopra@qlogic.com>
Subject: [PATCH net-next 2/7] qlcnic: Take EPORT out of reset sequence before disabling PAUSE
Date: Wed, 24 Apr 2013 18:42:40 -0400	[thread overview]
Message-ID: <1366843365-2787-3-git-send-email-jitendra.kalsaria@qlogic.com> (raw)
In-Reply-To: <1366843365-2787-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Manish Chopra <manish.chopra@qlogic.com>

o Disabling PAUSE requires access to EPORT registers,
  which may cause a wedge, if EPORT is in reset.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c  |   25 ++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 6ea3a09..ab1d8d9 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -25,6 +25,17 @@
 #define QLC_83XX_OPCODE_TMPL_END		0x0080
 #define QLC_83XX_OPCODE_POLL_READ_LIST		0x0100
 
+/* EPORT control registers */
+#define QLC_83XX_RESET_CONTROL			0x28084E50
+#define QLC_83XX_RESET_REG			0x28084E60
+#define QLC_83XX_RESET_PORT0			0x28084E70
+#define QLC_83XX_RESET_PORT1			0x28084E80
+#define QLC_83XX_RESET_PORT2			0x28084E90
+#define QLC_83XX_RESET_PORT3			0x28084EA0
+#define QLC_83XX_RESET_SRESHIM			0x28084EB0
+#define QLC_83XX_RESET_EPGSHIM			0x28084EC0
+#define QLC_83XX_RESET_ETHERPCS			0x28084ED0
+
 static int qlcnic_83xx_init_default_driver(struct qlcnic_adapter *adapter);
 static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev);
 static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter);
@@ -1374,6 +1385,19 @@ static void qlcnic_83xx_disable_pause_frames(struct qlcnic_adapter *adapter)
 	qlcnic_83xx_unlock_driver(adapter);
 }
 
+static void qlcnic_83xx_take_eport_out_of_reset(struct qlcnic_adapter *adapter)
+{
+	QLCWR32(adapter, QLC_83XX_RESET_REG, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_PORT0, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_PORT1, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_PORT2, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_PORT3, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_SRESHIM, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_EPGSHIM, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_ETHERPCS, 0);
+	QLCWR32(adapter, QLC_83XX_RESET_CONTROL, 1);
+}
+
 static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev)
 {
 	u32 heartbeat, peg_status;
@@ -1395,6 +1419,7 @@ static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev)
 
 	if (ret) {
 		dev_err(&p_dev->pdev->dev, "firmware hang detected\n");
+		qlcnic_83xx_take_eport_out_of_reset(p_dev);
 		qlcnic_83xx_disable_pause_frames(p_dev);
 		peg_status = QLC_SHARED_REG_RD32(p_dev,
 						 QLCNIC_PEG_HALT_STATUS1);
-- 
1.7.6.rc1.1.g2c162b

  parent reply	other threads:[~2013-04-24 23:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 22:42 [PATCH net-next 0/7] qlcnic: Driver updates Jitendra Kalsaria
2013-04-24 22:42 ` [PATCH net-next 1/7] qlcnic: Enhance channel configuration logs Jitendra Kalsaria
2013-04-24 22:42 ` Jitendra Kalsaria [this message]
2013-04-24 22:42 ` [PATCH net-next 3/7] qlcnic: Add eSwitch statistics support Jitendra Kalsaria
2013-04-24 22:42 ` [PATCH net-next 4/7] qlcnic: Enable Interrupt Coalescing for 83xx adapter Jitendra Kalsaria
2013-04-24 22:42 ` [PATCH net-next 5/7] qlcnic: Rename the IRQ description Jitendra Kalsaria
2013-04-25  0:05   ` Ben Hutchings
2013-04-25 23:11     ` Jitendra Kalsaria
2013-04-25 23:21       ` David Miller
2013-04-26  0:35         ` Jitendra Kalsaria
2013-04-24 22:42 ` [PATCH net-next 6/7] qlcnic: Add identifying string for 83xx adapter Jitendra Kalsaria
2013-04-24 22:42 ` [PATCH net-next 7/7] qlcnic: Update version to 5.2.42 Jitendra Kalsaria
2013-04-24 23:36 ` [PATCH net-next 0/7] qlcnic: Driver updates 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=1366843365-2787-3-git-send-email-jitendra.kalsaria@qlogic.com \
    --to=jitendra.kalsaria@qlogic.com \
    --cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=manish.chopra@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=shahed.shaikh@qlogic.com \
    --cc=sony.chacko@qlogic.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;
as well as URLs for NNTP newsgroup(s).