realtek: rtl838x: Fix ethernet polling timeout on probe
authorOlliver Schinagl <oliver@schinagl.nl>
Wed, 31 Aug 2022 15:20:52 +0000 (17:20 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 14 Sep 2022 16:23:06 +0000 (18:23 +0200)
Due to an oversight we accidentally inverted the timeout check. This
patch corrects this.

Fixes: 9cec4a0ea45b ("realtek: Use built-in functionality for timeout loop")
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
[ wrap poll_timeout line to 80 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c

index f56901d707f2883830de2529b4f4e4da40a77f89..76b6cde7be8c0eaa3e4851f201568ed4b3438b6c 100644 (file)
@@ -1809,7 +1809,8 @@ int rtl838x_smi_wait_op(int timeout)
        int ret = 0;
        u32 val;
 
-       ret = readx_poll_timeout(sw_r32, RTL838X_SMI_ACCESS_PHY_CTRL_1, val, val & 0x1, 20, timeout);
+       ret = readx_poll_timeout(sw_r32, RTL838X_SMI_ACCESS_PHY_CTRL_1,
+                                val, !(val & 0x1), 20, timeout);
        if (ret)
                pr_err("%s: timeout\n", __func__);