[openwrt/openwrt] realtek: return correct error value for phy ops
LEDE Commits
lede-commits at lists.infradead.org
Thu Jan 5 14:12:27 PST 2023
svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/de2dc3feaea7deefcc816fb09167211965fdde9b
commit de2dc3feaea7deefcc816fb09167211965fdde9b
Author: Pascal Ernster <git at hardfalcon.net>
AuthorDate: Tue Jan 3 23:01:11 2023 +0100
realtek: return correct error value for phy ops
A behavioural change was introduced with commit 758c88b96963 ("realtek:
Whitespace and codestyle cleanup") causing rtl838x_read_phy() and
rtl838x_write_phy() to unconditionally return -ETIMEDOUT. As a result,
probing the device during boot fails:
Error setting up netdev, freeing it again.
rtl838x-eth: probe of 1b00a300.ethernet failed with error -5
Fix the bootloop caused by this regression with kernel 5.15 on rtl838x
devices, by properly returning 0 on success.
Tested on a Netgear GS108T v3, a Netgear GS310TP v1, a Zyxel GS1900-8HP
v1 and an HPE 1920-8G.
Fixes: 758c88b969639d0e6b684669d2e54dd1be3102f4 ("realtek: Whitespace and codestyle cleanup")
Tested-by: Stijn Segers <foss at volatilesystems.org>
Tested-by: Jan Hoffmann <jan at 3e8.eu>
Signed-off-by: Pascal Ernster <git at hardfalcon.net>
---
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c
index c1d6b0c554..cbd4543db4 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c
@@ -1832,7 +1832,7 @@ int rtl838x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
timeout:
mutex_unlock(&smi_lock);
- return -ETIMEDOUT;
+ return err;
}
/* Write to a register in a page of the PHY */
@@ -1868,7 +1868,7 @@ int rtl838x_write_phy(u32 port, u32 page, u32 reg, u32 val)
timeout:
mutex_unlock(&smi_lock);
- return -ETIMEDOUT;
+ return err;
}
/* Read an mmd register of a PHY */
More information about the lede-commits
mailing list