kernel: igc: sync with upstream updates
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
5a3532c584
commit
5765e132a0
@ -4942,6 +4942,9 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
|
|||||||
u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);
|
u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);
|
||||||
u32 value = 0;
|
u32 value = 0;
|
||||||
|
|
||||||
|
if (IGC_REMOVED(hw_addr))
|
||||||
|
return ~value;
|
||||||
|
|
||||||
value = readl(&hw_addr[reg]);
|
value = readl(&hw_addr[reg]);
|
||||||
|
|
||||||
/* reads should not return all F's */
|
/* reads should not return all F's */
|
||||||
|
|||||||
@ -540,6 +540,17 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter)
|
|||||||
igc_ptp_write_i225(adapter, &ts);
|
igc_ptp_write_i225(adapter, &ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void igc_ptm_stop(struct igc_adapter *adapter)
|
||||||
|
{
|
||||||
|
struct igc_hw *hw = &adapter->hw;
|
||||||
|
u32 ctrl;
|
||||||
|
|
||||||
|
ctrl = rd32(IGC_PTM_CTRL);
|
||||||
|
ctrl &= ~IGC_PTM_CTRL_EN;
|
||||||
|
|
||||||
|
wr32(IGC_PTM_CTRL, ctrl);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* igc_ptp_suspend - Disable PTP work items and prepare for suspend
|
* igc_ptp_suspend - Disable PTP work items and prepare for suspend
|
||||||
* @adapter: Board private structure
|
* @adapter: Board private structure
|
||||||
@ -557,8 +568,10 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
|
|||||||
adapter->ptp_tx_skb = NULL;
|
adapter->ptp_tx_skb = NULL;
|
||||||
clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
|
clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
|
||||||
|
|
||||||
if (pci_device_is_present(adapter->pdev))
|
if (pci_device_is_present(adapter->pdev)) {
|
||||||
igc_ptp_time_save(adapter);
|
igc_ptp_time_save(adapter);
|
||||||
|
igc_ptm_stop(adapter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -252,7 +252,8 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg);
|
|||||||
#define wr32(reg, val) \
|
#define wr32(reg, val) \
|
||||||
do { \
|
do { \
|
||||||
u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \
|
u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \
|
||||||
writel((val), &hw_addr[(reg)]); \
|
if (!IGC_REMOVED(hw_addr)) \
|
||||||
|
writel((val), &hw_addr[(reg)]); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define rd32(reg) (igc_rd32(hw, reg))
|
#define rd32(reg) (igc_rd32(hw, reg))
|
||||||
@ -264,4 +265,6 @@ do { \
|
|||||||
|
|
||||||
#define array_rd32(reg, offset) (igc_rd32(hw, (reg) + ((offset) << 2)))
|
#define array_rd32(reg, offset) (igc_rd32(hw, (reg) + ((offset) << 2)))
|
||||||
|
|
||||||
|
#define IGC_REMOVED(h) unlikely(!(h))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user