diff options
author | Wong Vee Khee <vee.khee.wong@linux.intel.com> | 2022-07-14 15:54:27 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-18 11:14:35 +0100 |
commit | 76c16d3e19446deea98b7883f261758b96b8781a (patch) | |
tree | f5b09a47646973bb384a1086ba86a5319222b579 /drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | |
parent | tcp/udp: Make early_demux back namespacified. (diff) | |
download | linux-dev-76c16d3e19446deea98b7883f261758b96b8781a.tar.xz linux-dev-76c16d3e19446deea98b7883f261758b96b8781a.zip |
net: stmmac: switch to use interrupt for hw crosstimestamping
Using current implementation of polling mode, there is high chances we
will hit into timeout error when running phc2sys. Hence, update the
implementation of hardware crosstimestamping to use the MAC interrupt
service routine instead of polling for TSIS bit in the MAC Timestamp
Interrupt Status register to be set.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index 92d32940aff0..764832f4dae1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -179,6 +179,11 @@ static void timestamp_interrupt(struct stmmac_priv *priv) u64 ptp_time; int i; + if (priv->plat->int_snapshot_en) { + wake_up(&priv->tstamp_busy_wait); + return; + } + tsync_int = readl(priv->ioaddr + GMAC_INT_STATUS) & GMAC_INT_TSIE; if (!tsync_int) |