2023-01-09 15:46:18

by Noor Azura Ahmad Tarmizi

[permalink] [raw]
Subject: [PATCH net 1/1] 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.

Cc: <[email protected]> # 5.10.x
Signed-off-by: Noor Azura Ahmad Tarmizi <[email protected]>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

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:
--
2.17.1


2023-01-10 10:47:48

by Paolo Abeni

[permalink] [raw]
Subject: Re: [PATCH net 1/1] net: stmmac: add aux timestamps fifo clearance wait

On Mon, 2023-01-09 at 23:15 +0800, Noor Azura Ahmad Tarmizi wrote:
> 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.
>
> Cc: <[email protected]> # 5.10.x
> Signed-off-by: Noor Azura Ahmad Tarmizi <[email protected]>

Please post a new revision of this patch including a suitable 'Fixes'
tag, thanks!

Paolo

2023-01-11 04:22:36

by Noor Azura Ahmad Tarmizi

[permalink] [raw]
Subject: Re: [PATCH net 1/1] net: stmmac: add aux timestamps fifo clearance wait

On Tue, Jan 10, 2023 at 11:27:47AM +0100, Paolo Abeni wrote:
> On Mon, 2023-01-09 at 23:15 +0800, Noor Azura Ahmad Tarmizi wrote:
> > 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.
> >
> > Cc: <[email protected]> # 5.10.x
> > Signed-off-by: Noor Azura Ahmad Tarmizi <[email protected]>
>
> Please post a new revision of this patch including a suitable 'Fixes'
> tag, thanks!
>
> Paolo
>

Ok Paolo, sorry i missed that out. Will send out v2 ASAP.
Thanks!

Azura