realtek: Use atomic poll for aux-mdio commands
authorSander Vanheule <sander@svanheule.net>
Thu, 16 Jan 2025 12:23:54 +0000 (13:23 +0100)
committerSander Vanheule <sander@svanheule.net>
Thu, 16 Jan 2025 12:56:55 +0000 (13:56 +0100)
commit693c1ea81a314cfa37a60a293568d2e46282b717
tree152be5f58340c76f191804ce5f4155dd398ca83d
parent0a7c8ed9d94930ba062c71df79f63c06eeab4543
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>
target/linux/realtek/patches-6.6/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch