Re: [PATCH net] net: ti: icssg-prueth: Add lock to stats
From: Simon Horman
Date: Wed Mar 19 2025 - 10:19:10 EST
On Fri, Mar 14, 2025 at 03:57:21PM +0530, MD Danish Anwar wrote:
> Currently the API emac_update_hardware_stats() reads different ICSSG
> stats without any lock protection.
>
> This API gets called by .ndo_get_stats64() which is only under RCU
> protection and nothing else. Add lock to this API so that the reading of
> statistics happens during lock.
>
> Fixes: c1e10d5dc7a1 ("net: ti: icssg-prueth: Add ICSSG Stats")
> Signed-off-by: MD Danish Anwar <danishanwar@xxxxxx>
> ---
> NOTE: This was suggested by Jakub Kicinski <kuba@xxxxxxxxxx> [1] to get
> this as bug fix in net during upstreaming of FW Stats for ICSSG driver
> This patch doesn't depend on [1] and can be applied cleanly on net/main
>
> [1] https://lore.kernel.org/all/20250306165513.541ff46e@xxxxxxxxxx/
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>