From 629d66146c85dd818cd97187de580e041c6b7671 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 25 Oct 2023 07:17:50 +0000
Subject: [PATCH] add build kerneldeb

---
 kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index 08a058e..e1fbd7c 100644
--- a/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -159,20 +159,15 @@
 
 static void get_systime(void __iomem *ioaddr, u64 *systime)
 {
-	u64 ns, sec0, sec1;
+	u64 ns;
 
-	/* Get the TSS value */
-	sec1 = readl_relaxed(ioaddr + PTP_STSR);
-	do {
-		sec0 = sec1;
-		/* Get the TSSS value */
-		ns = readl_relaxed(ioaddr + PTP_STNSR);
-		/* Get the TSS value */
-		sec1 = readl_relaxed(ioaddr + PTP_STSR);
-	} while (sec0 != sec1);
+	/* Get the TSSS value */
+	ns = readl(ioaddr + PTP_STNSR);
+	/* Get the TSS and convert sec time value to nanosecond */
+	ns += readl(ioaddr + PTP_STSR) * 1000000000ULL;
 
 	if (systime)
-		*systime = ns + (sec1 * 1000000000ULL);
+		*systime = ns;
 }
 
 const struct stmmac_hwtimestamp stmmac_ptp = {

--
Gitblit v1.6.2