public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [net PATCH 0/2] bnx2x: link bug fixes.
@ 2012-06-17  6:27 Yuval Mintz
  2012-06-17  6:27 ` [net PATCH 1/2] bnx2x: fix I2C non-respondent issue Yuval Mintz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yuval Mintz @ 2012-06-17  6:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, yaniv.rosner, Yuval Mintz

Hello Dave,

This patch series contain relatively small corrections
to the link initialization of the bnx2x driver.

Please consider applying it to 'net'.

Thanks,
Yuval Mintz

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

* [net PATCH 1/2] bnx2x: fix I2C non-respondent issue
  2012-06-17  6:27 [net PATCH 0/2] bnx2x: link bug fixes Yuval Mintz
@ 2012-06-17  6:27 ` Yuval Mintz
  2012-06-17  6:27 ` [net PATCH 2/2] bnx2x: fix link for BCM57711 with 84823 phy Yuval Mintz
  2012-06-17  6:39 ` [net PATCH 0/2] bnx2x: link bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2012-06-17  6:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, yaniv.rosner, Yuval Mintz

When I2C is not responding it's usually due to a previous
unexpected reset during I2C operation. We release it by
powering down and up the SFP+ module.


Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c |   52 ++++++++++++----------
 1 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index a3fb721..65f673f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -40,6 +40,7 @@
 #define I2C_BSC0			0
 #define I2C_BSC1			1
 #define I2C_WA_RETRY_CNT		3
+#define I2C_WA_PWR_ITER			(I2C_WA_RETRY_CNT - 1)
 #define MCPR_IMC_COMMAND_READ_OP	1
 #define MCPR_IMC_COMMAND_WRITE_OP	2
 
@@ -7659,6 +7660,28 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy,
 	return -EINVAL;
 }
 
+static void bnx2x_warpcore_power_module(struct link_params *params,
+					struct bnx2x_phy *phy,
+					u8 power)
+{
+	u32 pin_cfg;
+	struct bnx2x *bp = params->bp;
+
+	pin_cfg = (REG_RD(bp, params->shmem_base +
+			  offsetof(struct shmem_region,
+			dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
+			PORT_HW_CFG_E3_PWR_DIS_MASK) >>
+			PORT_HW_CFG_E3_PWR_DIS_SHIFT;
+
+	if (pin_cfg == PIN_CFG_NA)
+		return;
+	DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
+		       power, pin_cfg);
+	/* Low ==> corresponding SFP+ module is powered
+	 * high ==> the SFP+ module is powered down
+	 */
+	bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
+}
 static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
 						 struct link_params *params,
 						 u16 addr, u8 byte_cnt,
@@ -7678,6 +7701,12 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
 	/* 4 byte aligned address */
 	addr32 = addr & (~0x3);
 	do {
+		if (cnt == I2C_WA_PWR_ITER) {
+			bnx2x_warpcore_power_module(params, phy, 0);
+			/* Note that 100us are not enough here */
+			usleep_range(1000,1000);
+			bnx2x_warpcore_power_module(params, phy, 1);
+		}
 		rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
 				    data_array);
 	} while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT));
@@ -8200,29 +8229,6 @@ static void bnx2x_set_sfp_module_fault_led(struct link_params *params,
 		bnx2x_set_e1e2_module_fault_led(params, gpio_mode);
 }
 
-static void bnx2x_warpcore_power_module(struct link_params *params,
-					struct bnx2x_phy *phy,
-					u8 power)
-{
-	u32 pin_cfg;
-	struct bnx2x *bp = params->bp;
-
-	pin_cfg = (REG_RD(bp, params->shmem_base +
-			  offsetof(struct shmem_region,
-			dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
-			PORT_HW_CFG_E3_PWR_DIS_MASK) >>
-			PORT_HW_CFG_E3_PWR_DIS_SHIFT;
-
-	if (pin_cfg == PIN_CFG_NA)
-		return;
-	DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
-		       power, pin_cfg);
-	/* Low ==> corresponding SFP+ module is powered
-	 * high ==> the SFP+ module is powered down
-	 */
-	bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
-}
-
 static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy,
 				    struct link_params *params)
 {
-- 
1.7.9.rc2

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

* [net PATCH 2/2] bnx2x: fix link for BCM57711 with 84823 phy
  2012-06-17  6:27 [net PATCH 0/2] bnx2x: link bug fixes Yuval Mintz
  2012-06-17  6:27 ` [net PATCH 1/2] bnx2x: fix I2C non-respondent issue Yuval Mintz
@ 2012-06-17  6:27 ` Yuval Mintz
  2012-06-17  6:39 ` [net PATCH 0/2] bnx2x: link bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2012-06-17  6:27 UTC (permalink / raw)
  To: davem, netdev; +Cc: eilong, yaniv.rosner, Yuval Mintz

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@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 65f673f..e0b1fbc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -9754,7 +9754,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
 
 	msleep(1);
 
-	if (!(CHIP_IS_E1(bp)))
+	if (!(CHIP_IS_E1x(bp)))
 		port = BP_PATH(bp);
 	else
 		port = params->port;
-- 
1.7.9.rc2

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

* Re: [net PATCH 0/2] bnx2x: link bug fixes.
  2012-06-17  6:27 [net PATCH 0/2] bnx2x: link bug fixes Yuval Mintz
  2012-06-17  6:27 ` [net PATCH 1/2] bnx2x: fix I2C non-respondent issue Yuval Mintz
  2012-06-17  6:27 ` [net PATCH 2/2] bnx2x: fix link for BCM57711 with 84823 phy Yuval Mintz
@ 2012-06-17  6:39 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-06-17  6:39 UTC (permalink / raw)
  To: yuvalmin; +Cc: netdev, eilong, yaniv.rosner

From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Sun, 17 Jun 2012 09:27:13 +0300

> This patch series contain relatively small corrections
> to the link initialization of the bnx2x driver.
> 
> Please consider applying it to 'net'.

Both applied, thanks.

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

end of thread, other threads:[~2012-06-17  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-17  6:27 [net PATCH 0/2] bnx2x: link bug fixes Yuval Mintz
2012-06-17  6:27 ` [net PATCH 1/2] bnx2x: fix I2C non-respondent issue Yuval Mintz
2012-06-17  6:27 ` [net PATCH 2/2] bnx2x: fix link for BCM57711 with 84823 phy Yuval Mintz
2012-06-17  6:39 ` [net PATCH 0/2] bnx2x: link bug 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