Skip to content

wireless: aic8800: stop inventing a new MAC on every boot - #527

Open
sormy wants to merge 1 commit into
armbian:rk-6.1-rkr5.1from
sormy:wireless/aic8800-stable-mac
Open

wireless: aic8800: stop inventing a new MAC on every boot#527
sormy wants to merge 1 commit into
armbian:rk-6.1-rkr5.1from
sormy:wireless/aic8800-stable-mac

Conversation

@sormy

@sormy sormy commented Aug 15, 2026

Copy link
Copy Markdown

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
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 driver
falls through to asking the firmware. Keys off CONFIG_RFKILL_RK instead — what
actually provides rfkill-wlan.h and rockchip_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.h is arm/arm64 only, so uses of system_serial_* are gated on the
same condition that provides it.

The source is logged once at LOGERROR, which is the default aicwf_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:

AICWFDBG(LOGERROR) rwnx_cfg80211_init: mac 88:00:33:65:64:b6 from soc otp id
wlan0  88:00:33:65:64:b6

Identical every time; previously the tail moved on each boot.

rockchip_wifi_mac_addr() reads WIFI_MAC from vendor storage, so a board that
ships one still wins. This one does not — its store carries only LAN_MAC — which
is why the fallback is the path that runs here.

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>
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sormy, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70d66a35-2a5e-45c9-8489-ffcc3420d5db

📥 Commits

Reviewing files that changed from the base of the PR and between 5280f9b and fa386df.

📒 Files selected for processing (1)
  • drivers/net/wireless/aic8800_sdio/aic8800_fdrv/rwnx_main.c

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant