Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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(&eth->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(&eth->datapath_lock);
(void)zx279133_np_wltbl_init_locked(eth, woe_hw);
(void)zx279133_np_wifi_woe_mode_sync_locked(eth, woe_hw);