netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5] bnx2x: Link fixes
@ 2014-01-01  9:06 Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link Yaniv Rosner
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner

Hi Dave,
The following patch series contain few link fixes.
Please consider applying it to net.

Thanks,
Yaniv

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

* [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
@ 2014-01-01  9:06 ` Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 2/5] bnx2x: Fix passive DAC cable detection Yaniv Rosner
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Ariel Elior

Fix a problem where 578xx-KR is unable to get link when connected to 1G link
partner. Two fixes were required:
One was to force CL37 sync_status low to prevent Warpcore from getting stuck in
CL73 parallel detect loop while link partner is sending.
Second fix was to enable auto-detect mode, thus allowing the Warpcore to select
the higher speed protocol between 10G-KR (over CL73), or go down to 1G over CL73
when there's indication for it.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |   13 +++++++++++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h  |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 20dcc02..efbf729 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3865,6 +3865,19 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
 
 		bnx2x_warpcore_enable_AN_KR2(phy, params, vars);
 	} else {
+		/* Enable Auto-Detect to support 1G over CL37 as well */
+		bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
+				 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10);
+
+		/* Force cl48 sync_status LOW to avoid getting stuck in CL73
+		 * parallel-detect loop when CL73 and CL37 are enabled.
+		 */
+		CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
+				  MDIO_AER_BLOCK_AER_REG, 0);
+		bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
+				 MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800);
+		bnx2x_set_aer_mmd(params, phy);
+
 		bnx2x_disable_kr2(params, vars, phy);
 	}
 
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index 3efbb35..14ffb6e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -7179,6 +7179,7 @@ Theotherbitsarereservedandshouldbezero*/
 #define MDIO_WC_REG_RX1_PCI_CTRL			0x80ca
 #define MDIO_WC_REG_RX2_PCI_CTRL			0x80da
 #define MDIO_WC_REG_RX3_PCI_CTRL			0x80ea
+#define MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI		0x80fa
 #define MDIO_WC_REG_XGXSBLK2_UNICORE_MODE_10G		0x8104
 #define MDIO_WC_REG_XGXS_STATUS3			0x8129
 #define MDIO_WC_REG_PAR_DET_10G_STATUS			0x8130
-- 
1.7.1

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

* [PATCH net 2/5] bnx2x: Fix passive DAC cable detection
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link Yaniv Rosner
@ 2014-01-01  9:06 ` Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 3/5] bnx2x: Fix Duplex setting for 54618se Yaniv Rosner
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Ariel Elior

Fix Passive DAC detection for specific cables, such that even in case
SFP_CABLE_TECHNOLOGY option is not set in the EEPROM (offset 8), treat it as a
passive DAC cable, since some cables don't have this indication.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index efbf729..000b6ee 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -8133,17 +8133,20 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy,
 				*edc_mode = EDC_MODE_ACTIVE_DAC;
 			else
 				check_limiting_mode = 1;
-		} else if (copper_module_type &
-			SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
+		} else {
+			*edc_mode = EDC_MODE_PASSIVE_DAC;
+			/* Even in case PASSIVE_DAC indication is not set,
+			 * treat it as a passive DAC cable, since some cables
+			 * don't have this indication.
+			 */
+			if (copper_module_type &
+			    SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
 				DP(NETIF_MSG_LINK,
 				   "Passive Copper cable detected\n");
-				*edc_mode =
-				      EDC_MODE_PASSIVE_DAC;
-		} else {
-			DP(NETIF_MSG_LINK,
-			   "Unknown copper-cable-type 0x%x !!!\n",
-			   copper_module_type);
-			return -EINVAL;
+			} else {
+				DP(NETIF_MSG_LINK,
+				   "Unknown copper-cable-type\n");
+			}
 		}
 		break;
 	}
-- 
1.7.1

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

* [PATCH net 3/5] bnx2x: Fix Duplex setting for 54618se
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 2/5] bnx2x: Fix passive DAC cable detection Yaniv Rosner
@ 2014-01-01  9:06 ` Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 4/5] bnx2x: Fix incorrect link-up report Yaniv Rosner
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Ariel Elior

BCM54618SE is used to advertise half-duplex even if HD was not requested by the
user. This change makes the legacy speed/duplex advertisement for this PHY
exactly according to the requested speed and duplex.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |   54 +++++++++++----------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 000b6ee..68417e1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -10841,9 +10841,9 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
 			   (1<<11));
 
 	if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
-			(phy->speed_cap_mask &
-			PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) ||
-			(phy->req_line_speed == SPEED_1000)) {
+	     (phy->speed_cap_mask &
+	      PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) ||
+	    (phy->req_line_speed == SPEED_1000)) {
 		an_1000_val |= (1<<8);
 		autoneg_val |= (1<<9 | 1<<12);
 		if (phy->req_duplex == DUPLEX_FULL)
@@ -10859,30 +10859,32 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
 			0x09,
 			&an_1000_val);
 
-	/* Set 100 speed advertisement */
-	if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
-			(phy->speed_cap_mask &
-			(PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL |
-			PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)))) {
-		an_10_100_val |= (1<<7);
-		/* Enable autoneg and restart autoneg for legacy speeds */
-		autoneg_val |= (1<<9 | 1<<12);
-
-		if (phy->req_duplex == DUPLEX_FULL)
-			an_10_100_val |= (1<<8);
-		DP(NETIF_MSG_LINK, "Advertising 100M\n");
-	}
-
-	/* Set 10 speed advertisement */
-	if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
-			(phy->speed_cap_mask &
-			(PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL |
-			PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)))) {
-		an_10_100_val |= (1<<5);
-		autoneg_val |= (1<<9 | 1<<12);
-		if (phy->req_duplex == DUPLEX_FULL)
+	/* Advertise 10/100 link speed */
+	if (phy->req_line_speed == SPEED_AUTO_NEG) {
+		if (phy->speed_cap_mask &
+		    PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) {
+			an_10_100_val |= (1<<5);
+			autoneg_val |= (1<<9 | 1<<12);
+			DP(NETIF_MSG_LINK, "Advertising 10M-HD\n");
+		}
+		if (phy->speed_cap_mask &
+		    PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) {
 			an_10_100_val |= (1<<6);
-		DP(NETIF_MSG_LINK, "Advertising 10M\n");
+			autoneg_val |= (1<<9 | 1<<12);
+			DP(NETIF_MSG_LINK, "Advertising 10M-FD\n");
+		}
+		if (phy->speed_cap_mask &
+		    PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) {
+			an_10_100_val |= (1<<7);
+			autoneg_val |= (1<<9 | 1<<12);
+			DP(NETIF_MSG_LINK, "Advertising 100M-HD\n");
+		}
+		if (phy->speed_cap_mask &
+		    PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) {
+			an_10_100_val |= (1<<8);
+			autoneg_val |= (1<<9 | 1<<12);
+			DP(NETIF_MSG_LINK, "Advertising 100M-FD\n");
+		}
 	}
 
 	/* Only 10/100 are allowed to work in FORCE mode */
-- 
1.7.1

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

* [PATCH net 4/5] bnx2x: Fix incorrect link-up report
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
                   ` (2 preceding siblings ...)
  2014-01-01  9:06 ` [PATCH net 3/5] bnx2x: Fix Duplex setting for 54618se Yaniv Rosner
@ 2014-01-01  9:06 ` Yaniv Rosner
  2014-01-01  9:06 ` [PATCH net 5/5] bnx2x: Fix KR2 work-around detection of BCM8073 Yaniv Rosner
  2014-01-02  3:10 ` [PATCH net 0/5] bnx2x: Link fixes David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Ariel Elior

Fix a problem where link is reported to be up when SFP+ module is plugged in
without cable. This occurs with specific module types which may generate
temporary TX_FAULT indication. Solution is to avoid changing any link parameters
when checking TX_FAULT indication while physical link is down.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 68417e1..998cce3 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -13360,6 +13360,10 @@ static u8 bnx2x_analyze_link_error(struct link_params *params,
 	DP(NETIF_MSG_LINK, "Link changed:[%x %x]->%x\n", vars->link_up,
 	   old_status, status);
 
+	/* Do not touch the link in case physical link down */
+	if ((vars->phy_flags & PHY_PHYSICAL_LINK_FLAG) == 0)
+		return 1;
+
 	/* a. Update shmem->link_status accordingly
 	 * b. Update link_vars->link_up
 	 */
-- 
1.7.1

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

* [PATCH net 5/5] bnx2x: Fix KR2 work-around detection of BCM8073
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
                   ` (3 preceding siblings ...)
  2014-01-01  9:06 ` [PATCH net 4/5] bnx2x: Fix incorrect link-up report Yaniv Rosner
@ 2014-01-01  9:06 ` Yaniv Rosner
  2014-01-02  3:10 ` [PATCH net 0/5] bnx2x: Link fixes David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2014-01-01  9:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Ariel Elior

KR2 work-around is based on detecting non-KR2 devices which may not link up
in this mode. One such link-partner is the BCM8073 which has specific
advertisement characteristics in specific mode, and this condition was not set
correctly.

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

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 998cce3..11fc795 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -13572,7 +13572,7 @@ static void bnx2x_check_kr2_wa(struct link_params *params,
 	 */
 	not_kr2_device = (((base_page & 0x8000) == 0) ||
 			  (((base_page & 0x8000) &&
-			    ((next_page & 0xe0) == 0x2))));
+			    ((next_page & 0xe0) == 0x20))));
 
 	/* In case KR2 is already disabled, check if we need to re-enable it */
 	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
-- 
1.7.1

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

* Re: [PATCH net 0/5] bnx2x: Link fixes
  2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
                   ` (4 preceding siblings ...)
  2014-01-01  9:06 ` [PATCH net 5/5] bnx2x: Fix KR2 work-around detection of BCM8073 Yaniv Rosner
@ 2014-01-02  3:10 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2014-01-02  3:10 UTC (permalink / raw)
  To: yanivr; +Cc: netdev

From: Yaniv Rosner <yanivr@broadcom.com>
Date: Wed, 1 Jan 2014 11:06:40 +0200

> The following patch series contain few link fixes.
> Please consider applying it to net.

Series applied, thanks Yaniv.

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

end of thread, other threads:[~2014-01-02  3:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-01  9:06 [PATCH net 0/5] bnx2x: Link fixes Yaniv Rosner
2014-01-01  9:06 ` [PATCH net 1/5] bnx2x: Fix 578xx-KR 1G link Yaniv Rosner
2014-01-01  9:06 ` [PATCH net 2/5] bnx2x: Fix passive DAC cable detection Yaniv Rosner
2014-01-01  9:06 ` [PATCH net 3/5] bnx2x: Fix Duplex setting for 54618se Yaniv Rosner
2014-01-01  9:06 ` [PATCH net 4/5] bnx2x: Fix incorrect link-up report Yaniv Rosner
2014-01-01  9:06 ` [PATCH net 5/5] bnx2x: Fix KR2 work-around detection of BCM8073 Yaniv Rosner
2014-01-02  3:10 ` [PATCH net 0/5] bnx2x: Link fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).