Skip to contentSkip to conversation

Revert "net: phy: improve mdiobus_stats_acct"

PATCH Applied Heiner Kallweit 2 participants 2 messages Mar 5 – Mar 6

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH v2 1/1 Revert "net: phy: improve mdiobus_stats_acct"

This reverts commit 1afccc5a201ec7c9023370958bae1312369b64da.

As reported by Marek the change causes a warning on non-PREEMPT_RT 32 bit systems.

---
v2:
- add missing SoB

---
 drivers/net/phy/mdio_bus.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/phy/mdio_bus.c +8 -3
index cf5ce1ed48c..00d0e4159e9 100644
@@ -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();
 }
 
 /**
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 5 Mar 2026 18:42:04 +0100 you wrote:

This reverts commit 1afccc5a201ec7c9023370958bae1312369b64da.

As reported by Marek the change causes a warning on non-PREEMPT_RT 32 bit systems.

[...]

Here is the summary with links:
- [v2,net-next] Revert "net: phy: improve mdiobus_stats_acct"

    https://git.kernel.org/netdev/net-next/c/1a9940317c1b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html