Skip to content

Commit 83a9fb2

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbe: Add support for newer thermal alarm
The newer copper PHY implementation used with newer X550EM_x devices uses a different thermal alarm type than the earlier one. Make changes to support both types. Signed-off-by: Mark Rustad <[email protected]> Tested-by: Darin Miller <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent f164b84 commit 83a9fb2

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,14 +1345,18 @@ struct ixgbe_thermal_sensor_data {
13451345
#define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK 0xFF01 /* int chip-wide mask */
13461346
#define IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG 0xFC01 /* int chip-wide mask */
13471347
#define IXGBE_MDIO_GLOBAL_ALARM_1 0xCC00 /* Global alarm 1 */
1348+
#define IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT 0x0010 /* device fault */
13481349
#define IXGBE_MDIO_GLOBAL_ALM_1_HI_TMP_FAIL 0x4000 /* high temp failure */
1350+
#define IXGBE_MDIO_GLOBAL_FAULT_MSG 0xC850 /* global fault msg */
1351+
#define IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP 0x8007 /* high temp failure */
13491352
#define IXGBE_MDIO_GLOBAL_INT_MASK 0xD400 /* Global int mask */
13501353
/* autoneg vendor alarm int enable */
13511354
#define IXGBE_MDIO_GLOBAL_AN_VEN_ALM_INT_EN 0x1000
13521355
#define IXGBE_MDIO_GLOBAL_ALARM_1_INT 0x4 /* int in Global alarm 1 */
13531356
#define IXGBE_MDIO_GLOBAL_VEN_ALM_INT_EN 0x1 /* vendor alarm int enable */
13541357
#define IXGBE_MDIO_GLOBAL_STD_ALM2_INT 0x200 /* vendor alarm2 int mask */
13551358
#define IXGBE_MDIO_GLOBAL_INT_HI_TEMP_EN 0x4000 /* int high temp enable */
1359+
#define IXGBE_MDIO_GLOBAL_INT_DEV_FAULT_EN 0x0010 /*int dev fault enable */
13561360

13571361
#define IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR 0xC30A /* PHY_XS SDA/SCL Addr Reg */
13581362
#define IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA 0xC30B /* PHY_XS SDA/SCL Data Reg */

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
14441444
IXGBE_MDIO_GLOBAL_ALARM_1_INT)))
14451445
return status;
14461446

1447-
/* High temperature failure alarm triggered */
1447+
/* Global alarm triggered */
14481448
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1,
14491449
IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
14501450
&reg);
@@ -1458,6 +1458,21 @@ static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
14581458
ixgbe_set_copper_phy_power(hw, false);
14591459
return IXGBE_ERR_OVERTEMP;
14601460
}
1461+
if (reg & IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT) {
1462+
/* device fault alarm triggered */
1463+
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG,
1464+
IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
1465+
&reg);
1466+
if (status)
1467+
return status;
1468+
1469+
/* if device fault was due to high temp alarm handle and exit */
1470+
if (reg == IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP) {
1471+
/* power down the PHY in case the PHY FW didn't */
1472+
ixgbe_set_copper_phy_power(hw, false);
1473+
return IXGBE_ERR_OVERTEMP;
1474+
}
1475+
}
14611476

14621477
/* Vendor alarm 2 triggered */
14631478
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
@@ -1511,14 +1526,15 @@ static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
15111526
if (status)
15121527
return status;
15131528

1514-
/* Enables high temperature failure alarm */
1529+
/* Enable high temperature failure and global fault alarms */
15151530
status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
15161531
IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
15171532
&reg);
15181533
if (status)
15191534
return status;
15201535

1521-
reg |= IXGBE_MDIO_GLOBAL_INT_HI_TEMP_EN;
1536+
reg |= (IXGBE_MDIO_GLOBAL_INT_HI_TEMP_EN |
1537+
IXGBE_MDIO_GLOBAL_INT_DEV_FAULT_EN);
15221538

15231539
status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
15241540
IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,

0 commit comments

Comments
 (0)