diff options
author | Noor Azura Ahmad Tarmizi <[email protected]> | 2023-01-11 13:02:00 +0800 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2023-01-11 21:10:06 -0800 |
commit | ae9dcb91c6069e20b3b9505d79cbc89fd6e086f5 (patch) | |
tree | 7b77b76fca32d0cae2a8cc4e2f0df308ae517ab1 | |
parent | eb25df88287b37a63b9fb9ca6d333af2f504407a (diff) |
net: stmmac: add aux timestamps fifo clearance wait
Add timeout polling wait for auxiliary timestamps snapshot FIFO clear bit
(ATSFC) to clear. This is to ensure no residue fifo value is being read
erroneously.
Fixes: f4da56529da6 ("net: stmmac: Add support for external trigger timestamping")
Cc: <[email protected]> # 5.10.x
Signed-off-by: Noor Azura Ahmad Tarmizi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c index fc06ddeac0d5..b4388ca8d211 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -210,7 +210,10 @@ static int stmmac_enable(struct ptp_clock_info *ptp, } writel(acr_value, ptpaddr + PTP_ACR); mutex_unlock(&priv->aux_ts_lock); - ret = 0; + /* wait for auxts fifo clear to finish */ + ret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value, + !(acr_value & PTP_ACR_ATSFC), + 10, 10000); break; default: |