From: Suresh Reddy <suresh.reddy@broadcom.com>
To: netdev@vger.kernel.org
Cc: Suresh Reddy <suresh.reddy@broadcom.com>
Subject: [PATCH net-next 1/2] be2net: Fix UE detection logic for BE3
Date: Wed, 24 May 2017 22:24:38 -0400 [thread overview]
Message-ID: <1495679079-12025-2-git-send-email-suresh.reddy@broadcom.com> (raw)
In-Reply-To: <1495679079-12025-1-git-send-email-suresh.reddy@broadcom.com>
On certain platforms BE3 chips may indicate spurious UEs (unrecoverable
error). Because of the UE detection logic was disabled in the driver
for BE3 chips. Because of this, even in cases of a real UE,
a failover will not occur. This patch re-enables UE detection on BE3
and if a UE is detected, reads the POST register. If the POST register,
reports either a FAT_LOG_STATE or a ARMFW_UE, then it means that a valid
UE occurred in the chip.
Signed-off-by: Suresh Reddy <suresh.reddy@broadcom.com>
---
drivers/net/ethernet/emulex/benet/be_hw.h | 3 +++
drivers/net/ethernet/emulex/benet/be_main.c | 27 +++++++++++++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h
index 36e4232..c967f45 100644
--- a/drivers/net/ethernet/emulex/benet/be_hw.h
+++ b/drivers/net/ethernet/emulex/benet/be_hw.h
@@ -49,6 +49,9 @@
#define POST_STAGE_BE_RESET 0x3 /* Host wants to reset chip */
#define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
#define POST_STAGE_RECOVERABLE_ERR 0xE000 /* Recoverable err detected */
+/* FW has detected a UE and is dumping FAT log data */
+#define POST_STAGE_FAT_LOG_START 0x0D00
+#define POST_STAGE_ARMFW_UE 0xF000 /*FW has asserted an UE*/
/* Lancer SLIPORT registers */
#define SLIPORT_STATUS_OFFSET 0x404
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f3a09ab..8000551 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3241,8 +3241,9 @@ void be_detect_error(struct be_adapter *adapter)
{
u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0;
u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
- u32 i;
struct device *dev = &adapter->pdev->dev;
+ u16 val;
+ u32 i;
if (be_check_error(adapter, BE_ERROR_HW))
return;
@@ -3280,15 +3281,25 @@ void be_detect_error(struct be_adapter *adapter)
ue_lo = (ue_lo & ~ue_lo_mask);
ue_hi = (ue_hi & ~ue_hi_mask);
- /* On certain platforms BE hardware can indicate spurious UEs.
- * Allow HW to stop working completely in case of a real UE.
- * Hence not setting the hw_error for UE detection.
- */
-
if (ue_lo || ue_hi) {
+ /* On certain platforms BE3 hardware can indicate
+ * spurious UEs. In case of a UE in the chip,
+ * the POST register correctly reports either a
+ * FAT_LOG_START state (FW is currently dumping
+ * FAT log data) or a ARMFW_UE state. Check for the
+ * above states to ascertain if the UE is valid or not.
+ */
+ if (BE3_chip(adapter)) {
+ val = be_POST_stage_get(adapter);
+ if ((val & POST_STAGE_FAT_LOG_START)
+ != POST_STAGE_FAT_LOG_START &&
+ (val & POST_STAGE_ARMFW_UE)
+ != POST_STAGE_ARMFW_UE)
+ return;
+ }
+
dev_err(dev, "Error detected in the adapter");
- if (skyhawk_chip(adapter))
- be_set_error(adapter, BE_ERROR_UE);
+ be_set_error(adapter, BE_ERROR_UE);
for (i = 0; ue_lo; ue_lo >>= 1, i++) {
if (ue_lo & 1)
--
1.8.3.1
next prev parent reply other threads:[~2017-05-25 2:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Suresh.Reddy@broadcom.com>
2017-05-25 2:24 ` [PATCH net-next 0/2] be2net: patch-set Suresh Reddy
2017-05-25 2:24 ` Suresh Reddy [this message]
2017-05-25 2:24 ` [PATCH net-next 2/2] be2net: Update the driver version to 11.4.0.0 Suresh Reddy
2017-05-25 18:45 ` [PATCH net-next 0/2] be2net: patch-set David Miller
2017-09-13 15:12 ` [PATCH net] be2net: fix TSO6/GSO issue causing TX-stall on Lancer/BEx Suresh Reddy
2017-09-13 16:33 ` David Miller
2018-02-06 13:52 ` [PATCH net 0/2] be2net: patch-set Suresh Reddy
2018-02-06 13:52 ` [PATCH net 1/2] be2net: Fix HW stall issue in Lancer Suresh Reddy
2018-02-06 13:52 ` [PATCH net 2/2] be2net: Handle transmit completion errors " Suresh Reddy
2018-02-06 16:48 ` [PATCH net 0/2] be2net: patch-set David Miller
2018-05-28 5:26 ` [PATCH net] be2net: Fix error detection logic for BE3 Suresh Reddy
2018-05-29 14:58 ` David Miller
2018-07-23 14:25 ` [PATCH net-next 0/2] be2net: patch-set Suresh Reddy
2018-07-23 14:25 ` [PATCH net-next 1/2] be2net: Collect the transmit queue data in Tx timeout Suresh Reddy
2018-07-23 18:23 ` David Miller
2018-07-25 12:44 ` Suresh Kumar Reddy Reddygari
2018-07-30 10:53 ` Suresh Kumar Reddy Reddygari
2018-07-30 16:17 ` David Miller
2018-07-23 14:25 ` [PATCH net-next 2/2] be2net: Update the driver version to 12.0.0.0 Suresh Reddy
2018-07-31 15:39 ` [PATCH V2 net-next 0/2] be2net: patch-set Suresh Reddy
2018-07-31 15:39 ` [PATCH V2 net-next 1/2] be2net: gather debug info and reset adapter (only for Lancer) on a tx-timeout Suresh Reddy
2018-07-31 15:39 ` [PATCH V2 net-next 2/2] be2net: Update the driver version to 12.0.0.0 Suresh Reddy
2018-08-01 16:39 ` [PATCH V2 net-next 0/2] be2net: patch-set 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=1495679079-12025-2-git-send-email-suresh.reddy@broadcom.com \
--to=suresh.reddy@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.