diff mbox series

[v6,02/11] e1000e: remove convert_art_to_tsc()

Message ID 20240410114828.25581-3-lakshmi.sowjanya.d@intel.com (mailing list archive)
State Superseded
Headers show
Series Add support for Intel PPS Generator | expand

Commit Message

D, Lakshmi Sowjanya April 10, 2024, 11:48 a.m. UTC
From: Thomas Gleixner <tglx@linutronix.de>

Remove convert_art_to_tsc() function call, Pass system clock cycles and
clocksource ID as input to get_device_system_crosststamp().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ptp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Gleixner April 10, 2024, 9:42 p.m. UTC | #1
On Wed, Apr 10 2024 at 17:18, lakshmi.sowjanya.d@intel.com wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> Remove convert_art_to_tsc() function call, Pass system clock cycles and
> clocksource ID as input to get_device_system_crosststamp().

This is wrong as this does not pass anything as input. The function is
called from get_device_system_crosststamp() and the data is passed back
via the system_counterval pointer. It also lacks context.

. Something like this:

   "The core code provides a mechanism to convert the ART base clock to
    the corresponding TSC value without requiring an architecture
    specific function.

    All what is required is to store the ART clocksoure ID and the
    cycles value in the provided system_counterval structure.

    Replace the direct conversion via convert_art_to_tsc() by filling in
    the required data.

    No functional change intended."

Hmm?

Thanks,

        tglx
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index bbcfd529399b..89d57dd911dc 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -124,7 +124,8 @@  static int e1000e_phc_get_syncdevicetime(ktime_t *device,
 	sys_cycles = er32(PLTSTMPH);
 	sys_cycles <<= 32;
 	sys_cycles |= er32(PLTSTMPL);
-	*system = convert_art_to_tsc(sys_cycles);
+	system->cycles = sys_cycles;
+	system->cs_id = CSID_X86_ART;
 
 	return 0;
 }