igc: Fix suspending when PTM is active

backport from 822f52e7ef

Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
Jim Ma 2022-11-03 12:39:35 +00:00
parent 2aa02d0b8f
commit 060f87e623

View File

@ -562,6 +562,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
@ -579,7 +590,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);
igc_ptp_time_save(adapter); if (pci_device_is_present(adapter->pdev)) {
igc_ptp_time_save(adapter);
igc_ptm_stop(adapter);
}
} }
/** /**