]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dlink: add synchronization for stats update
authorMoon Yeounsu <yyyynoom@gmail.com>
Thu, 15 May 2025 07:53:31 +0000 (16:53 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:33 +0000 (11:07 +0100)
commiteff2a34574f5f5b8cd76e0cc47c79733d489c9df
tree47b6e84771eaed4a17d4ce2290445524b151f616
parente9a83fe283f142dcfe55b463df417b402b045d6e
net: dlink: add synchronization for stats update

[ Upstream commit 12889ce926e9a9baf6b83d809ba316af539b89e2 ]

This patch synchronizes code that accesses from both user-space
and IRQ contexts. The `get_stats()` function can be called from both
context.

`dev->stats.tx_errors` and `dev->stats.collisions` are also updated
in the `tx_errors()` function. Therefore, these fields must also be
protected by synchronized.

There is no code that accessses `dev->stats.tx_errors` between the
previous and updated lines, so the updating point can be moved.

Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>
Link: https://patch.msgid.link/20250515075333.48290-1-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/dlink/dl2k.c
drivers/net/ethernet/dlink/dl2k.h