All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables
@ 2010-12-03 23:23 Jeff Kirsher
  2010-12-03 23:24 ` [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser Jeff Kirsher
  2010-12-06 21:21 ` [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Kirsher @ 2010-12-03 23:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Don Skidmore, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

This patch helps prevent FW/SW semaphore collision from leading
to link establishment failure.  The collision might mess up the
PHY registers so we reset the PHY.  However there are SFI/KR areas
in the PHY that are not reset with a Reset_AN so we need to change
LMS to reset it.  Also wait until AN state machine is AN_GOOD

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_82599.c |   28 +++++++++++++++++++++++++---
 drivers/net/ixgbe/ixgbe_type.h  |    3 +++
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 385cceb..6827ddd 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -96,6 +96,8 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
 static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
 {
 	s32 ret_val = 0;
+	u32 reg_anlp1 = 0;
+	u32 i = 0;
 	u16 list_offset, data_offset, data_value;
 
 	if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) {
@@ -122,14 +124,34 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
 			IXGBE_WRITE_FLUSH(hw);
 			hw->eeprom.ops.read(hw, ++data_offset, &data_value);
 		}
-		/* Now restart DSP by setting Restart_AN */
-		IXGBE_WRITE_REG(hw, IXGBE_AUTOC,
-		    (IXGBE_READ_REG(hw, IXGBE_AUTOC) | IXGBE_AUTOC_AN_RESTART));
 
 		/* Release the semaphore */
 		ixgbe_release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
 		/* Delay obtaining semaphore again to allow FW access */
 		msleep(hw->eeprom.semaphore_delay);
+
+		/* Now restart DSP by setting Restart_AN and clearing LMS */
+		IXGBE_WRITE_REG(hw, IXGBE_AUTOC, ((IXGBE_READ_REG(hw,
+		                IXGBE_AUTOC) & ~IXGBE_AUTOC_LMS_MASK) |
+		                IXGBE_AUTOC_AN_RESTART));
+
+		/* Wait for AN to leave state 0 */
+		for (i = 0; i < 10; i++) {
+			msleep(4);
+			reg_anlp1 = IXGBE_READ_REG(hw, IXGBE_ANLP1);
+			if (reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK)
+				break;
+		}
+		if (!(reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK)) {
+			hw_dbg(hw, "sfp module setup not complete\n");
+			ret_val = IXGBE_ERR_SFP_SETUP_NOT_COMPLETE;
+			goto setup_sfp_out;
+		}
+
+		/* Restart DSP by setting Restart_AN and return to SFI mode */
+		IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (IXGBE_READ_REG(hw,
+		                IXGBE_AUTOC) | IXGBE_AUTOC_LMS_10G_SERIAL |
+		                IXGBE_AUTOC_AN_RESTART));
 	}
 
 setup_sfp_out:
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index ef816dd..0f80893 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -1470,6 +1470,8 @@
 #define IXGBE_ANLP1_PAUSE               0x0C00
 #define IXGBE_ANLP1_SYM_PAUSE           0x0400
 #define IXGBE_ANLP1_ASM_PAUSE           0x0800
+#define IXGBE_ANLP1_AN_STATE_MASK       0x000f0000
+
 
 /* SW Semaphore Register bitmasks */
 #define IXGBE_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
@@ -2641,6 +2643,7 @@ struct ixgbe_info {
 #define IXGBE_ERR_NO_SPACE                      -25
 #define IXGBE_ERR_OVERTEMP                      -26
 #define IXGBE_ERR_RAR_INDEX                     -27
+#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE        -30
 #define IXGBE_ERR_PBA_SECTION                   -31
 #define IXGBE_ERR_INVALID_ARGUMENT              -32
 #define IXGBE_NOT_IMPLEMENTED                   0x7FFFFFFF


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

* [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser
  2010-12-03 23:23 [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables Jeff Kirsher
@ 2010-12-03 23:24 ` Jeff Kirsher
  2010-12-06 21:21   ` David Miller
  2010-12-06 21:21 ` [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2010-12-03 23:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

Fixes a recent bug on the patch (c6ecf39a10ceec3e97096e2a8d3eadcecd593422)
that disabled the laser on ifconfig down.  Compilers were seeing a enum
mismatch.

Signed-off-by Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index c5998ca..fdb35d0 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3800,7 +3800,7 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
 	/* enable the optics for both mult-speed fiber and 82599 SFP+ fiber */
 	if (hw->mac.ops.enable_tx_laser &&
 	    ((hw->phy.multispeed_fiber) ||
-	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	     ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
 	      (hw->mac.type == ixgbe_mac_82599EB))))
 		hw->mac.ops.enable_tx_laser(hw);
 
@@ -4122,7 +4122,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 	/* power down the optics for multispeed fiber and 82599 SFP+ fiber */
 	if (hw->mac.ops.disable_tx_laser &&
 	    ((hw->phy.multispeed_fiber) ||
-	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	     ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
 	      (hw->mac.type == ixgbe_mac_82599EB))))
 		hw->mac.ops.disable_tx_laser(hw);
 
@@ -7215,7 +7215,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 	/* power down the optics for multispeed fiber and 82599 SFP+ fiber */
 	if (hw->mac.ops.disable_tx_laser &&
 	    ((hw->phy.multispeed_fiber) ||
-	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	     ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
 	      (hw->mac.type == ixgbe_mac_82599EB))))
 		hw->mac.ops.disable_tx_laser(hw);
 


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

* Re: [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables
  2010-12-03 23:23 [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables Jeff Kirsher
  2010-12-03 23:24 ` [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser Jeff Kirsher
@ 2010-12-06 21:21 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-12-06 21:21 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, donald.c.skidmore

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 03 Dec 2010 15:23:30 -0800

> From: Don Skidmore <donald.c.skidmore@intel.com>
> 
> This patch helps prevent FW/SW semaphore collision from leading
> to link establishment failure.  The collision might mess up the
> PHY registers so we reset the PHY.  However there are SFI/KR areas
> in the PHY that are not reset with a Reset_AN so we need to change
> LMS to reset it.  Also wait until AN state machine is AN_GOOD
> 
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Tested-by: Stephen Ko <stephen.s.ko@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

* Re: [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser
  2010-12-03 23:24 ` [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser Jeff Kirsher
@ 2010-12-06 21:21   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-12-06 21:21 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 03 Dec 2010 15:24:05 -0800

> From: Don Skidmore <donald.c.skidmore@intel.com>
> 
> Fixes a recent bug on the patch (c6ecf39a10ceec3e97096e2a8d3eadcecd593422)
> that disabled the laser on ifconfig down.  Compilers were seeing a enum
> mismatch.
> 
> Signed-off-by Don Skidmore <donald.c.skidmore@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

end of thread, other threads:[~2010-12-06 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 23:23 [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables Jeff Kirsher
2010-12-03 23:24 ` [net-next-2.6 PATCH 2/2] ixgbe: fix enum type mismatch on disable laser Jeff Kirsher
2010-12-06 21:21   ` David Miller
2010-12-06 21:21 ` [net-next-2.6 PATCH 1/2] ixgbe: fix for link failure on SFP+ DA cables 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.