Commit a5136f76 authored by Sasha Neftin's avatar Sasha Neftin Committed by Jeff Kirsher

igc: Complete to commit Add basic skeleton for PTP

commit 5f295805 ("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: default avatarSasha Neftin <sasha.neftin@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 56321222
...@@ -556,6 +556,7 @@ int igc_erase_filter(struct igc_adapter *adapter, ...@@ -556,6 +556,7 @@ int igc_erase_filter(struct igc_adapter *adapter,
void igc_ptp_init(struct igc_adapter *adapter); void igc_ptp_init(struct igc_adapter *adapter);
void igc_ptp_reset(struct igc_adapter *adapter); void igc_ptp_reset(struct igc_adapter *adapter);
void igc_ptp_suspend(struct igc_adapter *adapter);
void igc_ptp_stop(struct igc_adapter *adapter); void igc_ptp_stop(struct igc_adapter *adapter);
void igc_ptp_rx_rgtstamp(struct igc_q_vector *q_vector, struct sk_buff *skb); void igc_ptp_rx_rgtstamp(struct igc_q_vector *q_vector, struct sk_buff *skb);
void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va, void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,
......
...@@ -4899,6 +4899,8 @@ static int __igc_shutdown(struct pci_dev *pdev, bool *enable_wake, ...@@ -4899,6 +4899,8 @@ static int __igc_shutdown(struct pci_dev *pdev, bool *enable_wake,
if (netif_running(netdev)) if (netif_running(netdev))
__igc_close(netdev, true); __igc_close(netdev, true);
igc_ptp_suspend(adapter);
igc_clear_interrupt_scheme(adapter); igc_clear_interrupt_scheme(adapter);
rtnl_unlock(); rtnl_unlock();
......
...@@ -641,7 +641,7 @@ void igc_ptp_init(struct igc_adapter *adapter) ...@@ -641,7 +641,7 @@ void igc_ptp_init(struct igc_adapter *adapter)
* This function stops the overflow check work and PTP Tx timestamp work, and * This function stops the overflow check work and PTP Tx timestamp work, and
* will prepare the device for OS suspend. * will prepare the device for OS suspend.
*/ */
static void igc_ptp_suspend(struct igc_adapter *adapter) void igc_ptp_suspend(struct igc_adapter *adapter)
{ {
if (!(adapter->ptp_flags & IGC_PTP_ENABLED)) if (!(adapter->ptp_flags & IGC_PTP_ENABLED))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment