summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSander Vanheule2025-01-16 12:23:54 +0000
committerSander Vanheule2025-02-22 11:32:34 +0000
commite8e5725cee97e7d3fe3f7c7c7bfe16e983b5c480 (patch)
tree482af045fcd7086434e0a02acf49da5dda9c9233
parentb98d99261a423b8c7bce3189162ddc9104f5d043 (diff)
downloadopenwrt-e8e5725cee97e7d3fe3f7c7c7bfe16e983b5c480.tar.gz
realtek: Use atomic poll for aux-mdio commands
regmap_read_poll_timeout() relies on usleep_range() to time the polling loop. With the current, rather large, scheduling interval, a short usleep_range() may take a lot longer than expected, causing performance issues. Switch the driver over to using regmap_read_poll_timeout_atomic(), which uses udelay() to time the polling loop. For comparision, the 'ethtool -m <dev>' command is about 10 times faster with the atomic variant. Using 'perf -r10 ethtool -m lan25': - Driver using regmap_read_poll_timeout(): 2.0117 +- 0.0118 seconds time elapsed ( +- 0.58% ) - Driver using regmap_read_poll_timeout_atomic(): 0.1674 +- 0.0250 seconds time elapsed ( +- 14.95% ) Signed-off-by: Sander Vanheule <sander@svanheule.net> (cherry picked from commit 693c1ea81a314cfa37a60a293568d2e46282b717)
-rw-r--r--target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch b/target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch
index 430f8f5c00..a58cc496ef 100644
--- a/target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch
+++ b/target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch
@@ -103,7 +103,7 @@ Signed-off-by: Sander Vanheule <sander@svanheule.net>
+ if (err)
+ return err;
+
-+ err = regmap_read_poll_timeout(ctrl->map, ctrl->cmd_reg, run, (run != cmd), 3, 100);
++ err = regmap_read_poll_timeout_atomic(ctrl->map, ctrl->cmd_reg, run, (run != cmd), 3, 100);
+
+ if ((run & ~mask_volatile) != (cmd & ~mask_volatile)) {
+ dev_err(ctrl->dev, "Command modified. Is offloading still active?");