aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files-5.10/drivers/net
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2022-08-29 08:23:49 +0200
committerSander Vanheule <sander@svanheule.net>2022-08-29 08:32:42 +0200
commit9a7f17e11f5d2c808b465bd439c7aa11c2c8dfbf (patch)
tree4fcccda0550fcb84f566d02b12a752d6918030b1 /target/linux/realtek/files-5.10/drivers/net
parentf8c87aa2d27ab405f284dd4357377ab5c893a345 (diff)
downloadupstream-9a7f17e11f5d2c808b465bd439c7aa11c2c8dfbf.tar.gz
upstream-9a7f17e11f5d2c808b465bd439c7aa11c2c8dfbf.tar.bz2
upstream-9a7f17e11f5d2c808b465bd439c7aa11c2c8dfbf.zip
realtek: ignore disabled switch ports
When marking a switch port as disabled in the device tree, by using 'status = "disabled";', the switch driver fails on boot, causing a restart: CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 802c3064, ra == 8022b4b4 [ ... ] Call Trace: [<802c3064>] strlen+0x0/0x2c [<8022b4b4>] start_creating.part.0+0x78/0x194 [<8022bd3c>] debugfs_create_dir+0x44/0x1c0 [<80396dfc>] rtl838x_dbgfs_port_init+0x54/0x258 [<80397508>] rtl838x_dbgfs_init+0xe0/0x56c This is caused by the DSA subsystem (mostly) ignoring the port, while rtl83xx_mdio_probe() still extracts some details on this disabled port from the device tree, resulting in the usage of a NULL pointer where a port name is expected. By not probing ignoring disabled ports, no attempt is made to create a debugfs directory later. The device then boots as expected without the disabled port. Signed-off-by: Sander Vanheule <sander@svanheule.net>
Diffstat (limited to 'target/linux/realtek/files-5.10/drivers/net')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
index fd6019ec62..2a60f61c95 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
@@ -317,6 +317,9 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
phy_interface_t interface;
u32 led_set;
+ if (!of_device_is_available(dn))
+ continue;
+
if (of_property_read_u32(dn, "reg", &pn))
continue;