diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 9551cbb7bf01..d571d101de08 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -108,6 +108,8 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = { | |||
108 | board_82599 }, | 108 | board_82599 }, |
109 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), | 109 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), |
110 | board_82599 }, | 110 | board_82599 }, |
111 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_T3_LOM), | ||
112 | board_82599 }, | ||
111 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE), | 113 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE), |
112 | board_82599 }, | 114 | board_82599 }, |
113 | 115 | ||
@@ -1618,6 +1620,48 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector) | |||
1618 | } | 1620 | } |
1619 | } | 1621 | } |
1620 | 1622 | ||
1623 | /** | ||
1624 | * ixgbe_check_overtemp_task - worker thread to check over tempurature | ||
1625 | * @work: pointer to work_struct containing our data | ||
1626 | **/ | ||
1627 | static void ixgbe_check_overtemp_task(struct work_struct *work) | ||
1628 | { | ||
1629 | struct ixgbe_adapter *adapter = container_of(work, | ||
1630 | struct ixgbe_adapter, | ||
1631 | check_overtemp_task); | ||
1632 | struct ixgbe_hw *hw = &adapter->hw; | ||
1633 | u32 eicr = adapter->interrupt_event; | ||
1634 | |||
1635 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) { | ||
1636 | switch (hw->device_id) { | ||
1637 | case IXGBE_DEV_ID_82599_T3_LOM: { | ||
1638 | u32 autoneg; | ||
1639 | bool link_up = false; | ||
1640 | |||
1641 | if (hw->mac.ops.check_link) | ||
1642 | hw->mac.ops.check_link(hw, &autoneg, &link_up, false); | ||
1643 | |||
1644 | if (((eicr & IXGBE_EICR_GPI_SDP0) && (!link_up)) || | ||
1645 | (eicr & IXGBE_EICR_LSC)) | ||
1646 | /* Check if this is due to overtemp */ | ||
1647 | if (hw->phy.ops.check_overtemp(hw) == IXGBE_ERR_OVERTEMP) | ||
1648 | break; | ||
1649 | } | ||
1650 | return; | ||
1651 | default: | ||
1652 | if (!(eicr & IXGBE_EICR_GPI_SDP0)) | ||
1653 | return; | ||
1654 | break; | ||
1655 | } | ||
1656 | DPRINTK(DRV, ERR, "Network adapter has been stopped because it " | ||
1657 | "has over heated. Restart the computer. If the problem " | ||
1658 | "persists, power off the system and replace the " | ||
1659 | "adapter\n"); | ||
1660 | /* write to clear the interrupt */ | ||
1661 | IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); | ||
1662 | } | ||
1663 | } | ||
1664 | |||
1621 | static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr) | 1665 | static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr) |
1622 | { | 1666 | { |
1623 | struct ixgbe_hw *hw = &adapter->hw; | 1667 | struct ixgbe_hw *hw = &adapter->hw; |
@@ -1689,6 +1733,10 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data) | |||
1689 | 1733 | ||
1690 | if (hw->mac.type == ixgbe_mac_82599EB) { | 1734 | if (hw->mac.type == ixgbe_mac_82599EB) { |
1691 | ixgbe_check_sfp_event(adapter, eicr); | 1735 | ixgbe_check_sfp_event(adapter, eicr); |
1736 | adapter->interrupt_event = eicr; | ||
1737 | if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) && | ||
1738 | ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) | ||
1739 | schedule_work(&adapter->check_overtemp_task); | ||
1692 | 1740 | ||
1693 | /* Handle Flow Director Full threshold interrupt */ | 1741 | /* Handle Flow Director Full threshold interrupt */ |
1694 | if (eicr & IXGBE_EICR_FLOW_DIR) { | 1742 | if (eicr & IXGBE_EICR_FLOW_DIR) { |
@@ -2190,6 +2238,8 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | |||
2190 | u32 mask; | 2238 | u32 mask; |
2191 | 2239 | ||
2192 | mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); | 2240 | mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); |
2241 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) | ||
2242 | mask |= IXGBE_EIMS_GPI_SDP0; | ||
2193 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) | 2243 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) |
2194 | mask |= IXGBE_EIMS_GPI_SDP1; | 2244 | mask |= IXGBE_EIMS_GPI_SDP1; |
2195 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | 2245 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) { |
@@ -2250,6 +2300,9 @@ static irqreturn_t ixgbe_intr(int irq, void *data) | |||
2250 | ixgbe_check_sfp_event(adapter, eicr); | 2300 | ixgbe_check_sfp_event(adapter, eicr); |
2251 | 2301 | ||
2252 | ixgbe_check_fan_failure(adapter, eicr); | 2302 | ixgbe_check_fan_failure(adapter, eicr); |
2303 | if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) && | ||
2304 | ((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC))) | ||
2305 | schedule_work(&adapter->check_overtemp_task); | ||
2253 | 2306 | ||
2254 | if (napi_schedule_prep(&(q_vector->napi))) { | 2307 | if (napi_schedule_prep(&(q_vector->napi))) { |
2255 | adapter->tx_ring[0]->total_packets = 0; | 2308 | adapter->tx_ring[0]->total_packets = 0; |
@@ -3265,6 +3318,13 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
3265 | IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); | 3318 | IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); |
3266 | } | 3319 | } |
3267 | 3320 | ||
3321 | /* Enable Thermal over heat sensor interrupt */ | ||
3322 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) { | ||
3323 | gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); | ||
3324 | gpie |= IXGBE_SDP0_GPIEN; | ||
3325 | IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); | ||
3326 | } | ||
3327 | |||
3268 | /* Enable fan failure interrupt if media type is copper */ | 3328 | /* Enable fan failure interrupt if media type is copper */ |
3269 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) { | 3329 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) { |
3270 | gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); | 3330 | gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); |
@@ -3666,6 +3726,9 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3666 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) | 3726 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) |
3667 | cancel_work_sync(&adapter->fdir_reinit_task); | 3727 | cancel_work_sync(&adapter->fdir_reinit_task); |
3668 | 3728 | ||
3729 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) | ||
3730 | cancel_work_sync(&adapter->check_overtemp_task); | ||
3731 | |||
3669 | /* disable transmits in the hardware now that interrupts are off */ | 3732 | /* disable transmits in the hardware now that interrupts are off */ |
3670 | for (i = 0; i < adapter->num_tx_queues; i++) { | 3733 | for (i = 0; i < adapter->num_tx_queues; i++) { |
3671 | j = adapter->tx_ring[i]->reg_idx; | 3734 | j = adapter->tx_ring[i]->reg_idx; |
@@ -4645,6 +4708,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
4645 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; | 4708 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; |
4646 | adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE; | 4709 | adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE; |
4647 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; | 4710 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; |
4711 | if (hw->device_id == IXGBE_DEV_ID_82599_T3_LOM) | ||
4712 | adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE; | ||
4648 | if (dev->features & NETIF_F_NTUPLE) { | 4713 | if (dev->features & NETIF_F_NTUPLE) { |
4649 | /* Flow Director perfect filter enabled */ | 4714 | /* Flow Director perfect filter enabled */ |
4650 | adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | 4715 | adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE; |
@@ -6561,7 +6626,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6561 | } | 6626 | } |
6562 | 6627 | ||
6563 | /* reset_hw fills in the perm_addr as well */ | 6628 | /* reset_hw fills in the perm_addr as well */ |
6629 | hw->phy.reset_if_overtemp = true; | ||
6564 | err = hw->mac.ops.reset_hw(hw); | 6630 | err = hw->mac.ops.reset_hw(hw); |
6631 | hw->phy.reset_if_overtemp = false; | ||
6565 | if (err == IXGBE_ERR_SFP_NOT_PRESENT && | 6632 | if (err == IXGBE_ERR_SFP_NOT_PRESENT && |
6566 | hw->mac.type == ixgbe_mac_82598EB) { | 6633 | hw->mac.type == ixgbe_mac_82598EB) { |
6567 | /* | 6634 | /* |
@@ -6730,6 +6797,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6730 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) | 6797 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) |
6731 | INIT_WORK(&adapter->fdir_reinit_task, ixgbe_fdir_reinit_task); | 6798 | INIT_WORK(&adapter->fdir_reinit_task, ixgbe_fdir_reinit_task); |
6732 | 6799 | ||
6800 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) | ||
6801 | INIT_WORK(&adapter->check_overtemp_task, ixgbe_check_overtemp_task); | ||
6733 | #ifdef CONFIG_IXGBE_DCA | 6802 | #ifdef CONFIG_IXGBE_DCA |
6734 | if (dca_add_requester(&pdev->dev) == 0) { | 6803 | if (dca_add_requester(&pdev->dev) == 0) { |
6735 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; | 6804 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; |