aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2014-06-12 00:55:31 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-12 13:28:18 -0400
commitb17b0ca1642c23f0cd4e4cf52cdb9970798f3501 (patch)
treecff93c1ec6ddec06a3c1139a74ea75a031aa0001 /drivers/net/ethernet
parenta2755be5b5340eeb0f00a318d23a302fe95c45ba (diff)
bnx2x: Check for UNDI in uncommon branch
If L2FW utilized by the UNDI driver has the same version number as that of the regular FW, a driver loading after UNDI and receiving an uncommon answer from management will mistakenly assume the loaded FW matches its own requirement and try to exist the flow via FLR. Signed-off-by: Yuval Mintz <yuval.mintz@qlogic.com> Signed-off-by: Ariel Elior <ariel.elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index cf14218697e4..c5061353a475 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10053,6 +10053,24 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
10053#define BCM_5710_UNDI_FW_MF_VERS (0x05) 10053#define BCM_5710_UNDI_FW_MF_VERS (0x05)
10054#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4)) 10054#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4))
10055#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4)) 10055#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4))
10056
10057static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
10058{
10059 /* UNDI marks its presence in DORQ -
10060 * it initializes CID offset for normal bell to 0x7
10061 */
10062 if (!(REG_RD(bp, MISC_REG_RESET_REG_1) &
10063 MISC_REGISTERS_RESET_REG_1_RST_DORQ))
10064 return false;
10065
10066 if (REG_RD(bp, DORQ_REG_NORM_CID_OFST) == 0x7) {
10067 BNX2X_DEV_INFO("UNDI previously loaded\n");
10068 return true;
10069 }
10070
10071 return false;
10072}
10073
10056static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp) 10074static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp)
10057{ 10075{
10058 u8 major, minor, version; 10076 u8 major, minor, version;
@@ -10302,6 +10320,10 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
10302 10320
10303 BNX2X_DEV_INFO("Path is unmarked\n"); 10321 BNX2X_DEV_INFO("Path is unmarked\n");
10304 10322
10323 /* Cannot proceed with FLR if UNDI is loaded, since FW does not match */
10324 if (bnx2x_prev_is_after_undi(bp))
10325 goto out;
10326
10305 /* If function has FLR capabilities, and existing FW version matches 10327 /* If function has FLR capabilities, and existing FW version matches
10306 * the one required, then FLR will be sufficient to clean any residue 10328 * the one required, then FLR will be sufficient to clean any residue
10307 * left by previous driver 10329 * left by previous driver
@@ -10322,6 +10344,7 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
10322 10344
10323 BNX2X_DEV_INFO("Could not FLR\n"); 10345 BNX2X_DEV_INFO("Could not FLR\n");
10324 10346
10347out:
10325 /* Close the MCP request, return failure*/ 10348 /* Close the MCP request, return failure*/
10326 rc = bnx2x_prev_mcp_done(bp); 10349 rc = bnx2x_prev_mcp_done(bp);
10327 if (!rc) 10350 if (!rc)
@@ -10360,19 +10383,13 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
10360 /* close LLH filters towards the BRB */ 10383 /* close LLH filters towards the BRB */
10361 bnx2x_set_rx_filter(&bp->link_params, 0); 10384 bnx2x_set_rx_filter(&bp->link_params, 0);
10362 10385
10363 /* Check if the UNDI driver was previously loaded 10386 /* Check if the UNDI driver was previously loaded */
10364 * UNDI driver initializes CID offset for normal bell to 0x7 10387 if (bnx2x_prev_is_after_undi(bp)) {
10365 */ 10388 prev_undi = true;
10366 if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_DORQ) { 10389 /* clear the UNDI indication */
10367 tmp_reg = REG_RD(bp, DORQ_REG_NORM_CID_OFST); 10390 REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
10368 if (tmp_reg == 0x7) { 10391 /* clear possible idle check errors */
10369 BNX2X_DEV_INFO("UNDI previously loaded\n"); 10392 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
10370 prev_undi = true;
10371 /* clear the UNDI indication */
10372 REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
10373 /* clear possible idle check errors */
10374 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
10375 }
10376 } 10393 }
10377 if (!CHIP_IS_E1x(bp)) 10394 if (!CHIP_IS_E1x(bp))
10378 /* block FW from writing to host */ 10395 /* block FW from writing to host */