Skip to content

Commit cb28ea3

Browse files
Yaniv Rosnerdavem330
authored andcommitted
bnx2x: Fix KR2 rapid link flap
Check KR2 recovery time at the beginning of the work-around function. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 259c9a1 commit cb28ea3

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13437,13 +13437,7 @@ static void bnx2x_check_kr2_wa(struct link_params *params,
1343713437
{
1343813438
struct bnx2x *bp = params->bp;
1343913439
u16 base_page, next_page, not_kr2_device, lane;
13440-
int sigdet = bnx2x_warpcore_get_sigdet(phy, params);
13441-
13442-
if (!sigdet) {
13443-
if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE))
13444-
bnx2x_kr2_recovery(params, vars, phy);
13445-
return;
13446-
}
13440+
int sigdet;
1344713441

1344813442
/* Once KR2 was disabled, wait 5 seconds before checking KR2 recovery
1344913443
* since some switches tend to reinit the AN process and clear the
@@ -13454,6 +13448,16 @@ static void bnx2x_check_kr2_wa(struct link_params *params,
1345413448
vars->check_kr2_recovery_cnt--;
1345513449
return;
1345613450
}
13451+
13452+
sigdet = bnx2x_warpcore_get_sigdet(phy, params);
13453+
if (!sigdet) {
13454+
if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
13455+
bnx2x_kr2_recovery(params, vars, phy);
13456+
DP(NETIF_MSG_LINK, "No sigdet\n");
13457+
}
13458+
return;
13459+
}
13460+
1345713461
lane = bnx2x_get_warpcore_lane(phy, params);
1345813462
CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
1345913463
MDIO_AER_BLOCK_AER_REG, lane);

0 commit comments

Comments
 (0)