Skip to content

wifi: apple: centauri: t6050: return -EALREADY to a connect while connected - #3954

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
axboe:fix/centauri-t6050-reassoc
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
axboe:fix/centauri-t6050-reassoc

Conversation

@axboe

@axboe axboe commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

The T6050 driver refused a connect while connected with -EBUSY. wpa_supplicant roams by sending a connect with prev_bssid, so every roam failed: it dropped the link, ignored the target for 10 s and joined whatever else the scan held. On a K116s this moved it off a -58 dBm AP onto a -63 dBm one, where it stayed with bursty loss (6-14% of gateway pings in 20-30 s runs):

wpa_supplicant: wlp1s0f0: Trying to associate with a8:9c:6c:42:b6:02 (SSID='OakHUS' freq=5540 MHz)
wpa_supplicant: wlp1s0f0: Association request to the driver failed
wpa_supplicant: wlp1s0f0: Added BSSID a8:9c:6c:42:b6:02 into ignore list, ignoring for 10 seconds

Change

Return -EALREADY when already connected. wpa_supplicant handles that by disconnecting explicitly and retrying the same BSS. wifi_disconnect() waits for the firmware, so the retried connect is not refused as busy. Joins, disconnects and the other busy cases are unchanged. A roam is still a short disconnect and join, not a firmware reassociation.

Tested: K116s, firmware 27.2.
Risk: one-way · T6050 Wi-Fi (apple_centauri_t6050), roaming only.

Testing

K116s (MacBook Pro 16-inch M5 Pro, firmware 27.2), aura main 7f5a1df5, default command line. Kernel: main 8a42aee + #2355 + both centauri fixes (this one unchanged), ATC0 left out locally (#3598); the module was swapped in and reloaded with modprobe -r btcentauri_t6050 apple_centauri_t6050; modprobe apple_centauri_t6050. Counts: 0 oops/WARN, 0 new kernel errors besides the one probe line below, 1 failed unit (anacron start limit on AC plug-in, also without these patches), no SELinux on Debian.

  • Before: wpa_cli roam to another BSS of the same network gives the log above and lands on a third BSS.
  • After: wpa_cli roam both ways between two 5 GHz BSSes (ch 48 and ch 60): associated with the requested BSS in 0.6-0.7 s, no ignore-list entry, same DHCP lease, 0/50 gateway pings lost afterwards.
  • Seen once: wpa_supplicant made one more hop of its own 2 s after a roam (from the scan it runs after the explicit disconnect); it completed in 0.6 s.
  • Host tests: all tools/asahi/centauri-*-tests.py pass; checkpatch --strict clean.

Still to run

A roam triggered by signal (bgscan) rather than by hand, and a J714s row.

  • Clean-room: no Apple code, strings, firmware, RE output or tuning values
  • No chip/board/firmware-version gate where a hardware property can decide
  • Works on the default kernel command line; no hacks, delays or lab-only paths
  • Safety limits come from the machine, not from constants in code
  • Hardware safety rules followed for every test boot
  • Third-party commits unchanged; reporters and testers credited
  • Commits: human Signed-off-by only; no AI attribution in commits or PR text
  • Tested on the affected hardware; no regression

…nected

The firmware has no in-place reassociation, so a connect while connected
was refused with -EBUSY. For a roam, wpa_supplicant then marks the target
BSS as failed, drops the link, ignores the target for 10 s and joins
whatever else is in the scan, often a weaker AP. On a K116s it roamed
from a -58 dBm AP to one at -63 dBm this way and stayed there.

Return -EALREADY instead. wpa_supplicant handles that by disconnecting
explicitly and retrying the same BSS, so a roam becomes a short
disconnect and join to the BSS it chose. wifi_disconnect() waits for
the firmware to finish, so the retried connect is not refused as busy.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
@axboe
axboe requested review from a team as code owners December 2, 2026 15:24
@axboe
axboe requested review from LiamRay11 and scottjones December 2, 2026 15:24
@github-actions github-actions Bot added blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 019e4b0e: not ready yet

Check Detail
CI at head running running: apple-build, host-tests
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 019e4b0e, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: one-way · T6050 Wi-Fi (applecentaurit6050), roaming only.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code audit at 019e4b0e0946 (drivers/net/wireless/apple/centauri/t6050/centauri_wifi.c) looks clean:

  • Splitting wifi->connected out of the -EBUSY check in wifi_connect() to return -EALREADY cleanly instructs wpa_supplicant to disconnect via wifi_disconnect() and retry the target BSS without hitting the 10 s ignore list, while leaving !wifi->configured, wifi->connecting, wifi->scan_request, and wifi->disconnect_pending unchanged (-EBUSY).
  • DCO, checkpatch --strict, centauri-*-tests.py, and K116s roam verification all look solid (minor note: this is effectively a two-way revertible change).

Waiting on queued CI (apple-build, host-tests, KUnit plan, pr-text) and exact-head T6050 verification before flipping to approve.

@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member

Exact-head M5 Max (J775c, T6050, Centauri N1, Stage 2 aura 1.0.0b19, default cmdline) A/B hardware verification at 019e4b0e0946435aecfafd9bb6a47420a7470079 (built with tools/aurora-bindgen, 0 bindgen warnings):

  • Control (stock main deedd808cefd, wlan0 connected on 5 GHz):
    • Sending NL80211_CMD_CONNECT with NL80211_ATTR_PREV_BSSID while connected returned -16 (-EBUSY); link remained up.
  • This PR (019e4b0e0946, one-shot trial, default cmdline):
    • Pre-sleep: wlan0 connected cleanly (5765 MHz, -50 dBm, gateway ping 5/5, 0% loss, 2.681 ms avg). Sending NL80211_CMD_CONNECT with NL80211_ATTR_PREV_BSSID while connected returned -114 (-EALREADY); link remained connected.
    • 2/2 consecutive 15 s RTC s2idle cycles (suspend_stats 2/0): wlan0 reconnected cleanly, gateway ping 5/5 (0% loss, 2.253 ms avg); re-probing NL80211_CMD_CONNECT with NL80211_ATTR_PREV_BSSID again returned -114 (-EALREADY) with link intact.
    • 0 failed systemd units, 0 kernel oops/WARN/DART/Centauri faults (OOPS_PRE=0, OOPS_POST=0), clean unaided reboot back to the default kernel.

Scope: directly exercises the T6050 Centauri N1 wifi_connect() -EBUSY → -EALREADY return path via nl80211 while connected (with iwd running); full wpa_supplicant multi-AP roam sequence is untested here.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 019e4b0e0946 (wifi: apple: centauri: t6050: return -EALREADY to a connect while connected):

  • Single-site change in drivers/net/wireless/apple/centauri/t6050.c maps a duplicate wifi_connect() while already connected from -EBUSY to -EALREADY, matching cfg80211_connect() expectations without touching unrelated connect/disconnect paths.
  • All CI checks (apple-build, host-tests, KUnit plan, pr-text, readiness) are now green, DCO and Risk: are present, and exact-head hardware verification landed on both M5 Max (J775c, T6050 A/B -EBUSY -> -EALREADY pre- and post-2/2 s2idle with 0 faults) and K116s (roam recovery PASS).

LGTM.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the whole diff at 019e4b0e. A connect while the interface is already connected now returns -EALREADY instead of -EBUSY. That is the same code cfg80211 returns for a connect while connected. wpa_supplicant's nl80211 driver handles -EALREADY by disconnecting and retrying the same BSS.

The retry works with this driver: wifi_disconnect() waits for the firmware to finish the disconnect, so disconnect_pending is already clear when the second connect arrives. The other busy cases (not configured, connecting, scanning, disconnect in progress) still return -EBUSY.

satchlj's J775c row at this head shows -EALREADY before and after s2idle, with the link up and pings clean. Approving.

@DjDeveloperr
DjDeveloperr merged commit 8f20740 into aurora-silicon:main Dec 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants