wireless: aic8800: stop inventing a new MAC on every boot - #527
Conversation
rwnx_cfg80211_init() seeds its fallback address with get_random_bytes(), so a board whose chip has no MAC in efuse comes up on a different address every boot. The symptom is a wandering DHCP lease and a server slowly filling with leases for one machine; nothing in the log says why. The vendor-storage path that should prevent this never runs. Its call sites are gated on CONFIG_PLATFORM_ROCKCHIP, a build knob no in-tree config defines, so the driver falls through to asking the firmware. Key off CONFIG_RFKILL_RK instead, which is what actually provides rfkill-wlan.h and rockchip_wifi_mac_addr(). Derive the fallback from the SoC's OTP id rather than random bytes, keeping the vendor OUI and varying only the tail, so a board with neither efuse nor vendor storage still gets a stable address. asm/system_info.h exists only on arm and arm64, so every use of system_serial_high/low is gated on the same condition that provides the header. Record which source the address came from and log it once at the default level - aicwf_dbg_level is LOGERROR, so anything quieter is invisible, and a silently regenerated MAC is the failure this is meant to make visible. Signed-off-by: Artem Butusov <art.sormy@gmail.com>
|
Warning Review limit reached
Next review available in: 26 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rwnx_cfg80211_init()seeds its fallback address withget_random_bytes(), so aboard whose chip has no MAC in efuse comes up on a different address every boot —
a wandering DHCP lease, and nothing in the log saying why.
The vendor-storage path that should prevent it never runs: those call sites are gated
on
CONFIG_PLATFORM_ROCKCHIP, a build knob no in-tree config defines, so the driverfalls through to asking the firmware. Keys off
CONFIG_RFKILL_RKinstead — whatactually provides
rfkill-wlan.handrockchip_wifi_mac_addr().The fallback now comes from the SoC OTP id rather than random bytes, keeping the
vendor OUI, so a board with neither efuse nor vendor storage is still stable.
asm/system_info.his arm/arm64 only, so uses ofsystem_serial_*are gated on thesame condition that provides it.
The source is logged once at
LOGERROR, which is the defaultaicwf_dbg_level—anything quieter is invisible, and a silently regenerated MAC is the failure this
exists to surface.
Verified on an RK3528 box, five consecutive boots:
Identical every time; previously the tail moved on each boot.
rockchip_wifi_mac_addr()readsWIFI_MACfrom vendor storage, so a board thatships one still wins. This one does not — its store carries only
LAN_MAC— whichis why the fallback is the path that runs here.