Skip to content

Commit 673c96e

Browse files
be2netdavem330
authored andcommitted
be2net: Fix UE detection logic for BE3
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2baec2c commit 673c96e

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

drivers/net/ethernet/emulex/benet/be_hw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
#define POST_STAGE_BE_RESET 0x3 /* Host wants to reset chip */
5050
#define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
5151
#define POST_STAGE_RECOVERABLE_ERR 0xE000 /* Recoverable err detected */
52+
/* FW has detected a UE and is dumping FAT log data */
53+
#define POST_STAGE_FAT_LOG_START 0x0D00
54+
#define POST_STAGE_ARMFW_UE 0xF000 /*FW has asserted an UE*/
5255

5356
/* Lancer SLIPORT registers */
5457
#define SLIPORT_STATUS_OFFSET 0x404

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,8 +3241,9 @@ void be_detect_error(struct be_adapter *adapter)
32413241
{
32423242
u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0;
32433243
u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
3244-
u32 i;
32453244
struct device *dev = &adapter->pdev->dev;
3245+
u16 val;
3246+
u32 i;
32463247

32473248
if (be_check_error(adapter, BE_ERROR_HW))
32483249
return;
@@ -3280,15 +3281,25 @@ void be_detect_error(struct be_adapter *adapter)
32803281
ue_lo = (ue_lo & ~ue_lo_mask);
32813282
ue_hi = (ue_hi & ~ue_hi_mask);
32823283

3283-
/* On certain platforms BE hardware can indicate spurious UEs.
3284-
* Allow HW to stop working completely in case of a real UE.
3285-
* Hence not setting the hw_error for UE detection.
3286-
*/
3287-
32883284
if (ue_lo || ue_hi) {
3285+
/* On certain platforms BE3 hardware can indicate
3286+
* spurious UEs. In case of a UE in the chip,
3287+
* the POST register correctly reports either a
3288+
* FAT_LOG_START state (FW is currently dumping
3289+
* FAT log data) or a ARMFW_UE state. Check for the
3290+
* above states to ascertain if the UE is valid or not.
3291+
*/
3292+
if (BE3_chip(adapter)) {
3293+
val = be_POST_stage_get(adapter);
3294+
if ((val & POST_STAGE_FAT_LOG_START)
3295+
!= POST_STAGE_FAT_LOG_START &&
3296+
(val & POST_STAGE_ARMFW_UE)
3297+
!= POST_STAGE_ARMFW_UE)
3298+
return;
3299+
}
3300+
32893301
dev_err(dev, "Error detected in the adapter");
3290-
if (skyhawk_chip(adapter))
3291-
be_set_error(adapter, BE_ERROR_UE);
3302+
be_set_error(adapter, BE_ERROR_UE);
32923303

32933304
for (i = 0; ue_lo; ue_lo >>= 1, i++) {
32943305
if (ue_lo & 1)

0 commit comments

Comments
 (0)