Re: [PATCH net-next v3 2/2] net: dsa: yt921x: Protect MIB stats with a lock

From: Qingfang Deng
Date: Sun Jan 04 2026 - 21:52:06 EST


Hi David,

On Mon, 5 Jan 2026 10:09:01 +0800, David Yang wrote:
> 64bit variables might not be atomic on 32bit architectures, thus cannot
> be made lock-free. Protect them with a spin lock since get_stats64()
> cannot sleep.

Synchronizing both reads and updates with a spin lock is an overkill.
See include/linux/u64_stats_sync.h for a better approach.

-- Qingfang