diff --git a/target/linux/zte/patches-7.3/429-zx279133-wifi-skip-without-woe.patch b/target/linux/zte/patches-7.3/429-zx279133-wifi-skip-without-woe.patch new file mode 100644 index 0000000000..f7aacb0317 --- /dev/null +++ b/target/linux/zte/patches-7.3/429-zx279133-wifi-skip-without-woe.patch @@ -0,0 +1,54 @@ +From: 39moe <39moe@users.noreply.github.com> +Subject: [PATCH] net: zte: zx279133: skip WiFi WLTBL reprogram on boards without WiFi hardware + +The unified Wi-Fi offload support calls zx279133_wifi_hw_reprogram_locked() +unconditionally from the shared hardware-prepare path on every board. Boards +without WiFi hardware (e.g. STAR SG350H, whose DTB keeps pcie@/woe@ disabled) +never initialise the NPU WLTBL/SDT 0x64..0x68 tables, so the first netdev up +branches through uninitialised NPU state and panics: + + zx279133-uni-serdes 16100000.phy: Uni SerDes 2500base-x profile ready, status 0xf80007/0x1000706 + Unable to handle kernel paging request at virtual address 000812eb0e040520 + EC = 0x21: IABT (current EL), pc : 0x812eb0e040520, Comm: ip + Kernel panic - not syncing: Oops: Fatal exception + +Gate the reprogram on actual WiFi hardware presence: the WOE platform device +being registered, or at least one Wi-Fi vport already bound. WiFi boards keep +the existing behaviour; non-WiFi boards boot normally. + +Signed-off-by: 39moe <39moe@users.noreply.github.com> +--- +--- a/drivers/net/ethernet/zte/zx279133-wifi.c ++++ b/drivers/net/ethernet/zte/zx279133-wifi.c +@@ -422,6 +422,18 @@ + atomic64_inc(ð->wifi_slots[vport - ZX279133_WIFI_VPORT_BASE].up_punt_packets); + } + ++static bool zx279133_wifi_hw_present(const struct zx279133_eth *eth) ++{ ++ unsigned int i; ++ ++ if (zte_woe_available()) ++ return true; ++ for (i = 0; i < ZX279133_WIFI_VPORT_COUNT; i++) ++ if (READ_ONCE(eth->wifi_slots[i].used)) ++ return true; ++ return false; ++} ++ + void zx279133_wifi_hw_reprogram_locked(struct zx279133_eth *eth) + { + bool woe_hw = zte_woe_any_enabled(); +@@ -430,6 +442,12 @@ + if (!eth || !eth->hardware_prepared) + return; + ++ /* Boards without WOE/WiFi hardware (e.g. STAR SG350H) must keep the ++ * NPU WLTBL path untouched: reprogramming it on the first netdev up ++ * jumps through uninitialised NPU state and panics the kernel. */ ++ if (!zx279133_wifi_hw_present(eth)) ++ return; ++ + lockdep_assert_held(ð->datapath_lock); + (void)zx279133_np_wltbl_init_locked(eth, woe_hw); + (void)zx279133_np_wifi_woe_mode_sync_locked(eth, woe_hw);