]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: fix race between ndo_get_stats64 and ocelot_check_stats_work
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Aug 2022 13:53:49 +0000 (16:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 04:58:32 +0000 (21:58 -0700)
commit0072cdbfdbec9e77d9047262db0fa6cf3bfdffe3
treea83f952a61fd4eb584e245b02eaa6002b9836bd9
parent6a964213d0d94cf56bb40153c13aad2f1e4a2e1b
net: mscc: ocelot: fix race between ndo_get_stats64 and ocelot_check_stats_work

The 2 methods can run concurrently, and one will change the window of
counters (SYS_STAT_CFG_STAT_VIEW) that the other sees. The fix is
similar to what commit da9c30d74b40 ("net: mscc: ocelot: fix mutex lock
error during ethtool stats read") has done for ethtool -S.

Fixes: 99c1e05296dd ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_net.c