* [Intel-wired-lan] [PATCH v1] igc: Complete to commit Add basic skeleton for PTP
@ 2020-01-20 6:33 Sasha Neftin
2020-01-21 21:59 ` Vinicius Costa Gomes
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Neftin @ 2020-01-20 6:33 UTC (permalink / raw)
To: intel-wired-lan
commit 5f2958052c58 ("igc: Add basic skeleton for PTP")
Add ptp suspend method to the igc_shutdown.
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
---
drivers/net/ethernet/intel/igc/igc.h | 1 +
drivers/net/ethernet/intel/igc/igc_main.c | 2 ++
drivers/net/ethernet/intel/igc/igc_ptp.c | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 5d38d0faeced..3db1568c88db 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -556,6 +556,7 @@ int igc_erase_filter(struct igc_adapter *adapter,
void igc_ptp_init(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_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,
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 08ed9796d088..fa72460e255a 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -4899,6 +4899,8 @@ static int __igc_shutdown(struct pci_dev *pdev, bool *enable_wake,
if (netif_running(netdev))
__igc_close(netdev, true);
+ igc_ptp_suspend(adapter);
+
igc_clear_interrupt_scheme(adapter);
rtnl_unlock();
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 389a969fe5f4..f99c514ad0f4 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -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
* 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))
return;
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Intel-wired-lan] [PATCH v1] igc: Complete to commit Add basic skeleton for PTP
2020-01-20 6:33 [Intel-wired-lan] [PATCH v1] igc: Complete to commit Add basic skeleton for PTP Sasha Neftin
@ 2020-01-21 21:59 ` Vinicius Costa Gomes
2020-01-22 6:28 ` Neftin, Sasha
0 siblings, 1 reply; 3+ messages in thread
From: Vinicius Costa Gomes @ 2020-01-21 21:59 UTC (permalink / raw)
To: intel-wired-lan
Hi Sasha,
Sasha Neftin <sasha.neftin@intel.com> writes:
> commit 5f2958052c58 ("igc: Add basic skeleton for PTP")
> Add ptp suspend method to the igc_shutdown.
I guess the commit message could use a bit more text, something like
this:
"Commit 5f2958052c58 ("igc: Add basic skeleton for PTP") added basic
support for PTP, what's missing is support for suspending. By cleaning
the runtime storage for timestamp this avoids a possible invalid memory
access when the system comes back from suspend."
Apart from that, the code looks good.
Is this the only thing missing for suspend/resume to work? If so, that's
cool :-)
Cheers,
--
Vinicius
^ permalink raw reply [flat|nested] 3+ messages in thread* [Intel-wired-lan] [PATCH v1] igc: Complete to commit Add basic skeleton for PTP
2020-01-21 21:59 ` Vinicius Costa Gomes
@ 2020-01-22 6:28 ` Neftin, Sasha
0 siblings, 0 replies; 3+ messages in thread
From: Neftin, Sasha @ 2020-01-22 6:28 UTC (permalink / raw)
To: intel-wired-lan
On 1/21/2020 23:59, Vinicius Costa Gomes wrote:
> Hi Sasha,
>
> Sasha Neftin <sasha.neftin@intel.com> writes:
>
>> commit 5f2958052c58 ("igc: Add basic skeleton for PTP")
>> Add ptp suspend method to the igc_shutdown.
>
> I guess the commit message could use a bit more text, something like
> this:
>
> "Commit 5f2958052c58 ("igc: Add basic skeleton for PTP") added basic
> support for PTP, what's missing is support for suspending. By cleaning
> the runtime storage for timestamp this avoids a possible invalid memory
> access when the system comes back from suspend."
Thanks Vinicius - I will extend the commit message in v2.
>
> Apart from that, the code looks good.
>
> Is this the only thing missing for suspend/resume to work? If so, that's
> cool :-)
>
>
> Cheers,
> --
> Vinicius
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-22 6:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-20 6:33 [Intel-wired-lan] [PATCH v1] igc: Complete to commit Add basic skeleton for PTP Sasha Neftin
2020-01-21 21:59 ` Vinicius Costa Gomes
2020-01-22 6:28 ` Neftin, Sasha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox