Re: [PATCH net-next v2 6/6] net: dsa: motorcomm: Use safe 64-bit counter reader
From: Andrew Lunn
Date: Mon Sep 07 2026 - 16:33:21 EST
On Sat, Sep 05, 2026 at 12:29:48AM +0800, David Yang wrote:
> 64-bit counter registers are read as two separate 32-bit transactions.
> If the low word wraps from about 0xffffffff to a small value while the
> high word increments between the two transactions, the recombined value
> becomes ((new_high << 32) | old_low), producing a spurious ~4 GiB jump.
>
> Use a safe counter reader for this.
>
> Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew