Skip to content

Commit a5136f7

Browse files
aneftinJeff Kirsher
authored andcommitted
igc: Complete to commit Add basic skeleton for PTP
commit 5f29580 ("igc: Add basic skeleton for PTP") added basic support for PTP, what's missing is support for suspending. Legacy power management has been added. Now we can add the suspend method to the igc_shutdown. By cleaning the runtime storage for timestamp this avoids a possible invalid memory access when the system comes back from suspend state. Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 5632122 commit a5136f7

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/net/ethernet/intel/igc/igc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ int igc_erase_filter(struct igc_adapter *adapter,
556556

557557
void igc_ptp_init(struct igc_adapter *adapter);
558558
void igc_ptp_reset(struct igc_adapter *adapter);
559+
void igc_ptp_suspend(struct igc_adapter *adapter);
559560
void igc_ptp_stop(struct igc_adapter *adapter);
560561
void igc_ptp_rx_rgtstamp(struct igc_q_vector *q_vector, struct sk_buff *skb);
561562
void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4899,6 +4899,8 @@ static int __igc_shutdown(struct pci_dev *pdev, bool *enable_wake,
48994899
if (netif_running(netdev))
49004900
__igc_close(netdev, true);
49014901

4902+
igc_ptp_suspend(adapter);
4903+
49024904
igc_clear_interrupt_scheme(adapter);
49034905
rtnl_unlock();
49044906

drivers/net/ethernet/intel/igc/igc_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ void igc_ptp_init(struct igc_adapter *adapter)
641641
* This function stops the overflow check work and PTP Tx timestamp work, and
642642
* will prepare the device for OS suspend.
643643
*/
644-
static void igc_ptp_suspend(struct igc_adapter *adapter)
644+
void igc_ptp_suspend(struct igc_adapter *adapter)
645645
{
646646
if (!(adapter->ptp_flags & IGC_PTP_ENABLED))
647647
return;

0 commit comments

Comments
 (0)