Skip to contentSkip to conversation

igb: add support for x2 link width configurations

PATCH Applied Jeff Kirsher 2 participants 8 messages Apr 1, 2009 – Apr 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 igb: add support for x2 link width configurations

From: Alexander Duyck <[email protected]>

When device is on PCIe link trained as x2 the driver is currently reporting link width as "unknown". The original patch provided by Myron adds the x2 link support and my changes are cosmetic to clean up the readability of the conditional operators.

Based on work by: Myron Stowe <[email protected]>

---

 drivers/net/igb/igb_main.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/igb/igb_main.c +4 -3
index ca84216..be02045 100644
@@ -1476,9 +1476,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 		 netdev->name,
 		 ((hw->bus.speed == e1000_bus_speed_2500)
 		  ? "2.5Gb/s" : "unknown"),
-		 ((hw->bus.width == e1000_bus_width_pcie_x4)
-		  ? "Width x4" : (hw->bus.width == e1000_bus_width_pcie_x1)
-		  ? "Width x1" : "unknown"),
+		 ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
+		  (hw->bus.width == e1000_bus_width_pcie_x2) ? "Width x2" :
+		  (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
+		   "unknown"),
 		 netdev->dev_addr);
 
 	igb_read_part_num(hw, &part_num);
#1 lore raw

PATCH 2/5 igb: set num_rx/tx_queues to 0 when queues are freed

From: Alexander Duyck <[email protected]>

An issue was seen on suspend in which the system reported a page fault. This was due to the new reg_idx code being called after the queues were freed.

This update prevents any for loops from going through the queues by setting the number of queues to 0 when they are freed.

---

 drivers/net/igb/igb_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/igb/igb_main.c +3 -0
index be02045..10b095d 100644
@@ -420,6 +420,9 @@ static void igb_free_queues(struct igb_adapter *adapter)
 	for (i = 0; i < adapter->num_rx_queues; i++)
 		netif_napi_del(&adapter->rx_ring[i].napi);
 
+	adapter->num_rx_queues = 0;
+	adapter->num_tx_queues = 0;
+
 	kfree(adapter->tx_ring);
 	kfree(adapter->rx_ring);
 }
#3 lore raw

PATCH 3/5 igb: increase delay for copper link setup

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

Increase the delay for copper phy init from 15ms to 100ms. This is to address issues seen in which ethtool -t was failing in some cases on 82576 based adapters.

---

 drivers/net/igb/e1000_phy.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/igb/e1000_phy.c +5 -2
index de2d486..f50fac2 100644
@@ -448,8 +448,11 @@ s32 igb_copper_link_setup_igp(struct e1000_hw *hw)
 		goto out;
 	}
 
-	/* Wait 15ms for MAC to configure PHY from NVM settings. */
-	msleep(15);
+	/*
+	 * Wait 100ms for MAC to configure PHY from NVM settings, to avoid
+	 * timeout issues when LFS is enabled.
+	 */
+	msleep(100);
 
 	/*
 	 * The NVM settings will configure LPLU in D3 for
#5 lore raw

PATCH 4/5 igb: cleanup igb loopback path

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

The code path for setting up phy loopback testing was out of date and was setting bits it didn't need to. This change cleans up the code path and removes some code that has no effect on teh driver.

---

 drivers/net/igb/igb_ethtool.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
drivers/net/igb/igb_ethtool.c +3 -11
index fb09c8a..27eae49 100644
@@ -1419,7 +1419,6 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	u32 ctrl_reg = 0;
-	u32 stat_reg = 0;
 
 	hw->mac.autoneg = false;
 
@@ -1443,18 +1442,11 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
 	ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
 		     E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
 		     E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
-		     E1000_CTRL_FD);	 /* Force Duplex to FULL */
+		     E1000_CTRL_FD |	 /* Force Duplex to FULL */
+		     E1000_CTRL_SLU);	 /* Set link up enable bit */
 
-	if (hw->phy.media_type == e1000_media_type_copper &&
-	    hw->phy.type == e1000_phy_m88)
+	if (hw->phy.type == e1000_phy_m88)
 		ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
-	else {
-		/* Set the ILOS bit on the fiber Nic if half duplex link is
-		 * detected. */
-		stat_reg = rd32(E1000_STATUS);
-		if ((stat_reg & E1000_STATUS_FD) == 0)
-			ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU);
-	}
 
 	wr32(E1000_CTRL, ctrl_reg);
 
maintainer Applied
#7 lore raw
In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Tue, 31 Mar 2009 23:38:00 -0700

Quoted 8 lines

When device is on PCIe link trained as x2 the driver is currently reporting link width as "unknown". The original patch provided by Myron adds the x2 link support and my changes are cosmetic to clean up the readability of the conditional operators.

Based on work by: Myron Stowe <[email protected]>

Applied.

maintainer Applied
#2 lore raw

Re: [PATCH 2/5] igb: set num_rx/tx_queues to 0 when queues are freed

In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Tue, 31 Mar 2009 23:38:19 -0700

Quoted 8 lines

An issue was seen on suspend in which the system reported a page fault. This was due to the new reg_idx code being called after the queues were freed.

This update prevents any for loops from going through the queues by setting the number of queues to 0 when they are freed.

Applied.

maintainer Applied
#4 lore raw

Re: [PATCH 3/5] igb: increase delay for copper link setup

In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Tue, 31 Mar 2009 23:38:38 -0700

Quoted 6 lines

Increase the delay for copper phy init from 15ms to 100ms. This is to address issues seen in which ethtool -t was failing in some cases on 82576 based adapters.

Applied.

maintainer Applied
#6 lore raw

Re: [PATCH 4/5] igb: cleanup igb loopback path

In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Tue, 31 Mar 2009 23:38:56 -0700

Quoted 6 lines

The code path for setting up phy loopback testing was out of date and was setting bits it didn't need to. This change cleans up the code path and removes some code that has no effect on teh driver.

Applied.