* [PATCH net-next] Revert "net: phy: improve mdiobus_stats_acct"
@ 2026-03-05 16:51 Heiner Kallweit
2026-03-05 17:38 ` Heiner Kallweit
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2026-03-05 16:51 UTC (permalink / raw)
To: Andrew Lunn, Russell King - ARM Linux, Paolo Abeni, David Miller,
Jakub Kicinski, Eric Dumazet
Cc: Marek Szyprowski, netdev@vger.kernel.org
This reverts commit 1afccc5a201ec7c9023370958bae1312369b64da.
As reported by Marek the change causes a warning on non-PREEMPT_RT
32 bit systems.
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/net/phy/mdio_bus.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index cf5ce1ed48c..00d0e4159e9 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -60,17 +60,22 @@ EXPORT_SYMBOL(mdiobus_is_registered_device);
static void mdiobus_stats_acct(struct mdio_bus_stats *stats, bool op, int ret)
{
+ preempt_disable();
u64_stats_update_begin(&stats->syncp);
u64_stats_inc(&stats->transfers);
- if (ret < 0)
+ if (ret < 0) {
u64_stats_inc(&stats->errors);
- else if (op)
+ goto out;
+ }
+
+ if (op)
u64_stats_inc(&stats->reads);
else
u64_stats_inc(&stats->writes);
-
+out:
u64_stats_update_end(&stats->syncp);
+ preempt_enable();
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-05 17:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 16:51 [PATCH net-next] Revert "net: phy: improve mdiobus_stats_acct" Heiner Kallweit
2026-03-05 17:38 ` Heiner Kallweit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox