Thread (13 messages) 13 messages, 2 authors, 22d ago

Re: [PATCH net-next v2 6/6] net: dsa: motorcomm: Use safe 64-bit counter reader

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-09-07 20:33:07
Also in: lkml

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@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help