Skip to content

Commit ae9dcb9

Browse files
AzuraTarmiziIntelkuba-moo
authored andcommitted
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: f4da565 ("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]>
1 parent eb25df8 commit ae9dcb9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
210210
}
211211
writel(acr_value, ptpaddr + PTP_ACR);
212212
mutex_unlock(&priv->aux_ts_lock);
213-
ret = 0;
213+
/* wait for auxts fifo clear to finish */
214+
ret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value,
215+
!(acr_value & PTP_ACR_ATSFC),
216+
10, 10000);
214217
break;
215218

216219
default:

0 commit comments

Comments
 (0)