mirror of
https://github.com/AuxXxilium/synology-igc.git
synced 2024-11-23 23:11:07 +07:00
igc: Fix suspending when PTM is active
backport from 822f52e7ef
Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
parent
2aa02d0b8f
commit
060f87e623
14
igc_ptp.c
14
igc_ptp.c
@ -562,6 +562,17 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter)
|
||||
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
|
||||
* @adapter: Board private structure
|
||||
@ -579,7 +590,10 @@ void igc_ptp_suspend(struct igc_adapter *adapter)
|
||||
adapter->ptp_tx_skb = NULL;
|
||||
clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);
|
||||
|
||||
if (pci_device_is_present(adapter->pdev)) {
|
||||
igc_ptp_time_save(adapter);
|
||||
igc_ptm_stop(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user