realtek: clean up rtl838x MDIO busy wait loop
authorJan Hoffmann <jan@3e8.eu>
Sat, 23 Jul 2022 20:53:16 +0000 (22:53 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 28 Jul 2022 12:08:51 +0000 (14:08 +0200)
commit81e3017609be0ffa85c7ba430734e47519186481
tree22f1f771160d94aa5a23dfd82c5fddc79b3bad8c
parentb6a0d50b7fd1ed8d62cc017d9fc5b83f436d3156
realtek: clean up rtl838x MDIO busy wait loop

Don't use udelay to allow other kernel tasks to execute if the kernel
has been built without preemption. Also determine the timeout based on
jiffies instead of loop iterations.

This is especially important on devices containing a watchdog with a
short timeout. Without this change, the watchdog is not serviced during
PHY patching which can take multiple seconds.

Tested-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c