Kernel 6.1 for realtek target: debugging & testing needed

@svanheule has a staging tree for the realtek target on 6.1. Mind you, it's very fresh and still rough around the edges, but as always it needs brave souls who want to help debug and test :slightly_smiling_face:.

You will need this patch if you'd like to rebase the staging tree on latest main - commit e430815f5a3f introduced a few changes that break the realtek 6.1 patch set for now.

I have only rtl838x and rtl930x to test, status at this point is not so rosey:

  • rtl838x: GS1900-8HP v1 boots, but no network. Boot log here. With e430815f5a3f reverted, network functionality is (partially?) restored, as I suspected.
  • rtl930x: XGS1250-12 throws a kernel panic at boot - log.

Any help is welcome, make sure you got serial handy (and prefer TFTP boot over flashing :sunglasses:).

4 Likes

In the meantime I can confirm reverting e430815f5a3f at least partially restores network functionality on rtl838x. I'm seeing the link going down and coming up again when unplugging/plugging in a network cable, but no ping e.g..

2 Likes

@Ansuel @daniel Was wondering if you could offer some insight here. One of the issues we're running into is the commit below backported PHY package MMD patches from 6.8, which breaks the 800-net-mdio-support-hardware-assisted-indirect-access.patch we've been carrying in the realtek tree, which Daniel wrote.

Git chokes on the first two hunks, which modify two functions in drivers/net/phy/phy-core.c - __phy_read_mmd and __phy_write_mmd - which, from what I can tell, were rewritten completely with the 6.8 backport, from what I can tell. (You can tell I'm out of my depth :rofl:.)

I suppose the other parts of the patch are still relevant, and need to be adapted to the 6.8 backport, but I'm not sure to what extent - I can read a bit of C, but fully understanding the code and writing it is something else altogether. I did make a modest start with rebasing the patch on top of the 6.8 backports, here:

https://paste.debian.net/1306759/

Git behaviour with the patch as it is in the staging tree now:

Applying /var/media/data/code/lede/main/target/linux/realtek/patches-6.1/800-net-mdio-support-hardware-assisted-indirect-access.patch using plaintext:
patching file drivers/net/phy/mdio_bus.c
patching file drivers/net/phy/phy-core.c
Hunk #1 FAILED at 554.
Hunk #2 FAILED at 610.
Hunk #3 succeeded at 957 (offset 136 lines).
Hunk #4 succeeded at 972 (offset 136 lines).
Hunk #5 succeeded at 1080 (offset 136 lines).
Hunk #6 succeeded at 1113 (offset 136 lines).
2 out of 6 hunks FAILED -- saving rejects to file drivers/net/phy/phy-core.c.rej
patching file include/linux/mdio.h
patching file include/linux/phy.h
Hunk #2 succeeded at 439 (offset 1 line).
Hunk #3 succeeded at 1943 with fuzz 2 (offset 18 lines).
Hunk #4 succeeded at 2043 with fuzz 2 (offset 36 lines).
patching file include/uapi/linux/mii.h
Patch failed! Please fix /var/media/data/code/lede/main/target/linux/realtek/patches-6.1/800-net-mdio-support-hardware-assisted-indirect-access.patch!

Any pointers are appreciated.

the package ops can be greatly simplified as we switched to base + offset implementation just as it's done here... aka that part needs to be reworked.

for the read_mmd and write_mmd it's ok...

Alright, thanks.

any progress on this? I'd love to test, but no ethernet is a show stopper....

1 Like

Alas. I tried my hand again at the 800-net-mdio-support-hardware-assisted-indirect-access.patch to adapt it to the MMD changes - you can find the last attempt here, but that led to compilation errors, see here. My basic C reading skills are clearly falling short.

I had some time on my hands to try and dig into this a month ago, when my wife just gave birth, but with 'two under two' (that's a thing apparently) around now, I can't spend any time at this anymore - and I won't be able to for months to come, unfortunately. Not that more of my time would fix it at this point, it needs someone with more C chops than mine to get to the bottom of this.

I took a stab at this yesterday. Based it on the staging tree from @svanheule merged onto current master, and added the patch you linked to in the first post in this thread ( https://paste.debian.net/1306759/ ). It can be simplified like @Ansuel said, but that's a lower priority right now. It does the job.

Two small fixes on top of that, and 6.1 mostly works. Don't know how much time I will have to fooow up, so I pushed my current WiP here:

What really broke things for me was

This resulted in

[    4.097071] net eth0: phylink: error: empty supported_interfaces

Adding workarounds for both the ethernet and DSA driver, whether the latter is a backported fix from mainline, was enough to makes the image boot and mostly work. And the DSA fix should be taken care of already if we end up going directly to 6.6.

There are still issues, though:

  1. packets from the SoC to untagged ports does not work
  2. the ethernet driver enables interrupts before it's ready, occasionally crashing on boot
  3. reboot on panic fails

I haven't verified that an of these are new with 6.1. I suspect the aren't.

Sending traffic from the switch SoC to untagged port isn't something I normally do. My management VLAN is always tagged. And switching between ports works fine, with or without tagging. Receiving untagged traffic also works. It's only packets from the switch to an untagged VLAN never going out. The big problem with that (and why I even noticed) is that it breaks the default OpenWrt configuration, where all ports are untagged in VLAN 1.

Haven't looked closer at the second problem yet. The switch boots fine most of the time, but sometimes it fails with:

[    1.223021] Found SoC ID: 8380: RTL8380, family 8380
[    1.228856] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 8052d6c0
[    1.240860] Oops[#1]:
[    1.243433] CPU: 0 PID: 1 Comm: swapper Not tainted 6.1.81 #0
[    1.249862] $ 0   : 00000000 00000001 00000000 8200bf30
[    1.255738] $ 4   : 824884d8 00000000 80940000 04000040
[    1.261608] $ 8   : 80930000 78cfa80e a71c5dc7 ffffffea
[    1.267487] $12   : 00000058 82019b44 00000058 00000000
[    1.273356] $16   : 824884d8 00000000 0000012c 8200bf2f
[    1.279225] $20   : 80940000 ffff8b4b 80920000 8200bf38
[    1.285095] $24   : 808b7900 803de0f8                  
[    1.290965] $28   : 82018000 8200bee8 811736f8 8052d6c0
[    1.296834] Hi    : 00005fff
[    1.300046] Lo    : 2e48f657
[    1.303257] epc   : 00000000 0x0
[    1.306877] ra    : 8052d6c0 __napi_poll+0x3c/0x1c0
[    1.312377] Status: 10107c03 KERNEL EXL IE 
[    1.317074] Cause : 50808008 (ExcCode 02)
[    1.321554] BadVA : 00000000
[    1.324765] PrId  : 00019070 (MIPS 4KEc)
[    1.329149] Modules linked in:
[    1.332563] Process swapper (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000)
[    1.341417] Stack : 80930bb4 0000001f 8091bd68 00000019 000d48a4 80168250 80a136fc 824884d8
[    1.350804]         809427c0 0000012c 8200bf30 8052da80 00010000 8016ba3c 00000000 8012505c
[    1.360194]         00000024 80143f00 8200bf30 8200bf30 8200bf38 8200bf38 811736fc 81173704
[    1.369584]         00000008 00000003 00000004 0000000c 00000100 00000020 3fffffff 8072a53c
[    1.378964]         a5a5a5a5 82007d80 00000005 00000001 0000001f 811a0000 8091c884 808b66f0
[    1.388354]         ...
[    1.391104] Call Trace:
[    1.391115] 
[    1.395495] [<80168250>] handle_irq_event+0x94/0xc4
[    1.400980] [<8052da80>] net_rx_action+0x12c/0x24c
[    1.406364] [<8016ba3c>] handle_level_irq+0xb4/0x1bc
[    1.411943] [<8012505c>] mm_init+0x1dc/0x1fc
[    1.416747] [<80143f00>] alloc_workqueue+0x27c/0x464
[    1.422340] [<8072a53c>] __do_softirq+0x10c/0x2ac
[    1.427624] [<803de328>] plat_irq_dispatch+0x68/0x98
[    1.433207] [<80101c58>] handle_int+0x138/0x144
[    1.438300] 
[    1.439967] Code: (Bad address in epc)
[    1.439967] 
[    1.445828] 
[    1.447616] ---[ end trace 0000000000000000 ]---
[    1.452911] Kernel panic - not syncing: Fatal exception in interrupt
[    3.459723] Reboot failed -- System halted

This MIGHT be related to bootloader networking. I've only seen it when tftp booting. If so, then I guess it's a minor issue after all.

And that log also shows the third issue. Which could be a big problem if you can't power cycle easily. I am testing this remotely, but on a GS108Tv3 being powered by a GS1900-10HP. So I can simply use ubus to toggle power. Not everyone will be that lucky, I guess. I believe it's better to have a boot loop than a halt like that.

boot log running OpenWrt with v6.1 kernel on NetGear GS108Tv3
BOOT Loader Version 1.0.0.2 (2018-08-31 17:05:26 UTC)

Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
CPU  : 500 MHz
RAM  : 128 MB
FLASH: 32 MB

Model: GS108Tv3
MAC  : BC:A5:11:9F:E1:23

Hit Esc key to stop autoboot:  1  0 
## Booting image from partition ... 0
## Booting kernel from Legacy Image at 81000000 ...
   Version:      9.9.9.9
   Created:      2024-03-17   8:52:59 UTC
   Data Size:    2592783 Bytes = 2.5 MB
   Checksum ... OK
   Uncompressing ... OK

Starting kernel ...

[    0.000000] Linux version 6.1.81 (bjorn@canardo) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r25565+14-dea42f67ab06) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Sun Mar 17 08:52:59 2024
[    0.000000] RTL838X model is 83806800
[    0.000000] SoC Type: RTL8380
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019070 (MIPS 4KEc)
[    0.000000] MIPS: machine is Netgear GS108T v3
[    0.000000] earlycon: ns16550a0 at MMIO 0x18002000 (options '115200n8')
[    0.000000] printk: bootconsole [ns16550a0] enabled
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
[    0.000000] Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: earlycon
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 119804K/131072K available (6317K kernel code, 642K rwdata, 1524K rodata, 1236K init, 210K bss, 11268K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] rtl83xx-clk: initialized, CPU 500 MHz, MEM 300 MHz (8 Bit DDR3), LXB 200 MHz
[    0.000000] clocksource: realtek_otto_timer: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 38225208801 ns
[    0.000006] sched_clock: 28 bits at 3125kHz, resolution 320ns, wraps every 42949672800ns
[    0.009310] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
[    0.136032] pid_max: default: 32768 minimum: 301
[    0.143608] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.151894] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.169653] cblist_init_generic: Setting adjustable number of callback queues.
[    0.177696] cblist_init_generic: Setting shift to 0 and lim to 1.
[    0.197349] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.208418] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.216455] pinctrl core: initialized pinctrl subsystem
[    0.225365] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.260080] rtl83xx-clk clock-controller: rate setting enabled, CPU 300-625 MHz, MEM 300-300 MHz, LXB 200-200 MHz, OVERCLOCK AT OWN RISK
[    0.278581] clocksource: Switched to clocksource realtek_otto_timer
[    0.290068] NET: Registered PF_INET protocol family
[    0.296175] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.306295] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.315912] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.324680] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.333370] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.341418] TCP: Hash tables configured (established 1024 bind 1024)
[    0.349242] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.356610] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.365270] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.383953] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.405460] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.412155] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.430041] pinctrl-single 1b001000.pinmux: 32 pins, size 4
[    0.437378] pinctrl-single 1b00a000.pinmux: 32 pins, size 4
[    0.446668] Probing RTL8231 GPIOs
[    0.450533] rtl8231_init called, MDIO bus ID: 31
[    0.458950] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.468410] printk: console [ttyS0] disabled
[    0.473475] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 31, base_baud = 12500000) is a 16550A
[    0.483432] printk: console [ttyS0] enabled
[    0.483432] printk: console [ttyS0] enabled
[    0.492902] printk: bootconsole [early0] disabled
[    0.492902] printk: bootconsole [early0] disabled
[    0.503539] printk: bootconsole [ns16550a0] disabled
[    0.503539] printk: bootconsole [ns16550a0] disabled
[    0.646127] brd: module loaded
[    0.662901] spi-nor spi0.0: mx25l25635e (32768 Kbytes)
[    0.669139] 7 fixed-partitions partitions found on MTD device spi0.0
[    0.676346] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    0.683530] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    0.691155] Creating 7 MTD partitions on "spi0.0":
[    0.696670] 0x000000000000-0x0000000e0000 : "u-boot"
[    0.711090] 0x0000000e0000-0x0000000f0000 : "u-boot-env"
[    0.720544] 0x0000000f0000-0x000000100000 : "u-boot-env2"
[    0.735278] 0x000000100000-0x000000200000 : "jffs"
[    0.744151] 0x000000200000-0x000000300000 : "jffs2"
[    0.758360] 0x000000300000-0x000001180000 : "firmware"
[    0.767907] 2 uimage-fw partitions found on MTD device firmware
[    0.774723] Creating 2 MTD partitions on "firmware":
[    0.780534] 0x000000000000-0x000000280000 : "kernel"
[    0.794685] 0x000000280000-0x000000e80000 : "rootfs"
[    0.803539] mtd: setting mtd7 (rootfs) as root device
[    0.809463] 1 squashfs-split partitions found on MTD device rootfs
[    0.816530] 0x000000490000-0x000000e80000 : "rootfs_data"
[    0.831053] 0x000001180000-0x000002000000 : "runtime2"
[    0.865514] Probing RTL838X eth device pdev: 8209a800, dev: 8209a810
[    0.923115] Found SoC ID: 8380: RTL8380, family 8380
[    0.928968] rtl8380_init_mac
[    0.932268] Using MAC 000080002db48084
[    1.059434] Realtek RTL8218B (internal) mdio-bus:08: Detected internal RTL8218B
[    1.067658] Firmware loaded. Size 1184, magic: 83808380
[    1.889641] Realtek RTL8218B (internal) mdio-bus:08: ERROR: Port 8 not ready for patch.
[    1.898721] Realtek RTL8218B (internal): probe of mdio-bus:08 failed with error -1
[    1.948068] i2c_dev: i2c /dev entries driver
[    1.963696] NET: Registered PF_INET6 protocol family
[    2.006888] Segment Routing with IPv6
[    2.011391] In-situ OAM (IOAM) with IPv6
[    2.016225] NET: Registered PF_PACKET protocol family
[    2.022926] 8021q: 802.1Q VLAN Support v1.8
[    2.077743] Realtek RTL8218B (internal) rtl838x slave mii-0:08: Detected internal RTL8218B
[    2.087149] Firmware loaded. Size 1184, magic: 83808380
[    2.910002] Realtek RTL8218B (internal) rtl838x slave mii-0:08: ERROR: Port 8 not ready for patch.
[    2.920146] Realtek RTL8218B (internal): probe of rtl838x slave mii-0:08 failed with error -1
[    2.971491] Realtek RTL8380 SERDES rtl838x slave mii-0:18: Detected internal RTL8380 SERDES
[    2.981007] Firmware loaded. Size 1184, magic: 83808380
[    2.986927] SDS power down value: 33
[    3.015048] PLL control register: efffffff
[    3.019789] SDS power down value now: 3f
[    3.024205] Configuration of SERDES done
[    3.060456] In rtl83xx_vlan_setup
[    3.064227] UNKNOWN_MC_PMASK: 000000001fffffff
[    3.069335] VLAN profile 0: L2 learning: 1, UNKN L2MC FLD PMSK 511, 		UNKN IPMC FLD PMSK 511, UNKN IPv6MC FLD PMSK: 511
[    4.098616] rtl83xx_enable_phy_polling:             ff00
[    5.138934] rtl83xx-switch switch@1b000000: configuring for fixed/internal link mode
[    5.148413] rtl83xx-switch switch@1b000000: Link is Up - 1Gbps/Full - flow control off
[    5.158923] rtl83xx-switch switch@1b000000 lan1 (uninitialized): PHY [mdio-bus:08] driver [Generic PHY] (irq=POLL)
[    5.177330] rtl83xx-switch switch@1b000000 lan2 (uninitialized): PHY [mdio-bus:09] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.194374] rtl83xx-switch switch@1b000000 lan3 (uninitialized): PHY [mdio-bus:0a] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.215301] rtl83xx-switch switch@1b000000 lan4 (uninitialized): PHY [mdio-bus:0b] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.232543] rtl83xx-switch switch@1b000000 lan5 (uninitialized): PHY [mdio-bus:0c] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.253213] rtl83xx-switch switch@1b000000 lan6 (uninitialized): PHY [mdio-bus:0d] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.271354] rtl83xx-switch switch@1b000000 lan7 (uninitialized): PHY [mdio-bus:0e] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.291272] rtl83xx-switch switch@1b000000 lan8 (uninitialized): PHY [mdio-bus:0f] driver [Realtek RTL8218B (internal)] (irq=POLL)
[    5.308249] device eth0 entered promiscuous mode
[    5.313887] DSA: tree 0 setup
[    5.317350] LINK state irq: 20
[    5.320973] In rtl83xx_setup_qos
[    5.324616] Setting up RTL838X QoS
[    5.328414] RTL838X_PRI_SEL_TBL_CTRL(i): 00033112
[    5.333770] Current Intprio2queue setting: 00000000
[    5.339343] QM_PKT2CPU_INTPRI_MAP: 00fac688
[    5.344369] rtl838x_dbgfs_init called
[    5.350056] rtl83xx_fib_event_work_do: FIB4 default rule failed
[    5.356730] rtl83xx_fib_event_work_do: FIB4 default rule failed
[    5.383062] VFS: Mounted root (squashfs filesystem) readonly on device 31:7.
[    5.404773] Freeing unused kernel image (initmem) memory: 1236K
[    5.411565] This architecture does not have kernel memory protection.
[    5.418904] Run /sbin/init as init process
[    5.423518]   with arguments:
[    5.426844]     /sbin/init
[    5.429969]   with environment:
[    5.433515]     HOME=/
[    5.436153]     TERM=linux
[    6.163754] init: Console is alive
[    6.169006] init: - watchdog -
[    6.297123] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.314173] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.333688] init: - preinit -
[   10.318720] random: crng init done
[   12.741602] RESETTING 8380, CPU_PORT 28
[   12.946774] rtl838x-eth 1b00a300.ethernet eth0: configuring for fixed/internal link mode
[   12.955834] In rtl838x_mac_config, mode 1
[   12.963248] rtl83xx-switch switch@1b000000 lan1: configuring for phy/internal link mode
[   12.972554] rtl838x-eth 1b00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   12.982279] 8021q: adding VLAN 0 to HW filter on device lan1
[   12.989306] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   12.996437] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   13.004058] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   13.028920] rtl83xx-switch switch@1b000000 lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   13.038530] IPv6: ADDRCONF(NETDEV_CHANGE): lan1: link becomes ready
[   13.069040] rtl83xx_fib_event_work_do: FIB4 failed
[   13.074462] rtl83xx_fib_event_work_do: FIB4 failed
[   13.098832] rtl83xx_fib_event_work_do: FIB4 failed
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   14.498715] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   15.569174] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[   15.577359] jffs2_build_filesystem(): unlocking the mtd device... 
[   15.577431] done.
[   15.586615] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   62.727230] done.
[   62.737923] jffs2: notice: (549) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   62.759109] mount_root: overlay filesystem has not been fully initialized yet
[   62.772281] mount_root: switching to jffs2 overlay
[   62.783048] overlayfs: upper fs does not support tmpfile.
- config restore -
[   63.556595] urandom-seed: Seed file not found (/etc/urandom.seed)
[   63.701748] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   63.707566] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   63.728738] rtl83xx_fib4_del: no such gateway: 0.0.0.0
[   63.741278] rtl83xx-switch switch@1b000000 lan1: Link is Down
[   63.758814] RTL8380 Link change: status: 1, ports 100
[   63.764566] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   63.802847] procd: - early -
[   63.806975] procd: - watchdog -
[   64.676598] procd: - watchdog -
[   64.681570] procd: - ubus -
[   64.870372] procd: - init -
Please press Enter to activate this console.
[   66.824608] kmodloader: loading kernel modules from /etc/modules.d/*
[   66.850794] kmodloader: done loading kernel modules from /etc/modules.d/*
[   69.235733] urngd: v1.0.2 started.
[   75.272234] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   82.059593] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   82.218801] in rtl838x_eth_stop
[   82.222518] rtl838x-eth 1b00a300.ethernet eth0: Link is Down
[   82.771580] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   82.779142] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   82.786544] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   82.794090] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   84.197103] Using MAC 0000bca5119fe123
[   84.219054] RESETTING 8380, CPU_PORT 28
[   84.424229] rtl838x-eth 1b00a300.ethernet eth0: configuring for fixed/internal link mode
[   84.433289] In rtl838x_mac_config, mode 1
[   84.438317] rtl838x-eth 1b00a300.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   84.458904] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   84.466067] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   84.473706] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   84.847811] rtl83xx-switch switch@1b000000 lan1: configuring for phy/internal link mode
[   84.892592] 8021q: adding VLAN 0 to HW filter on device lan1
[   84.920247] switch: port 1(lan1) entered blocking state
[   84.926147] switch: port 1(lan1) entered disabled state
[   84.933106] device lan1 entered promiscuous mode
[   85.060226] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   85.089625] Not offloading default route for now
[   85.097926] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   85.629084] rtl83xx-switch switch@1b000000 lan6: configuring for phy/internal link mode
[   85.663240] 8021q: adding VLAN 0 to HW filter on device lan6
[   85.741717] switch: port 2(lan6) entered blocking state
[   85.747628] switch: port 2(lan6) entered disabled state
[   85.769004] device lan6 entered promiscuous mode
[   85.779602] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   85.787100] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   86.009645] rtl83xx-switch switch@1b000000 lan7: configuring for phy/internal link mode
[   86.031151] 8021q: adding VLAN 0 to HW filter on device lan7
[   86.101515] switch: port 3(lan7) entered blocking state
[   86.107430] switch: port 3(lan7) entered disabled state
[   86.135305] device lan7 entered promiscuous mode
[   86.459074] rtl83xx-switch switch@1b000000 lan8: configuring for phy/internal link mode
[   86.489104] 8021q: adding VLAN 0 to HW filter on device lan8
[   86.570949] switch: port 4(lan8) entered blocking state
[   86.576850] switch: port 4(lan8) entered disabled state
[   86.606768] device lan8 entered promiscuous mode
[   87.036224] rtl83xx-switch switch@1b000000 lan2: configuring for phy/internal link mode
[   87.083424] 8021q: adding VLAN 0 to HW filter on device lan2
[   87.157448] switch: port 5(lan2) entered blocking state
[   87.163472] switch: port 5(lan2) entered disabled state
[   87.203370] device lan2 entered promiscuous mode
[   87.371177] RTL8380 Link change: status: 1, ports 400
[   87.399551] RTL8380 Link change: status: 1, ports 100
[   87.538691] rtl83xx-switch switch@1b000000 lan3: configuring for phy/internal link mode
[   87.559081] 8021q: adding VLAN 0 to HW filter on device lan3
[   87.672941] switch: port 6(lan3) entered blocking state
[   87.678964] switch: port 6(lan3) entered disabled state
[   87.685743] device lan3 entered promiscuous mode
[   87.958928] rtl83xx-switch switch@1b000000 lan4: configuring for phy/internal link mode
[   87.979004] 8021q: adding VLAN 0 to HW filter on device lan4
[   88.052665] switch: port 7(lan4) entered blocking state
[   88.058699] switch: port 7(lan4) entered disabled state
[   88.065535] device lan4 entered promiscuous mode
[   88.161077] RTL8380 Link change: status: 1, ports 1000
[   88.201704] rtl83xx-switch switch@1b000000 lan5: configuring for phy/internal link mode
[   88.214287] 8021q: adding VLAN 0 to HW filter on device lan5
[   88.230710] rtl83xx-switch switch@1b000000 lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   88.266958] switch: port 8(lan5) entered blocking state
[   88.272974] switch: port 8(lan5) entered disabled state
[   88.279982] device lan5 entered promiscuous mode
[   88.287922] switch: port 1(lan1) entered blocking state
[   88.293988] switch: port 1(lan1) entered forwarding state
[   88.305942] IPv6: ADDRCONF(NETDEV_CHANGE): switch: link becomes ready
[   88.316994] IPv6: ADDRCONF(NETDEV_CHANGE): switch.203: link becomes ready
[   88.348096] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   90.018833] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   90.026315] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
[   90.558284] RTL8380 Link change: status: 1, ports 400
[   90.824384] rtl83xx-switch switch@1b000000 lan3: Link is Up - 1Gbps/Full - flow control rx/tx
[   90.834278] switch: port 6(lan3) entered blocking state
[   90.840314] switch: port 6(lan3) entered forwarding state
[   91.117874] RTL8380 Link change: status: 1, ports 1000
[   91.388421] rtl83xx-switch switch@1b000000 lan5: Link is Up - 100Mbps/Full - flow control off
[   91.418806] switch: port 8(lan5) entered blocking state
[   91.424711] switch: port 8(lan5) entered forwarding state



BusyBox v1.36.1 (2024-03-16 12:39:02 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r25565+16-dea42f67ab06
 -----------------------------------------------------
root@gs108tv3:/#

Note that the "ERROR: Port 8 not ready for patch." is normal on this switch, also with a v5.15 kernel. So I'm ignoring it.

2 Likes

Thanks @bmork, much appreciated!

Edit: i had the below for the EEE patch, I suppose that's wrong then? (Hadn't shared it since that hadn't popped up yet when I first shared my first attempt.)

From 4f29d7f40beb8509bb9752bfb6e277aa3f961fed Mon Sep 17 00:00:00 2001
From: Stijn Segers <foss@volatilesystems.org>
Date: Fri, 16 Feb 2024 21:49:39 +0100
Subject: [PATCH 2/2] realtek: fix rtl838x PHY EEE support patch

Commit d40756563c46 ("kernel: backport phylink changes from mainline
Linux") backported phylink changes from 6.4, which broke the realtek
704-drivers-net-phy-eee-support-for-rtl838x.patch.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
---
 .../704-drivers-net-phy-eee-support-for-rtl838x.patch           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/patches-6.1/704-drivers-net-phy-eee-support-for-rtl838x.patch b/target/linux/realtek/patches-6.1/704-drivers-net-phy-eee-support-for-rtl838x.patch
index 31c37d95ad..199a88f412 100644
--- a/target/linux/realtek/patches-6.1/704-drivers-net-phy-eee-support-for-rtl838x.patch
+++ b/target/linux/realtek/patches-6.1/704-drivers-net-phy-eee-support-for-rtl838x.patch
@@ -30,7 +30,7 @@ Submitted-by: John Crispin <john@phrozen.org>
 +				pl->phydev->drv->set_port(pl->phydev, kset->base.port);
 +			}
 +		}
- 		return phy_ethtool_ksettings_set(pl->phydev, kset);
+ 		return phy_ethtool_ksettings_set(pl->phydev, &phy_kset);
  	}
  
 @@ -2548,8 +2553,11 @@ int phylink_ethtool_get_eee(struct phyli
-- 
2.43.0

I've loaded a standard OpenWrt config with 5.15 on a GS1900-8, but that seems to be working fine w.r.t. out-going traffic. So this might be a regression after all (although I can understand the assumption that it wouldn't be...)

I'm not familiar with the other two issues. Since the crash happens before the watchdog is enabled, you can't rely on that one to reboot the switch either :confused:

I can confirm my GS1900-8HP v1 boots 6.1 successfully.

6.1 boots on RTL9302 as well (XGS1250-12) but it's complaining about missing DT nodes for the Serdes, then fails to connect to the PHYs.

Trouble seems to start here:

[    7.863444] REALTEK RTL9300 SERDES rtl838x slave mii-0:1b: Detected internal RTL9300 Serdes
[    7.872815] REALTEK RTL9300 SERDES rtl838x slave mii-0:1b: No DT node.
[    7.880119] REALTEK RTL9300 SERDES: probe of rtl838x slave mii-0:1b failed with error -22
[    7.911959] REALTEK RTL9300 SERDES rtl838x slave mii-0:3f: Detected internal RTL9300 Serdes
[    7.921335] REALTEK RTL9300 SERDES rtl838x slave mii-0:3f: No DT node.
[    7.928628] REALTEK RTL9300 SERDES: probe of rtl838x slave mii-0:3f failed with error -22

Then further down, repeated for all ports:

[    9.199034] rtl83xx-switch switch@1b000000: configuring for fixed/internal link mode
[    9.207719] rtl93xx_phylink_mac_config port 28, mode 1, phy-mode: internal, speed 10000, link 0
[    9.217738] rtl83xx-switch switch@1b000000 lan1 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.237389] rtl83xx-switch switch@1b000000 lan1 (uninitialized): failed to connect to PHY: -EINVAL
[    9.247405] rtl83xx-switch switch@1b000000 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0

Full boot log below.

Boot log XGS1250-12 OpenWrt 6.1 kernel
RTL9300# # bootm
## Booting kernel from Legacy Image at 84f00000 ...
   Image Name:   MIPS OpenWrt Linux-6.1.81
   Created:      2024-03-17  17:55:14 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    7678051 Bytes = 7.3 MB
   Load Address: 80100000
   Entry Point:  80100000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 6.1.81 (5800X@crunchbot) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r22918+31-91c75c3124) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Sun Mar 17 17:55:14 2024
[    0.000000] RTL838X model is 0
[    0.000000] RTL839X model is 0
[    0.000000] RTL93XX model is 93021001
[    0.000000] SoC Type: RTL9302B
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019555 (MIPS 34Kc)
[    0.000000] MIPS: machine is Zyxel XGS1250-12 Switch
[    0.000000] earlycon: ns16550a0 at MMIO 0x18002000 (options '115200n8')
[    0.000000] printk: bootconsole [ns16550a0] enabled
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: earlycon
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00063f56
[    0.000000] Readback ErrCtl register=00063f56
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 107188K/131072K available (5774K kernel code, 617K rwdata, 576K rodata, 15360K init, 212K bss, 23884K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] Failed to get CPU clock: -2
[    0.000000] CPU frequency from device tree: 800MHz
[    0.000000] clocksource: realtek_otto_timer: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 38225208801 ns
[    0.000001] sched_clock: 28 bits at 3125kHz, resolution 320ns, wraps every 42949672800ns
[    0.008968] Calibrating delay loop... 531.66 BogoMIPS (lpj=2658304)
[    0.065702] pid_max: default: 32768 minimum: 301
[    0.071747] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.079778] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.091616] cblist_init_generic: Setting adjustable number of callback queues.
[    0.099548] cblist_init_generic: Setting shift to 0 and lim to 1.
[    0.111220] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.122010] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.129617] pinctrl core: initialized pinctrl subsystem
[    0.136428] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.143547] thermal_sys: Registered thermal governor 'step_wise'
[    0.156025] clocksource: Switched to clocksource realtek_otto_timer
[    0.171192] NET: Registered PF_INET protocol family
[    0.176870] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.185643] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.194958] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.203459] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.211867] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.219613] TCP: Hash tables configured (established 1024 bind 1024)
[    0.226753] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.233917] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.241969] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.326294] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.339322] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.345703] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.398862] pinctrl-single 1b00cc00.pinmux: 32 pins, size 4
[    0.406675] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.414735] printk: console [ttyS0] disabled
[    0.419554] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 30, base_baud = 10937500) is a 16550A
[    0.429225] printk: console [ttyS0] enabled
[    0.429225] printk: console [ttyS0] enabled
[    0.438567] printk: bootconsole [early0] disabled
[    0.438567] printk: bootconsole [early0] disabled
[    0.449058] printk: bootconsole [ns16550a0] disabled
[    0.449058] printk: bootconsole [ns16550a0] disabled
[    0.556665] brd: module loaded
[    0.562496] spi-nor spi0.0: mx25l12805d (16384 Kbytes)
[    0.568340] 7 fixed-partitions partitions found on MTD device spi0.0
[    0.575439] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    0.582471] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
[    0.589735] Creating 7 MTD partitions on "spi0.0":
[    0.595084] 0x000000000000-0x0000000e0000 : "u-boot"
[    0.646514] 0x0000000e0000-0x0000000f0000 : "u-boot-env"
[    0.656575] 0x0000000f0000-0x000000100000 : "u-boot-env2"
[    0.676443] 0x000000100000-0x000000200000 : "jffs"
[    0.683041] 0x000000200000-0x000000300000 : "jffs2"
[    0.696538] 0x000000300000-0x000000fe0000 : "firmware"
[    0.716835] 2 uimage-fw partitions found on MTD device firmware
[    0.723446] Creating 2 MTD partitions on "firmware":
[    0.729056] 0x000000000000-0x0000002c0000 : "kernel"
[    0.746620] 0x0000002c0000-0x000000ce0000 : "rootfs"
[    0.766381] mtd: setting mtd7 (rootfs) as root device
[    0.772076] 1 squashfs-split partitions found on MTD device rootfs
[    0.779016] 0x000000650000-0x000000ce0000 : "rootfs_data"
[    0.806712] 0x000000fe0000-0x000001000000 : "log"
[    0.823755] Probing RTL838X eth device pdev: 8209d800, dev: 8209d810
[    0.850328] Found SoC ID: 9302: RTL9302B, family 9300
[    0.856113] Using MAC 0000800035148070
[    0.860334] set sds port 0 to 2
[    0.863859] set sds port 24 to 6
[    0.867489] set sds port 25 to 7
[    0.871085] set sds port 26 to 8
[    0.874665] set sds port 27 to 9
[    0.879015] c45_mask: 000e0000
[    1.314478] thermal thermal_zone0: Failed to set trips: -34
[    1.468790] thermal thermal_zone1: Failed to set trips: -34
[    1.623102] thermal thermal_zone2: Failed to set trips: -34
[    1.659150] REALTEK RTL9300 SERDES mdio-bus:1b: Detected internal RTL9300 Serdes
[    1.667452] rtl9300_configure_serdes: Port 27, SerDes is 9
[    1.677577] rtl9300_configure_serdes CMU BAND is 16
[    1.683002] rtl9300_sds_rst 31
[    1.706399] rtl9300_configure_serdes PATCHING SerDes 9
[    1.713146] rtl9300_phy_enable_10g_1g 1gbit phy: 00001140
[    1.719185] rtl9300_phy_enable_10g_1g 1gbit phy enabled: 00001140
[    1.726992] rtl9300_phy_enable_10g_1g 10gbit phy: 00002040
[    1.733093] rtl9300_phy_enable_10g_1g 10gbit phy after: 00002040
[    1.740788] rtl9300_phy_enable_10g_1g set medium: 00000002
[    1.746918] rtl9300_phy_enable_10g_1g set medium after: 00000002
[    1.773571] rtl9300_configure_serdes: Configuring RTL9300 SERDES 9, mode 1a
[    1.783337] rtl9300_serdes_mac_link_config: registers before 00000000 00001403
[    1.793397] rtl9300_serdes_mac_link_config: registers after 00000000 00001403
[    1.821327] rtl9300_force_sds_mode: SDS: 9, mode 0
[    1.826692] rtl9300_force_sds_mode --------------------- serdes 9 forcing to 1f ...
[    1.838231] rtl9300_force_sds_mode: SDS: 9, mode 28
[    1.843658] rtl9300_force_sds_mode --------------------- serdes 9 forcing to 1a ...
[    6.562107] rtl9300_force_sds_mode --------------------- serdes 9 forced to 1a DONE
[    6.570664] start_1.1.1 initial value for sds 9
[    6.603688] end_1.1.1 --
[    6.606532] start_1.1.2 Load DFE init. value
[    6.612277] end_1.1.2
[    6.614790] start_1.1.3 disable LEQ training,enable DFE clock
[    6.627202] end_1.1.3 --
[    6.630020] start_1.1.4 offset cali setting
[    6.635659] end_1.1.4
[    6.638200] start_1.1.5 LEQ and DFE setting
[    6.649862] end_1.1.5
[    6.659390] start_1.2.1 ForegroundOffsetCal_Manual
[    6.666744] end_1.2.1
[    6.674734] start_1.2.3 Foreground Calibration
[    6.688224] rtl9300_do_rx_calibration_2_3: fgcal_gray: 16, fgcal_binary 16
[    6.696897] rtl9300_do_rx_calibration_2_3: end_1.2.3
[    6.702422] start_1.4.1
[    6.924008] end_1.4.1
[    6.926756] start_1.4.2
[    6.935271] vth_set_bin = 0
[    6.938010] vth_set_bin = 2
[    6.942113] Vth Maunal = 1
[    7.054020] Tap0 Sign : +
[    7.057063] tap0_coef_bin = 16
[    7.060974] tap0 manual = 1
[    7.067374] end_1.4.2
[    7.070482] start_1.5.2
[    7.146887] end_1.5.2
[    7.234714] i2c_dev: i2c /dev entries driver
[    7.242234] rtl9300_i2c_probe probing I2C adapter
[    7.247560] i2c-rtl9300 1b00036c.i2c-rtl9300: SCL speed 100000, mode is 0
[    7.255120] rtl9300_i2c_probe scl_num 0
[    7.259412] rtl9300_i2c_probe sda_num 1
[    7.266896] NET: Registered PF_INET6 protocol family
[    7.286753] Segment Routing with IPv6
[    7.290939] In-situ OAM (IOAM) with IPv6
[    7.295496] NET: Registered PF_PACKET protocol family
[    7.301599] 8021q: 802.1Q VLAN Support v1.8
[    7.308728] sfp sfp-p12: Host maximum power 1.0W
[    7.863444] REALTEK RTL9300 SERDES rtl838x slave mii-0:1b: Detected internal RTL9300 Serdes
[    7.872815] REALTEK RTL9300 SERDES rtl838x slave mii-0:1b: No DT node.
[    7.880119] REALTEK RTL9300 SERDES: probe of rtl838x slave mii-0:1b failed with error -22
[    7.911959] REALTEK RTL9300 SERDES rtl838x slave mii-0:3f: Detected internal RTL9300 Serdes
[    7.921335] REALTEK RTL9300 SERDES rtl838x slave mii-0:3f: No DT node.
[    7.928628] REALTEK RTL9300 SERDES: probe of rtl838x slave mii-0:3f failed with error -22
[    7.956568] rtl93xx_setup called
[    7.960216] In rtl83xx_vlan_setup
[    7.963889] In rtl930x_vlan_profile_setup
[    7.968396] In rtl930x_vlan_profile_setup
[    7.972855] UNKNOWN_MC_PMASK: 000000001fffffff
[    7.977812] VLAN 0: L2 learn: 0; Unknown MC PMasks: L2 1fffffff, IPv4 1fffffff, IPv6: 1fffffff
[    7.977832]   Routing enabled: IPv4 UC y, IPv6 UC y, IPv4 MC y, IPv6 MC y
[    7.994981]   Bridge enabled: IPv4 MC n, IPv6 MC n,
[    8.000431] VLAN profile 0: raw 00033000 00000000 1fffffff 1fffffff 1fffffff
[    9.056033] rtl83xx_enable_phy_polling:          f0000ff
[    9.061959] rtl930x_pie_init
[    9.065367] rtl930x_led_init called
[    9.069369] rtl930x_led_init led_set configuration invalid skipping over this set
[    9.077750] rtl930x_led_init bb00cc00: 01052659
[    9.082791] rtl930x_led_init bb00cc04: aaaa5555
[    9.087855] rtl930x_led_init bb00cc08: 007faaaa
[    9.092893] rtl930x_led_init bb00cc0c: 00000000
[    9.097951] rtl930x_led_init bb00cc10: 00000000
[    9.102988] rtl930x_led_init bb00cc14: 00000000
[    9.108042] rtl930x_led_init bb00cc18: 0a200a01
[    9.113080] rtl930x_led_init bb00cc1c: 0a0b0a28
[    9.118136] rtl930x_led_init bb00cc20: 0a820a0b
[    9.123175] rtl930x_led_init bb00cc24: 00000000
[    9.128230] rtl930x_led_init bb00cc28: 0a200b80
[    9.133269] rtl930x_led_init bb00cc2c: 00000000
[    9.138323] rtl930x_led_init bb00cc30: 00950000
[    9.143362] rtl930x_led_init bb00cc34: 00000000
[    9.148417] rtl930x_led_init bb00cc38: 00950000
[    9.153456] rtl930x_led_init bb00cc3c: 0f0000ff
[    9.158511] rtl930x_led_init bb00cc40: 0f0000ff
[    9.163550] rtl930x_led_init bb00cc44: 0f0000ff
[    9.168604] rtl930x_led_init bb00cc48: 00000000
[    9.173644] rtl930x_led_init bb00cc4c: 00000000
[    9.178699] rtl930x_led_init bb00cc50: 00000000
[    9.183737] rtl930x_led_init bb00cc54: 00000000
[    9.188792] rtl930x_led_init bb00cc58: 00000000
[    9.193831] rtl930x_led_init bb00cc5c: 00000000
[    9.199034] rtl83xx-switch switch@1b000000: configuring for fixed/internal link mode
[    9.207719] rtl93xx_phylink_mac_config port 28, mode 1, phy-mode: internal, speed 10000, link 0
[    9.217738] rtl83xx-switch switch@1b000000 lan1 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.237389] rtl83xx-switch switch@1b000000 lan1 (uninitialized): failed to connect to PHY: -EINVAL
[    9.247405] rtl83xx-switch switch@1b000000 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
[    9.259898] rtl83xx-switch switch@1b000000 lan2 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.279550] rtl83xx-switch switch@1b000000 lan2 (uninitialized): failed to connect to PHY: -EINVAL
[    9.289561] rtl83xx-switch switch@1b000000 lan2 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 1
[    9.302059] rtl83xx-switch switch@1b000000 lan3 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.321712] rtl83xx-switch switch@1b000000 lan3 (uninitialized): failed to connect to PHY: -EINVAL
[    9.331732] rtl83xx-switch switch@1b000000 lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 2
[    9.344220] rtl83xx-switch switch@1b000000 lan4 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.363872] rtl83xx-switch switch@1b000000 lan4 (uninitialized): failed to connect to PHY: -EINVAL
[    9.373883] rtl83xx-switch switch@1b000000 lan4 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 3
[    9.386382] rtl83xx-switch switch@1b000000 lan5 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.406037] rtl83xx-switch switch@1b000000 lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    9.416048] rtl83xx-switch switch@1b000000 lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4
[    9.428542] rtl83xx-switch switch@1b000000 lan6 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.448193] rtl83xx-switch switch@1b000000 lan6 (uninitialized): failed to connect to PHY: -EINVAL
[    9.458205] rtl83xx-switch switch@1b000000 lan6 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5
[    9.470703] rtl83xx-switch switch@1b000000 lan7 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.490355] rtl83xx-switch switch@1b000000 lan7 (uninitialized): failed to connect to PHY: -EINVAL
[    9.500371] rtl83xx-switch switch@1b000000 lan7 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 6
[    9.512864] rtl83xx-switch switch@1b000000 lan8 (uninitialized): validation of xgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    9.532516] rtl83xx-switch switch@1b000000 lan8 (uninitialized): failed to connect to PHY: -EINVAL
[    9.542536] rtl83xx-switch switch@1b000000 lan8 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 7
[    9.562031] rtl93xx_phylink_mac_config port 28, mode 1, phy-mode: internal, speed 10000, link 1
[    9.571788] rtl83xx-switch switch@1b000000: Link is Up - 10Gbps/Full - flow control off
[    9.581615] rtl83xx-switch switch@1b000000 lan9 (uninitialized): validation of usxgmii with support 00000000,00018000,000e706c and advertisement 00000000,00018000,000e706c failed: -EINVAL
[    9.613890] rtl83xx-switch switch@1b000000 lan9 (uninitialized): failed to connect to PHY: -EINVAL
[    9.623912] rtl83xx-switch switch@1b000000 lan9 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 24
[    9.646329] rtl83xx-switch switch@1b000000 lan10 (uninitialized): validation of usxgmii with support 00000000,00018000,000e706c and advertisement 00000000,00018000,000e706c failed: -EINVAL
[    9.677880] rtl83xx-switch switch@1b000000 lan10 (uninitialized): failed to connect to PHY: -EINVAL
[    9.688002] rtl83xx-switch switch@1b000000 lan10 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 25
[    9.712491] rtl83xx-switch switch@1b000000 lan11 (uninitialized): validation of usxgmii with support 00000000,00018000,000e706c and advertisement 00000000,00018000,000e706c failed: -EINVAL
[    9.744042] rtl83xx-switch switch@1b000000 lan11 (uninitialized): failed to connect to PHY: -EINVAL
[    9.754165] rtl83xx-switch switch@1b000000 lan11 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 26
[    9.766474] rtl83xx-switch switch@1b000000 lan12 (uninitialized): failed to validate link configuration for in-band status
[    9.778830] error creating PHYLINK: -22
[    9.783097] rtl83xx-switch switch@1b000000 lan12 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 27
[    9.795577] device eth0 entered promiscuous mode
[    9.800888] DSA: tree 0 setup
[    9.804255] LINK state irq: 23
[    9.807732] In rtl83xx_setup_qos
[    9.811387] L3_IPUC_ROUTE_CTRL 00002000, IPMC_ROUTE 0000077e, IP6UC_ROUTE 00014400, IP6MC_ROUTE 0001db7e
[    9.821961] L3_IPUC_ROUTE_CTRL 00002001, IPMC_ROUTE 00000501, IP6UC_ROUTE 00014581, IP6MC_ROUTE 00012881
[    9.832536] L3_IP_ROUTE_CTRL 0000013f
[    9.836748] rtl930x_dbgfs_init called
[    9.841303] rtl83xx_fib_event_work_do: FIB4 default rule failed
[    9.848687] rtl83xx_fib_event_work_do: FIB4 default rule failed
[    9.921223] Freeing unused kernel image (initmem) memory: 15360K
[    9.927971] This architecture does not have kernel memory protection.
[    9.935142] Run /init as init process
[    9.939233]   with arguments:
[    9.942529]     /init
[    9.945048]   with environment:
[    9.948551]     HOME=/
[    9.951176]     TERM=linux
[   10.721375] init: Console is alive
[   10.725708] init: - watchdog -
[   10.748167] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   10.761903] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   10.780648] init: - preinit -
[   13.476064] random: crng init done
ls: /sys/class/net/lan*: No such file or directory
BusyBox v1.36.1 (2024-03-17 17:55:14 UTC) multi-call binary.

Usage: basename FILE [SUFFIX] | -a FILE... | -s SUFFIX FILE...

Strip directory path and SUFFIX from FILE

	-a		All arguments are FILEs
	-s SUFFIX	Remove SUFFIX (implies -a)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   16.158488] procd: - early -
[   16.162074] procd: - watchdog -
[   16.817144] procd: - watchdog -
[   16.821245] procd: - ubus -
[   16.879893] procd: - init -
Please press Enter to activate this console.
[   17.623516] kmodloader: loading kernel modules from /etc/modules.d/*
[   17.657164] GACT probability on
[   17.662209] Mirror/redirect action on
[   17.698987] u32 classifier
[   17.702019]     input device check on
[   17.706139]     Actions configured
[   17.851835] kmodloader: done loading kernel modules from /etc/modules.d/*
[   19.334171] urngd: v1.0.2 started.



BusyBox v1.36.1 (2024-03-17 17:55:14 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r25567+15-0dfc0495fc
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# 

Yes, I can confirm. Tested the exact same branch and config, except for TESTING_KERNEL, and it works. Very strange. Can't see any changes in the realtek target which can explain that.

But the other two issues are present in the v5.15 image and can therefore be ignored.

Flood pinging the switch while booting after doing

rtk network on

will quite reliably produce

[    1.213760] Probing RTL838X eth device pdev: 82086a00, dev: 82086a10
[    1.271415] Found SoC ID: 8380: RTL8380, family 8380
[    1.277226] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 80524164
[    1.289228] Oops[#1]:
[    1.291805] CPU: 0 PID: 1 Comm: swapper Not tainted 5.15.150 #0
[    1.298427] $ 0   : 00000000 00000001 00000000 8200bf30
[    1.304330] $ 4   : 822ac4b8 00000000 808d0000 04200040
[    1.310217] $ 8   : 808c0000 308a3510 15fc3361 ffffffea
[    1.316113] $12   : 00000056 82023b04 00000056 80849ef8
[    1.322001] $16   : 822ac4b8 00000000 8200bf30 8200bf2f
[    1.327896] $20   : 808d0000 ffff8b50 808c0000 8200bf38
[    1.333792] $24   : 00000018 803ddffc                  
[    1.339680] $28   : 82022000 8200bef0 811d36fc 80524164
[    1.345577] Hi    : 00005fff
[    1.348797] Lo    : 2e48f657
[    1.352018] epc   : 00000000 0x0
[    1.355644] ra    : 80524164 __napi_poll+0x70/0x1f8
[    1.361144] Status: 10107c03 KERNEL EXL IE 
[    1.365851] Cause : 50808008 (ExcCode 02)
[    1.370330] BadVA : 00000000
[    1.373552] PrId  : 00019070 (MIPS 4KEc)
[    1.377934] Modules linked in:
[    1.381357] Process swapper (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000)
[    1.390211] Stack : 000d48a4 801676f8 00000020 3fffffff 811d36fc 822ac4b8 0000012c 8200bf30
[    1.399661]         808d3340 805244d8 00010000 8016aedc 00000000 8012505c 00000024 80143f00
[    1.409112]         8200bf30 8200bf30 8200bf38 8200bf38 811d3700 811d3708 00000008 00000003
[    1.418563]         00000004 0000000c 00000100 00000020 3fffffff 806e010c a5a5a5a5 82007300
[    1.428014]         00000005 00000001 0000001f 81200000 808aee1c 80848e50 80840000 808d0000
[    1.437466]         ...
[    1.440224] Call Trace:
[    1.440240] 
[    1.444614] [<801676f8>] handle_irq_event+0x98/0xc8
[    1.450091] [<805244d8>] net_rx_action+0xdc/0x1f8
[    1.455378] [<8016aedc>] handle_level_irq+0xb4/0x1bc
[    1.460956] [<8012505c>] free_task+0xb4/0x178
[    1.465857] [<80143f00>] find_pid_ns+0x8/0x10
[    1.470772] [<806e010c>] __do_softirq+0x10c/0x2ac
[    1.476082] [<803de22c>] plat_irq_dispatch+0x68/0x98
[    1.481657] [<80101b78>] handle_int+0x138/0x144
[    1.486750] 
[    1.488428] Code: (Bad address in epc)
[    1.488428] 
[    1.494287] 
[    1.496141] ---[ end trace c03ef8654bd71f6b ]---
[    1.501344] Kernel panic - not syncing: Fatal exception in interrupt
[    1.508445] Rebooting in 1 seconds..
[    3.508129] Reboot failed -- System halted

As expected there are no crashes on either version when booting "normally". I.e. without bootloader networking. Which makes this a minor issue. Wll be solved with the big cleanup and restructuring of the ethernet, dsa, phy and smi drivers anyway :wink:

What I see on v6.1 is that the VLAN_EGR_FILTER_DROP counter in /sys/kernel/debug/rtl838x/drop_counters increases with about the amount of missing egress packets.

But doing a bit of testing here teaches me the same lesson I've learned before: There's something really fishy with our VLAN filtering. Untagged traffic from the switch CPU doesn't necessarily work in v5.15 either.

Configuring this and pinging 192.168.1.1 on lan1 dowes not work in either version:

root@OpenWrt:/# bridge vlan
port              vlan-id  
lan1              43 PVID Egress Untagged
lan2              1 PVID Egress Untagged
lan3              1 PVID Egress Untagged
lan4              1 PVID Egress Untagged
lan5              1 PVID Egress Untagged
lan6              1 PVID Egress Untagged
lan7              1 PVID Egress Untagged
lan8              1 PVID Egress Untagged
switch            43

root@OpenWrt:/# ifconfig switch.43
switch.43 Link encap:Ethernet  HWaddr BC:A5:11:9F:E1:23  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::bea5:11ff:fe9f:e123/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:94 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5274 (5.1 KiB)  TX bytes:6094 (5.9 KiB)

But by pure magic, if I add vid 1 to lan1 then it starts working in v5.15. I.e.

root@OpenWrt:/# bridge vlan add vid 1 dev lan1
root@OpenWrt:/# bridge vlan
port              vlan-id  
lan1              1
                  43 PVID Egress Untagged
lan2              1 PVID Egress Untagged
lan3              1 PVID Egress Untagged
lan4              1 PVID Egress Untagged
lan5              1 PVID Egress Untagged
lan6              1 PVID Egress Untagged
lan7              1 PVID Egress Untagged
lan8              1 PVID Egress Untagged
switch            43

This should not have made any difference. And it doesn't in v6.1. Adding any other vid makes no difference. But we know vid 1 is special. Just wonder what makes it so special.

There is also another difference. In v5.15 I see broadcasts etc from all vids when snooping on "switch", whether the bridge is a member of that vlan or not. In v6.1 it looks like egress filtering on the cpu port works, and I only see traffic on the configured vids.

2 Likes

So if I understand correctly we have no network on the default setup, right? At least from what I'm seeing, I can't reach my GS1900-8HP once I write a 6.1 image to it. Initramfs works fine though.

That's right. It works fine with my normal configuration but not with the default.

Don't know how to attack that. I don't think it's a new problem, but something surfacing with the new kernel. Maybe just disable the egress vlan filtering? Don't know what good it does.

If the problem is not coming in with the new kernel, there were some commits that might have touched related parts of the drivers since 23.05:

The changes looked reasonable, but I didn't do much testing at the time...

I do seem to recall 5.15 still worked even after that commit e.g. though? And unless I'm mistaken bmork is saying 5.15 on main still works as expected as well?

Yes , the current 5.15 works. So there's more going on. Pure speculatuon, but my assumption is that there are some changes in the bridge code which triggers a latent bug. Could be completely wrong... I haven't done any serious debug attempt.

But I do wonder if the switch does proper vlan classification of packets ingressing on the cpu port. It almost looks like it considers any packet from the cpu port egressing without a tag as if it is vlan 1. Regardless of the actual untagged vid configured on the port.

2 Likes

Is it possible to run reatlek switch driver only for rtl930x as a part of different platform (quallcomax/ipq8072)? If yes, I could help with debugging and testing it

Decided to give https://github.com/bmork/openwrt/tree/tmp-realtek-6.1 a try on an Edgecore ECS4100-12PH. Unfortunately I can only report more problems.

With an SFP module plugged in, the kernel panics early during boot:

[    1.410480] CPU 1 Unable to handle kernel paging request at virtual address 0000004c, epc == 8051a5b0, ra == 8051baa4
[    1.422413] Oops[#1]:
[    1.424966] CPU: 1 PID: 346 Comm: kworker/1:11 Not tainted 6.1.86 #0
[    1.432056] Workqueue: events_power_efficient sfp_timeout
[    1.438110] $ 0   : 00000000 00000001 8051a560 0b9b6960
[    1.443960] $ 4   : 00000000 00000010 00000000 8223bd7c
[    1.449823] $ 8   : 00000000 825f8354 7f7f7f7f 7f7f7f7f
[    1.455671] $12   : 00000014 fefefeff 00000000 00000000
[    1.461541] $16   : 8223bd7c 00000084 8223bdbc 00000010
[    1.467404] $20   : 8223e600 00000040 81011405 825f8340
[    1.473254] $24   : 0047e0a8 807e656c
[    1.479118] $28   : 8223a000 8223bd18 fffffffb 8051baa4
[    1.484967] Hi    : 000000e8
[    1.488181] Lo    : 3eb64000
[    1.491391] epc   : 8051a5b0 sfp_smbus_read+0x50/0xb8
[    1.497044] ra    : 8051baa4 sfp_sm_mod_probe+0x64/0x7dc
[    1.502972] Status: 1100ff03 KERNEL EXL IE
[    1.507665] Cause : 08800008 (ExcCode 02)
[    1.512133] BadVA : 0000004c
[    1.515347] PrId  : 00019555 (MIPS 34Kc)
[    1.519712] Modules linked in:
[    1.523115] Process kworker/1:11 (pid: 346, threadinfo=(ptrval), task=(ptrval), tls=00000000)
[    1.532645] Stack : 00000000 00000000 00000000 0b9b6960 00000002 00000040 0000000a 8223e6d4
[    1.542026]         8223e600 00000000 80990000 8051baa4 00000000 80990000 80990000 808a0000
[    1.551407]         00000040 8100b21c 00000003 8202b880 80a00000 00000001 00000005 824ec800
[    1.560787]         000013be 0b9b6960 824ec860 8100e340 82029c3c 8230e918 00000001 8046cbd0
[    1.570162]         00000000 00000002 00000000 0b9b6960 80904ef8 824ec800 825aa460 00000000
[    1.579513]         ...
[    1.582260] Call Trace:
[    1.584990] [<8051a5b0>] sfp_smbus_read+0x50/0xb8
[    1.590250] [<8051baa4>] sfp_sm_mod_probe+0x64/0x7dc
[    1.595800] [<8051c548>] sfp_sm_module+0x148/0x428
[    1.601177] [<8051d0c0>] sfp_sm_event+0x6c/0x290
[    1.606351] [<8051d374>] sfp_timeout+0x20/0x30
[    1.611314] [<801493fc>] process_one_work+0x268/0x4a0
[    1.616998] [<80149c24>] worker_thread+0x160/0x59c
[    1.622358] [<801520f4>] kthread+0xec/0xf4
[    1.626968] [<80101b18>] ret_from_kernel_thread+0x14/0x1c
[    1.633007]
[    1.634676] Code: 8e840008  02113021  30c600ff <8c83004c> 0060f809  02602825  a2020000  26100001  1650fff7
[    1.645602]
[    1.647358] ---[ end trace 0000000000000000 ]---
[    1.652557] Kernel panic - not syncing: Fatal exception
[    1.658412] Rebooting in 1 seconds..
[    3.121616] ------------[ cut here ]------------
[    3.126761] WARNING: CPU: 1 PID: 346 at drivers/gpio/gpiolib.c:3140 gpiod_set_value+0x84/0xe8
[    3.136318] Modules linked in:
[    3.139729] CPU: 1 PID: 346 Comm: kworker/1:11 Tainted: G      D            6.1.86 #0
[    3.148476] Workqueue: events_power_efficient sfp_timeout
[    3.154517] Stack : 80b63494 80181d1c fffffffb 801859ac 00000000 808b21c4 8223b9dc 0b9b6960
[    3.163905]         808b21c4 8014b8e4 80a10000 8223ba23 00000000 00000001 8223b9e0 82050c00
[    3.173295]         00000000 00000000 808b21c4 8223b8b8 ffffefff 00000000 00000000 ffffffea
[    3.182685]         000000c4 8223b868 80990000 ffffffff 80990000 00000000 00000000 00000c44
[    3.192075]         8046c598 00000009 00000000 80990000 00000018 804a73d0 00000004 80b60004
[    3.201464]         ...
[    3.204202] Call Trace:
[    3.206919] [<8010723c>] show_stack+0x38/0x118
[    3.211915] [<807b4d88>] dump_stack_lvl+0x60/0x80
[    3.217192] [<8012d354>] __warn+0xb0/0xe4
[    3.221697] [<8012d4d0>] warn_slowpath_fmt+0x148/0x1b0
[    3.227453] [<8046c598>] gpiod_set_value+0x84/0xe8
[    3.232829] [<805599e8>] gpio_restart_notify+0x54/0xdc
[    3.238576] [<801539a0>] atomic_notifier_call_chain+0x5c/0x8c
[    3.244999] [<80105580>] machine_restart+0x34/0x5c
[    3.250368] [<8012cf3c>] panic+0x2ac/0x31c
[    3.254962] [<80107508>] die_if_kernel+0x0/0x2c
[    3.260038]
[    3.261693] ---[ end trace 0000000000000000 ]---

If I unplug the SFP modules, the device boots, but none of the ports work:

[    2.330452] rtl83xx_enable_phy_polling:    f0000000000ff
[    3.370798] rtl83xx-switch switch@1b000000: configuring for fixed/qsgmii link mode
[    3.379739] rtl83xx-switch switch@1b000000: Link is Up - 1Gbps/Full - flow control off
[    3.380939] rtl83xx-switch switch@1b000000 lan1 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.408122] rtl83xx-switch switch@1b000000 lan1 (uninitialized): failed to connect to PHY: -EINVAL
[    3.418245] rtl83xx-switch switch@1b000000 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
[    3.431532] rtl83xx-switch switch@1b000000 lan2 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.451150] rtl83xx-switch switch@1b000000 lan2 (uninitialized): failed to connect to PHY: -EINVAL
[    3.461269] rtl83xx-switch switch@1b000000 lan2 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 1
[    3.474528] rtl83xx-switch switch@1b000000 lan3 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.494094] rtl83xx-switch switch@1b000000 lan3 (uninitialized): failed to connect to PHY: -EINVAL
[    3.504203] rtl83xx-switch switch@1b000000 lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 2
[    3.517494] rtl83xx-switch switch@1b000000 lan4 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.537085] rtl83xx-switch switch@1b000000 lan4 (uninitialized): failed to connect to PHY: -EINVAL
[    3.547210] rtl83xx-switch switch@1b000000 lan4 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 3
[    3.560504] rtl83xx-switch switch@1b000000 lan5 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.580088] rtl83xx-switch switch@1b000000 lan5 (uninitialized): failed to connect to PHY: -EINVAL
[    3.590224] rtl83xx-switch switch@1b000000 lan5 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4
[    3.603476] rtl83xx-switch switch@1b000000 lan6 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.623054] rtl83xx-switch switch@1b000000 lan6 (uninitialized): failed to connect to PHY: -EINVAL
[    3.633174] rtl83xx-switch switch@1b000000 lan6 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 5
[    3.646458] rtl83xx-switch switch@1b000000 lan7 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.666076] rtl83xx-switch switch@1b000000 lan7 (uninitialized): failed to connect to PHY: -EINVAL
[    3.676214] rtl83xx-switch switch@1b000000 lan7 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 6
[    3.689456] rtl83xx-switch switch@1b000000 lan8 (uninitialized): validation of qsgmii with support 00000000,00000000,000062ff and advertisement 00000000,00000000,000062ff failed: -EINVAL
[    3.709031] rtl83xx-switch switch@1b000000 lan8 (uninitialized): failed to connect to PHY: -EINVAL
[    3.719153] rtl83xx-switch switch@1b000000 lan8 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 7
[    3.731931] rtl83xx-switch switch@1b000000 lan9 (uninitialized): failed to validate link configuration for in-band status
[    3.744285] error creating PHYLINK: -22
[    3.748586] rtl83xx-switch switch@1b000000 lan9 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 48
[    3.760981] rtl83xx-switch switch@1b000000 lan10 (uninitialized): failed to validate link configuration for in-band status
[    3.773406] error creating PHYLINK: -22
[    3.777705] rtl83xx-switch switch@1b000000 lan10 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 49
[    3.790169] rtl83xx-switch switch@1b000000 lan11 (uninitialized): failed to validate link configuration for in-band status
[    3.802600] error creating PHYLINK: -22
[    3.806904] rtl83xx-switch switch@1b000000 lan11 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 50
[    3.819364] rtl83xx-switch switch@1b000000 lan12 (uninitialized): failed to validate link configuration for in-band status
[    3.831769] error creating PHYLINK: -22
[    3.836066] rtl83xx-switch switch@1b000000 lan12 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 51

Note that this device is not supported in OpenWrt yet, but on my WIP branch port 1-8 work fine using kernel 5.15.