From a1df5ed4a8263820dcbbc08a086aa3acd18185a2 Mon Sep 17 00:00:00 2001 From: Narayan Reddy Date: Thu, 7 Nov 2019 14:29:48 +0530 Subject: [PATCH] nvethernet: change required clock freq to 250MHz increase required clock frequency from 62.5MHz to 250MHz for better PTP time stamping accuracy. Switching to 250 MHz will increase the accuracy of the PTP timestamp by ~22ns Bug 200565215 Change-Id: I17fb6b4ea19bcb78b9b085d45b7dd9c816bcc5c9 Signed-off-by: Narayan Reddy Reviewed-on: https://git-master.nvidia.com/r/2234046 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/net/ethernet/nvidia/nvethernet/ptp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ptp.c b/drivers/net/ethernet/nvidia/nvethernet/ptp.c index 8a570f99..8b85a1f7 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ptp.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ptp.c @@ -197,7 +197,7 @@ static int ether_set_time(struct ptp_clock_info *ptp, static struct ptp_clock_info ether_ptp_clock_ops = { .owner = THIS_MODULE, .name = "ether_ptp_clk", - .max_adj = OSI_ETHER_SYSCLOCK, + .max_adj = OSI_PTP_REQ_CLK_FREQ, .n_alarm = 0, .n_ext_ts = 0, .n_per_out = 0, @@ -428,8 +428,9 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata, osi_ptp_configuration(osi_core, OSI_DISABLE); ether_config_slot_function(pdata, OSI_DISABLE); } else { - /* Store SYS CLOCK */ - osi_core->ptp_config.ptp_clock = OSI_ETHER_SYSCLOCK; + /* Store default PTP clock frequency, so that we + * can make use of it for coarse correction */ + osi_core->ptp_config.ptp_clock = pdata->ptp_ref_clock_speed; /* initialize system time */ getnstimeofday(&now); /* Store sec and nsec */