From def2367077573b56f9fc4f824e5c0377a3a4175a Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 16 Oct 2023 02:45:46 +0000
Subject: [PATCH] 修改DO2-DO4初始为低
---
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