All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH net 0/3] bnx2x: Link/LED fixes
  2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
@ 2013-02-27 21:10 ` David Miller
  2013-02-27 21:14   ` David Miller
  2013-02-27 23:06 ` [PATCH net 1/3] bnx2x: Fix port identification for the 84834 Yaniv Rosner
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2013-02-27 21:10 UTC (permalink / raw)
  To: yanivr; +Cc: netdev

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Thu, 28 Feb 2013 01:06:43 +0200

> Hi Dave,
> The following patch series describe couple of link fixes.
> Please consider applying it to net.

Where is patch #1?

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

* Re: [PATCH net 0/3] bnx2x: Link/LED fixes
  2013-02-27 21:10 ` David Miller
@ 2013-02-27 21:14   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-02-27 21:14 UTC (permalink / raw)
  To: yanivr; +Cc: netdev

From: David Miller <davem@davemloft.net>
Date: Wed, 27 Feb 2013 16:10:44 -0500 (EST)

> From: "Yaniv Rosner" <yanivr@broadcom.com>
> Date: Thu, 28 Feb 2013 01:06:43 +0200
> 
>> Hi Dave,
>> The following patch series describe couple of link fixes.
>> Please consider applying it to net.
> 
> Where is patch #1?

Nevermind it just showed up :)

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

* [PATCH net 0/3] bnx2x: Link/LED fixes
@ 2013-02-27 23:06 Yaniv Rosner
  2013-02-27 21:10 ` David Miller
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yaniv Rosner @ 2013-02-27 23:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner

Hi Dave,
The following patch series describe couple of link fixes.
Please consider applying it to net.

Thanks,
Yaniv

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

* [PATCH net 1/3] bnx2x: Fix port identification for the 84834
  2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
  2013-02-27 21:10 ` David Miller
@ 2013-02-27 23:06 ` Yaniv Rosner
  2013-02-27 23:06 ` [PATCH net 2/3] bnx2x: Fix KR2 link Yaniv Rosner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2013-02-27 23:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Eilon Greenstein

Fix the "ethtool -p" for boards with BCM84834, by using LED4 of the PHY 
to toggle the link LED while keeping interrupt disabled to avoid NIG attentions,
and at the end restore NIG to previous state.

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

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 1663e0b..4719ab1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -10422,6 +10422,28 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy,
 					 MDIO_PMA_DEVAD,
 					 MDIO_PMA_REG_8481_LED1_MASK,
 					 0x0);
+			if (phy->type ==
+			    PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834) {
+				/* Disable MI_INT interrupt before setting LED4
+				 * source to constant off.
+				 */
+				if (REG_RD(bp, NIG_REG_MASK_INTERRUPT_PORT0 +
+					   params->port*4) &
+				    NIG_MASK_MI_INT) {
+					params->link_flags |=
+					LINK_FLAGS_INT_DISABLED;
+
+					bnx2x_bits_dis(
+						bp,
+						NIG_REG_MASK_INTERRUPT_PORT0 +
+						params->port*4,
+						NIG_MASK_MI_INT);
+				}
+				bnx2x_cl45_write(bp, phy,
+						 MDIO_PMA_DEVAD,
+						 MDIO_PMA_REG_8481_SIGNAL_MASK,
+						 0x0);
+			}
 		}
 		break;
 	case LED_MODE_ON:
@@ -10468,6 +10490,28 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy,
 					 MDIO_PMA_DEVAD,
 					 MDIO_PMA_REG_8481_LED1_MASK,
 					 0x20);
+			if (phy->type ==
+			    PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834) {
+				/* Disable MI_INT interrupt before setting LED4
+				 * source to constant on.
+				 */
+				if (REG_RD(bp, NIG_REG_MASK_INTERRUPT_PORT0 +
+					   params->port*4) &
+				    NIG_MASK_MI_INT) {
+					params->link_flags |=
+					LINK_FLAGS_INT_DISABLED;
+
+					bnx2x_bits_dis(
+						bp,
+						NIG_REG_MASK_INTERRUPT_PORT0 +
+						params->port*4,
+						NIG_MASK_MI_INT);
+				}
+				bnx2x_cl45_write(bp, phy,
+						 MDIO_PMA_DEVAD,
+						 MDIO_PMA_REG_8481_SIGNAL_MASK,
+						 0x20);
+			}
 		}
 		break;
 
@@ -10532,6 +10576,22 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy,
 					 MDIO_PMA_DEVAD,
 					 MDIO_PMA_REG_8481_LINK_SIGNAL,
 					 val);
+			if (phy->type ==
+			    PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834) {
+				/* Restore LED4 source to external link,
+				 * and re-enable interrupts.
+				 */
+				bnx2x_cl45_write(bp, phy,
+						 MDIO_PMA_DEVAD,
+						 MDIO_PMA_REG_8481_SIGNAL_MASK,
+						 0x40);
+				if (params->link_flags &
+				    LINK_FLAGS_INT_DISABLED) {
+					bnx2x_link_int_enable(params);
+					params->link_flags &=
+						~LINK_FLAGS_INT_DISABLED;
+				}
+			}
 		}
 		break;
 	}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index d25c7d7..be5c195 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -307,7 +307,8 @@ struct link_params {
 	struct bnx2x *bp;
 	u16 req_fc_auto_adv; /* Should be set to TX / BOTH when
 				req_flow_ctrl is set to AUTO */
-	u16 rsrv1;
+	u16 link_flags;
+#define LINK_FLAGS_INT_DISABLED		(1<<0)
 	u32 lfa_base;
 };
 
-- 
1.7.7.1

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

* [PATCH net 2/3] bnx2x: Fix KR2 link
  2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
  2013-02-27 21:10 ` David Miller
  2013-02-27 23:06 ` [PATCH net 1/3] bnx2x: Fix port identification for the 84834 Yaniv Rosner
@ 2013-02-27 23:06 ` Yaniv Rosner
  2013-02-27 23:06 ` [PATCH net 3/3] bnx2x: Fix KR2 work-around condition Yaniv Rosner
  2013-02-28 20:40 ` [PATCH net 0/3] bnx2x: Link/LED fixes David Miller
  4 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2013-02-27 23:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Eilon Greenstein

Fix KR2 link down problem after reboot when link speed is reconfigured via ethtool.
Since 1G/10G support link speed were missing by default, 1G/10G link speed were
not advertised.

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

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 9a674b1..edfa67a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -281,6 +281,8 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 			cmd->lp_advertising |= ADVERTISED_2500baseX_Full;
 		if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE)
 			cmd->lp_advertising |= ADVERTISED_10000baseT_Full;
+		if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE)
+			cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full;
 	}
 
 	cmd->maxtxpkt = 0;
@@ -463,6 +465,10 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 						ADVERTISED_10000baseKR_Full))
 				bp->link_params.speed_cap_mask[cfg_idx] |=
 					PORT_HW_CFG_SPEED_CAPABILITY_D0_10G;
+
+			if (cmd->advertising & ADVERTISED_20000baseKR2_Full)
+				bp->link_params.speed_cap_mask[cfg_idx] |=
+					PORT_HW_CFG_SPEED_CAPABILITY_D0_20G;
 		}
 	} else { /* forced speed */
 		/* advertise the requested speed and duplex if supported */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 4719ab1..bf69c53 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -11851,6 +11851,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port,
 			phy->media_type = ETH_PHY_KR;
 			phy->flags |= FLAGS_WC_DUAL_MODE;
 			phy->supported &= (SUPPORTED_20000baseKR2_Full |
+					   SUPPORTED_10000baseT_Full |
+					   SUPPORTED_1000baseT_Full |
 					   SUPPORTED_Autoneg |
 					   SUPPORTED_FIBRE |
 					   SUPPORTED_Pause |
-- 
1.7.7.1

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

* [PATCH net 3/3] bnx2x: Fix KR2 work-around condition
  2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
                   ` (2 preceding siblings ...)
  2013-02-27 23:06 ` [PATCH net 2/3] bnx2x: Fix KR2 link Yaniv Rosner
@ 2013-02-27 23:06 ` Yaniv Rosner
  2013-02-28 20:40 ` [PATCH net 0/3] bnx2x: Link/LED fixes David Miller
  4 siblings, 0 replies; 7+ messages in thread
From: Yaniv Rosner @ 2013-02-27 23:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yaniv Rosner, Eilon Greenstein

Fix condition typo for running KR2 work-around though it doesn't have 
real effect since the typo bits matched by chance.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@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 bf69c53..31c5787 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -13499,7 +13499,7 @@ void bnx2x_period_func(struct link_params *params, struct link_vars *vars)
 		struct bnx2x_phy *phy = &params->phy[INT_PHY];
 		bnx2x_set_aer_mmd(params, phy);
 		if ((phy->supported & SUPPORTED_20000baseKR2_Full) &&
-		    (phy->speed_cap_mask & SPEED_20000))
+		    (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_20G))
 			bnx2x_check_kr2_wa(params, vars, phy);
 		bnx2x_check_over_curr(params, vars);
 		if (vars->rx_tx_asic_rst)
-- 
1.7.7.1

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

* Re: [PATCH net 0/3] bnx2x: Link/LED fixes
  2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
                   ` (3 preceding siblings ...)
  2013-02-27 23:06 ` [PATCH net 3/3] bnx2x: Fix KR2 work-around condition Yaniv Rosner
@ 2013-02-28 20:40 ` David Miller
  4 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-02-28 20:40 UTC (permalink / raw)
  To: yanivr; +Cc: netdev

From: "Yaniv Rosner" <yanivr@broadcom.com>
Date: Thu, 28 Feb 2013 01:06:43 +0200

> The following patch series describe couple of link fixes.
> Please consider applying it to net.

All applied, thanks Yaniv.

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

end of thread, other threads:[~2013-02-28 20:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 23:06 [PATCH net 0/3] bnx2x: Link/LED fixes Yaniv Rosner
2013-02-27 21:10 ` David Miller
2013-02-27 21:14   ` David Miller
2013-02-27 23:06 ` [PATCH net 1/3] bnx2x: Fix port identification for the 84834 Yaniv Rosner
2013-02-27 23:06 ` [PATCH net 2/3] bnx2x: Fix KR2 link Yaniv Rosner
2013-02-27 23:06 ` [PATCH net 3/3] bnx2x: Fix KR2 work-around condition Yaniv Rosner
2013-02-28 20:40 ` [PATCH net 0/3] bnx2x: Link/LED 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.