Skip to content

Commit b163b42

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says: ==================== This series contains updates to igb only. Todd provides a fix for igb to not look for a PBA in the iNVM on devices that are flashless. Akeem provides igb patches to add a new PHY id for i354, as well as a couple of patches to implement the new PHY id. He also provides several patches to correctly report the appropriate media type as well as correctly report advertised/supported link for i354 devices. Lastly Akeem implements a 1 second delay mechanism for i210 devices to avoid erroneous link issue with the link partner. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 48f8e0a + 66f40b8 commit b163b42

File tree

7 files changed

+143
-60
lines changed

7 files changed

+143
-60
lines changed

drivers/net/ethernet/intel/igb/e1000_82575.c

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
176176

177177
/* Verify phy id and set remaining function pointers */
178178
switch (phy->id) {
179-
case M88E1545_E_PHY_ID:
179+
case M88E1543_E_PHY_ID:
180180
case I347AT4_E_PHY_ID:
181181
case M88E1112_E_PHY_ID:
182182
case M88E1111_I_PHY_ID:
@@ -1140,6 +1140,31 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *hw)
11401140
return ret_val;
11411141
}
11421142

1143+
/**
1144+
* igb_get_link_up_info_82575 - Get link speed/duplex info
1145+
* @hw: pointer to the HW structure
1146+
* @speed: stores the current speed
1147+
* @duplex: stores the current duplex
1148+
*
1149+
* This is a wrapper function, if using the serial gigabit media independent
1150+
* interface, use PCS to retrieve the link speed and duplex information.
1151+
* Otherwise, use the generic function to get the link speed and duplex info.
1152+
**/
1153+
static s32 igb_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
1154+
u16 *duplex)
1155+
{
1156+
s32 ret_val;
1157+
1158+
if (hw->phy.media_type != e1000_media_type_copper)
1159+
ret_val = igb_get_pcs_speed_and_duplex_82575(hw, speed,
1160+
duplex);
1161+
else
1162+
ret_val = igb_get_speed_and_duplex_copper(hw, speed,
1163+
duplex);
1164+
1165+
return ret_val;
1166+
}
1167+
11431168
/**
11441169
* igb_check_for_link_82575 - Check for link
11451170
* @hw: pointer to the HW structure
@@ -1217,7 +1242,7 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
12171242
u16 *duplex)
12181243
{
12191244
struct e1000_mac_info *mac = &hw->mac;
1220-
u32 pcs;
1245+
u32 pcs, status;
12211246

12221247
/* Set up defaults for the return values of this function */
12231248
mac->serdes_has_link = false;
@@ -1238,20 +1263,31 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed,
12381263
mac->serdes_has_link = true;
12391264

12401265
/* Detect and store PCS speed */
1241-
if (pcs & E1000_PCS_LSTS_SPEED_1000) {
1266+
if (pcs & E1000_PCS_LSTS_SPEED_1000)
12421267
*speed = SPEED_1000;
1243-
} else if (pcs & E1000_PCS_LSTS_SPEED_100) {
1268+
else if (pcs & E1000_PCS_LSTS_SPEED_100)
12441269
*speed = SPEED_100;
1245-
} else {
1270+
else
12461271
*speed = SPEED_10;
1247-
}
12481272

12491273
/* Detect and store PCS duplex */
1250-
if (pcs & E1000_PCS_LSTS_DUPLEX_FULL) {
1274+
if (pcs & E1000_PCS_LSTS_DUPLEX_FULL)
12511275
*duplex = FULL_DUPLEX;
1252-
} else {
1276+
else
12531277
*duplex = HALF_DUPLEX;
1278+
1279+
/* Check if it is an I354 2.5Gb backplane connection. */
1280+
if (mac->type == e1000_i354) {
1281+
status = rd32(E1000_STATUS);
1282+
if ((status & E1000_STATUS_2P5_SKU) &&
1283+
!(status & E1000_STATUS_2P5_SKU_OVER)) {
1284+
*speed = SPEED_2500;
1285+
*duplex = FULL_DUPLEX;
1286+
hw_dbg("2500 Mbs, ");
1287+
hw_dbg("Full Duplex\n");
1288+
}
12541289
}
1290+
12551291
}
12561292

12571293
return 0;
@@ -1421,11 +1457,18 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
14211457
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
14221458
wr32(E1000_CTRL, ctrl);
14231459

1424-
/* Clear Go Link Disconnect bit */
1425-
if (hw->mac.type >= e1000_82580) {
1460+
/* Clear Go Link Disconnect bit on supported devices */
1461+
switch (hw->mac.type) {
1462+
case e1000_82580:
1463+
case e1000_i350:
1464+
case e1000_i210:
1465+
case e1000_i211:
14261466
phpm_reg = rd32(E1000_82580_PHY_POWER_MGMT);
14271467
phpm_reg &= ~E1000_82580_PM_GO_LINKD;
14281468
wr32(E1000_82580_PHY_POWER_MGMT, phpm_reg);
1469+
break;
1470+
default:
1471+
break;
14291472
}
14301473

14311474
ret_val = igb_setup_serdes_link_82575(hw);
@@ -1448,7 +1491,7 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
14481491
switch (hw->phy.id) {
14491492
case I347AT4_E_PHY_ID:
14501493
case M88E1112_E_PHY_ID:
1451-
case M88E1545_E_PHY_ID:
1494+
case M88E1543_E_PHY_ID:
14521495
case I210_I_PHY_ID:
14531496
ret_val = igb_copper_link_setup_m88_gen2(hw);
14541497
break;
@@ -2477,28 +2520,28 @@ s32 igb_set_eee_i354(struct e1000_hw *hw)
24772520
u16 phy_data;
24782521

24792522
if ((hw->phy.media_type != e1000_media_type_copper) ||
2480-
(phy->id != M88E1545_E_PHY_ID))
2523+
(phy->id != M88E1543_E_PHY_ID))
24812524
goto out;
24822525

24832526
if (!hw->dev_spec._82575.eee_disable) {
24842527
/* Switch to PHY page 18. */
2485-
ret_val = phy->ops.write_reg(hw, E1000_M88E1545_PAGE_ADDR, 18);
2528+
ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 18);
24862529
if (ret_val)
24872530
goto out;
24882531

2489-
ret_val = phy->ops.read_reg(hw, E1000_M88E1545_EEE_CTRL_1,
2532+
ret_val = phy->ops.read_reg(hw, E1000_M88E1543_EEE_CTRL_1,
24902533
&phy_data);
24912534
if (ret_val)
24922535
goto out;
24932536

2494-
phy_data |= E1000_M88E1545_EEE_CTRL_1_MS;
2495-
ret_val = phy->ops.write_reg(hw, E1000_M88E1545_EEE_CTRL_1,
2537+
phy_data |= E1000_M88E1543_EEE_CTRL_1_MS;
2538+
ret_val = phy->ops.write_reg(hw, E1000_M88E1543_EEE_CTRL_1,
24962539
phy_data);
24972540
if (ret_val)
24982541
goto out;
24992542

25002543
/* Return the PHY to page 0. */
2501-
ret_val = phy->ops.write_reg(hw, E1000_M88E1545_PAGE_ADDR, 0);
2544+
ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0);
25022545
if (ret_val)
25032546
goto out;
25042547

@@ -2549,7 +2592,7 @@ s32 igb_get_eee_status_i354(struct e1000_hw *hw, bool *status)
25492592

25502593
/* Check if EEE is supported on this device. */
25512594
if ((hw->phy.media_type != e1000_media_type_copper) ||
2552-
(phy->id != M88E1545_E_PHY_ID))
2595+
(phy->id != M88E1543_E_PHY_ID))
25532596
goto out;
25542597

25552598
ret_val = igb_read_xmdio_reg(hw, E1000_PCS_STATUS_ADDR_I354,
@@ -2705,7 +2748,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
27052748
.check_for_link = igb_check_for_link_82575,
27062749
.rar_set = igb_rar_set,
27072750
.read_mac_addr = igb_read_mac_addr_82575,
2708-
.get_speed_and_duplex = igb_get_speed_and_duplex_copper,
2751+
.get_speed_and_duplex = igb_get_link_up_info_82575,
27092752
#ifdef CONFIG_IGB_HWMON
27102753
.get_thermal_sensor_data = igb_get_thermal_sensor_data_generic,
27112754
.init_thermal_sensor_thresh = igb_init_thermal_sensor_thresh_generic,

drivers/net/ethernet/intel/igb/e1000_defines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@
787787
#define I350_I_PHY_ID 0x015403B0
788788
#define M88_VENDOR 0x0141
789789
#define I210_I_PHY_ID 0x01410C00
790-
#define M88E1545_E_PHY_ID 0x01410EA0
790+
#define M88E1543_E_PHY_ID 0x01410EA0
791791

792792
/* M88E1000 Specific Registers */
793793
#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
@@ -909,9 +909,9 @@
909909
#define E1000_EEE_LP_ADV_DEV_I210 7 /* EEE LP Adv Device */
910910
#define E1000_EEE_LP_ADV_ADDR_I210 61 /* EEE LP Adv Register */
911911
#define E1000_MMDAC_FUNC_DATA 0x4000 /* Data, no post increment */
912-
#define E1000_M88E1545_PAGE_ADDR 0x16 /* Page Offset Register */
913-
#define E1000_M88E1545_EEE_CTRL_1 0x0
914-
#define E1000_M88E1545_EEE_CTRL_1_MS 0x0001 /* EEE Master/Slave */
912+
#define E1000_M88E1543_PAGE_ADDR 0x16 /* Page Offset Register */
913+
#define E1000_M88E1543_EEE_CTRL_1 0x0
914+
#define E1000_M88E1543_EEE_CTRL_1_MS 0x0001 /* EEE Master/Slave */
915915
#define E1000_EEE_ADV_DEV_I354 7
916916
#define E1000_EEE_ADV_ADDR_I354 60
917917
#define E1000_EEE_ADV_100_SUPPORTED (1 << 1) /* 100BaseTx EEE Supported */

drivers/net/ethernet/intel/igb/e1000_mac.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,17 +1171,6 @@ s32 igb_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
11711171
hw_dbg("Half Duplex\n");
11721172
}
11731173

1174-
/* Check if it is an I354 2.5Gb backplane connection. */
1175-
if (hw->mac.type == e1000_i354) {
1176-
if ((status & E1000_STATUS_2P5_SKU) &&
1177-
!(status & E1000_STATUS_2P5_SKU_OVER)) {
1178-
*speed = SPEED_2500;
1179-
*duplex = FULL_DUPLEX;
1180-
hw_dbg("2500 Mbs, ");
1181-
hw_dbg("Full Duplex\n");
1182-
}
1183-
}
1184-
11851174
return 0;
11861175
}
11871176

drivers/net/ethernet/intel/igb/e1000_phy.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -731,15 +731,13 @@ s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw)
731731
s32 ret_val;
732732
u16 phy_data;
733733

734-
if (phy->reset_disable) {
735-
ret_val = 0;
736-
goto out;
737-
}
734+
if (phy->reset_disable)
735+
return 0;
738736

739737
/* Enable CRS on Tx. This must be set for half-duplex operation. */
740738
ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
741739
if (ret_val)
742-
goto out;
740+
return ret_val;
743741

744742
/* Options:
745743
* MDI/MDI-X = 0 (default)
@@ -780,23 +778,36 @@ s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw)
780778
phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
781779

782780
/* Enable downshift and setting it to X6 */
781+
if (phy->id == M88E1543_E_PHY_ID) {
782+
phy_data &= ~I347AT4_PSCR_DOWNSHIFT_ENABLE;
783+
ret_val =
784+
phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
785+
if (ret_val)
786+
return ret_val;
787+
788+
ret_val = igb_phy_sw_reset(hw);
789+
if (ret_val) {
790+
hw_dbg("Error committing the PHY changes\n");
791+
return ret_val;
792+
}
793+
}
794+
783795
phy_data &= ~I347AT4_PSCR_DOWNSHIFT_MASK;
784796
phy_data |= I347AT4_PSCR_DOWNSHIFT_6X;
785797
phy_data |= I347AT4_PSCR_DOWNSHIFT_ENABLE;
786798

787799
ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
788800
if (ret_val)
789-
goto out;
801+
return ret_val;
790802

791803
/* Commit the changes. */
792804
ret_val = igb_phy_sw_reset(hw);
793805
if (ret_val) {
794806
hw_dbg("Error committing the PHY changes\n");
795-
goto out;
807+
return ret_val;
796808
}
797809

798-
out:
799-
return ret_val;
810+
return 0;
800811
}
801812

802813
/**
@@ -1806,7 +1817,7 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)
18061817
phy->max_cable_length = phy_data / (is_cm ? 100 : 1);
18071818
phy->cable_length = phy_data / (is_cm ? 100 : 1);
18081819
break;
1809-
case M88E1545_E_PHY_ID:
1820+
case M88E1543_E_PHY_ID:
18101821
case I347AT4_E_PHY_ID:
18111822
/* Remember the original page select and set it to 7 */
18121823
ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,

drivers/net/ethernet/intel/igb/igb.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ struct igb_adapter {
448448
struct i2c_client *i2c_client;
449449
u32 rss_indir_tbl_init;
450450
u8 rss_indir_tbl[IGB_RETA_SIZE];
451+
452+
unsigned long link_check_timeout;
451453
};
452454

453455
#define IGB_FLAG_HAS_MSI (1 << 0)
@@ -459,6 +461,7 @@ struct igb_adapter {
459461
#define IGB_FLAG_RSS_FIELD_IPV4_UDP (1 << 6)
460462
#define IGB_FLAG_RSS_FIELD_IPV6_UDP (1 << 7)
461463
#define IGB_FLAG_WOL_SUPPORTED (1 << 8)
464+
#define IGB_FLAG_NEED_LINK_UPDATE (1 << 9)
462465

463466
/* DMA Coalescing defines */
464467
#define IGB_MIN_TXPBSIZE 20408

drivers/net/ethernet/intel/igb/igb_ethtool.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
172172
SUPPORTED_Autoneg |
173173
SUPPORTED_Pause);
174174
ecmd->advertising = ADVERTISED_FIBRE;
175-
if (hw->mac.type == e1000_i354) {
176-
ecmd->supported |= SUPPORTED_2500baseX_Full;
177-
ecmd->advertising |= ADVERTISED_2500baseX_Full;
178-
}
175+
179176
if ((eth_flags->e1000_base_lx) || (eth_flags->e1000_base_sx)) {
180177
ecmd->supported |= SUPPORTED_1000baseT_Full;
181178
ecmd->advertising |= ADVERTISED_1000baseT_Full;
@@ -209,16 +206,23 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
209206
status = rd32(E1000_STATUS);
210207

211208
if (status & E1000_STATUS_LU) {
212-
if ((hw->mac.type == e1000_i354) &&
213-
(status & E1000_STATUS_2P5_SKU) &&
214-
!(status & E1000_STATUS_2P5_SKU_OVER))
215-
ecmd->speed = SPEED_2500;
216-
else if (status & E1000_STATUS_SPEED_1000)
209+
if (hw->mac.type == e1000_i354) {
210+
if ((status & E1000_STATUS_2P5_SKU) &&
211+
!(status & E1000_STATUS_2P5_SKU_OVER)) {
212+
ecmd->supported = SUPPORTED_2500baseX_Full;
213+
ecmd->advertising = ADVERTISED_2500baseX_Full;
214+
ecmd->speed = SPEED_2500;
215+
} else {
216+
ecmd->supported = SUPPORTED_1000baseT_Full;
217+
ecmd->advertising = ADVERTISED_1000baseT_Full;
218+
}
219+
} else if (status & E1000_STATUS_SPEED_1000) {
217220
ecmd->speed = SPEED_1000;
218-
else if (status & E1000_STATUS_SPEED_100)
221+
} else if (status & E1000_STATUS_SPEED_100) {
219222
ecmd->speed = SPEED_100;
220-
else
223+
} else {
221224
ecmd->speed = SPEED_10;
225+
}
222226
if ((status & E1000_STATUS_FD) ||
223227
hw->phy.media_type != e1000_media_type_copper)
224228
ecmd->duplex = DUPLEX_FULL;

0 commit comments

Comments
 (0)