Commit 9b341bb1 authored by Barak Witkowski's avatar Barak Witkowski Committed by David S. Miller

bnx2x: IGU parse error cause probe failure

If IGU parse error is encountered during the probing process, the error
propagates and the probe gracefully fails (until now, such errors were ignored,
later causing mischief).
Signed-off-by: default avatarBarak Witkowski <barak@broadcom.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 382e513a
...@@ -9974,7 +9974,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) ...@@ -9974,7 +9974,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp)
#define IGU_FID(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID) #define IGU_FID(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)
#define IGU_VEC(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR) #define IGU_VEC(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)
static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) static int __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp)
{ {
int pfid = BP_FUNC(bp); int pfid = BP_FUNC(bp);
int igu_sb_id; int igu_sb_id;
...@@ -9991,7 +9991,7 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) ...@@ -9991,7 +9991,7 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp)
bp->igu_dsb_id = E1HVN_MAX * FP_SB_MAX_E1x + bp->igu_dsb_id = E1HVN_MAX * FP_SB_MAX_E1x +
(CHIP_MODE_IS_4_PORT(bp) ? pfid : vn); (CHIP_MODE_IS_4_PORT(bp) ? pfid : vn);
return; return 0;
} }
/* IGU in normal mode - read CAM */ /* IGU in normal mode - read CAM */
...@@ -10025,8 +10025,12 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) ...@@ -10025,8 +10025,12 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp)
bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt); bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt);
#endif #endif
if (igu_sb_cnt == 0) if (igu_sb_cnt == 0) {
BNX2X_ERR("CAM configuration error\n"); BNX2X_ERR("CAM configuration error\n");
return -EINVAL;
}
return 0;
} }
static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp,
...@@ -10706,6 +10710,8 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) ...@@ -10706,6 +10710,8 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
if (REG_RD(bp, IGU_REG_RESET_MEMORIES)) { if (REG_RD(bp, IGU_REG_RESET_MEMORIES)) {
dev_err(&bp->pdev->dev, dev_err(&bp->pdev->dev,
"FORCING Normal Mode failed!!!\n"); "FORCING Normal Mode failed!!!\n");
bnx2x_release_hw_lock(bp,
HW_LOCK_RESOURCE_RESET);
return -EPERM; return -EPERM;
} }
} }
...@@ -10716,9 +10722,10 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) ...@@ -10716,9 +10722,10 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
} else } else
BNX2X_DEV_INFO("IGU Normal Mode\n"); BNX2X_DEV_INFO("IGU Normal Mode\n");
bnx2x_get_igu_cam_info(bp); rc = bnx2x_get_igu_cam_info(bp);
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET); bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET);
if (rc)
return rc;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment