All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnx2x: Link fixes
@ 2013-03-07 23:27 Yaniv Rosner
  2013-03-07 23:27 ` [PATCH net 1/2] bnx2x: Fix intermittent long KR2 link up time Yaniv Rosner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yaniv Rosner @ 2013-03-07 23:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner

Hi Dave,
The following patch series has two small link fixes.
Please consider applying it to net.

Thanks,
Yaniv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] bnx2x: Fix intermittent long KR2 link up time
  2013-03-07 23:27 [PATCH net 0/2] bnx2x: Link fixes Yaniv Rosner
@ 2013-03-07 23:27 ` Yaniv Rosner
  2013-03-07 23:27 ` [PATCH net 2/2] bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario Yaniv Rosner
  2013-03-08  5:36 ` [PATCH net 0/2] bnx2x: Link fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yaniv Rosner @ 2013-03-07 23:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Eilon Greenstein

When a KR2 device is connected to a KR link-partner, sometimes it requires
disabling KR2 for the link to come up. To get a KR2 link up later, in case no
base pages are seen, the KR2 is restored. The problem was that some link
partners cleared their advertised BP/NP after around two seconds, causing the
driver to disable/enable KR2 link all the time.
The fix was to wait at least 5 seconds before checking KR2 recovery.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |   11 +++++++++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h |    3 ++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 31c5787..032d48e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -12527,6 +12527,7 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars)
 	vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;
 	vars->mac_type = MAC_TYPE_NONE;
 	vars->phy_flags = 0;
+	vars->check_kr2_recovery_cnt = 0;
 	/* Driver opens NIG-BRB filters */
 	bnx2x_set_rx_filter(params, 1);
 	/* Check if link flap can be avoided */
@@ -13411,6 +13412,7 @@ static void bnx2x_disable_kr2(struct link_params *params,
 	vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
 	bnx2x_update_link_attr(params, vars->link_attr_sync);
 
+	vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT;
 	/* Restart AN on leading lane */
 	bnx2x_warpcore_restart_AN_KR(phy, params);
 }
@@ -13439,6 +13441,15 @@ static void bnx2x_check_kr2_wa(struct link_params *params,
 		return;
 	}
 
+	/* Once KR2 was disabled, wait 5 seconds before checking KR2 recovery
+	 * since some switches tend to reinit the AN process and clear the
+	 * advertised BP/NP after ~2 seconds causing the KR2 to be disabled
+	 * and recovered many times
+	 */
+	if (vars->check_kr2_recovery_cnt > 0) {
+		vars->check_kr2_recovery_cnt--;
+		return;
+	}
 	lane = bnx2x_get_warpcore_lane(phy, params);
 	CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
 			  MDIO_AER_BLOCK_AER_REG, lane);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index be5c195..f92fcf7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -342,7 +342,8 @@ struct link_vars {
 	u32 link_status;
 	u32 eee_status;
 	u8 fault_detected;
-	u8 rsrv1;
+	u8 check_kr2_recovery_cnt;
+#define CHECK_KR2_RECOVERY_CNT	5
 	u16 periodic_flags;
 #define PERIODIC_FLAGS_LINK_EVENT	0x0001
 
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario
  2013-03-07 23:27 [PATCH net 0/2] bnx2x: Link fixes Yaniv Rosner
  2013-03-07 23:27 ` [PATCH net 1/2] bnx2x: Fix intermittent long KR2 link up time Yaniv Rosner
@ 2013-03-07 23:27 ` Yaniv Rosner
  2013-03-08  5:36 ` [PATCH net 0/2] bnx2x: Link fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yaniv Rosner @ 2013-03-07 23:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Eilon Greenstein

Fix a problem in which iSCSI-boot installation fails when switching SFP+ boot
port and moving the SFP+ module prior to boot. The SFP+ insertion triggers an
interrupt which configures the SFP+ module wrongly before interface is loaded.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |    6 +++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 032d48e..3985533 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -8647,7 +8647,9 @@ void bnx2x_handle_module_detect_int(struct link_params *params)
 						MDIO_WC_DEVAD,
 						MDIO_WC_REG_DIGITAL5_MISC6,
 						&rx_tx_in_reset);
-				if (!rx_tx_in_reset) {
+				if ((!rx_tx_in_reset) &&
+				    (params->link_flags &
+				     PHY_INITIALIZED)) {
 					bnx2x_warpcore_reset_lane(bp, phy, 1);
 					bnx2x_warpcore_config_sfi(phy, params);
 					bnx2x_warpcore_reset_lane(bp, phy, 0);
@@ -12528,6 +12530,7 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars)
 	vars->mac_type = MAC_TYPE_NONE;
 	vars->phy_flags = 0;
 	vars->check_kr2_recovery_cnt = 0;
+	params->link_flags = PHY_INITIALIZED;
 	/* Driver opens NIG-BRB filters */
 	bnx2x_set_rx_filter(params, 1);
 	/* Check if link flap can be avoided */
@@ -12692,6 +12695,7 @@ int bnx2x_lfa_reset(struct link_params *params,
 	struct bnx2x *bp = params->bp;
 	vars->link_up = 0;
 	vars->phy_flags = 0;
+	params->link_flags &= ~PHY_INITIALIZED;
 	if (!params->lfa_base)
 		return bnx2x_link_reset(params, vars, 1);
 	/*
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index f92fcf7..56c2aae 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -309,6 +309,7 @@ struct link_params {
 				req_flow_ctrl is set to AUTO */
 	u16 link_flags;
 #define LINK_FLAGS_INT_DISABLED		(1<<0)
+#define PHY_INITIALIZED		(1<<1)
 	u32 lfa_base;
 };
 
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] bnx2x: Link fixes
  2013-03-07 23:27 [PATCH net 0/2] bnx2x: Link fixes Yaniv Rosner
  2013-03-07 23:27 ` [PATCH net 1/2] bnx2x: Fix intermittent long KR2 link up time Yaniv Rosner
  2013-03-07 23:27 ` [PATCH net 2/2] bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario Yaniv Rosner
@ 2013-03-08  5:36 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-03-08  5:36 UTC (permalink / raw)
  To: yanivr; +Cc: netdev

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Fri, 8 Mar 2013 01:27:32 +0200

> The following patch series has two small link fixes.
> Please consider applying it to net.

All applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-08  5:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 23:27 [PATCH net 0/2] bnx2x: Link fixes Yaniv Rosner
2013-03-07 23:27 ` [PATCH net 1/2] bnx2x: Fix intermittent long KR2 link up time Yaniv Rosner
2013-03-07 23:27 ` [PATCH net 2/2] bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario Yaniv Rosner
2013-03-08  5:36 ` [PATCH net 0/2] bnx2x: Link fixes David Miller

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.