Skip to content

wifi: apple: centauri: serialize sibling acquisition with probing - #1421

Merged
RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
betizzel:review/centauri-sibling-probe
Nov 10, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
betizzel:review/centauri-sibling-probe

Conversation

@betizzel

Copy link
Copy Markdown
Contributor

Problem

The driver core sets dev.driver before calling a PCI device's probe. After the N1 functions appear, the Bluetooth sibling can therefore have a driver pointer while its probe is still in progress and will defer until the shared firmware is ready. The T6050 Control driver's unlocked ownership check can mistake this transient state for a bound owner and abort IPC startup with -EBUSY.

Change

Hold each sibling's device lock across the ownership check and resource acquisition. This lets an in-progress deferring probe finish before the decision, while still rejecting a genuinely bound driver. Release every acquired lock on success and error paths; do not lock Control from its own asynchronous worker. No retry or delay is added.

A separate host regression compiles the production enumeration function into a fixture with modeled PCI/driver-core operations and pthread mutexes. It covers a deferred Beta probe, a genuinely bound Beta driver, and lock release after mapping, device-enable, DMA-mask and IRQ-allocation failures.

Provenance and scope

Adapted from betizzel/omarchy-m5 0228851, patch 0007 and its MIT-licensed host fixture, onto Aurora integration/aurora at 064054da0bd841119da48c07b648e7c3b2e2ec8f. This builds on the existing Aurora T6050 Centauri work and has no patch dependency on the J714s DT/power-domain series in #1182/#1183. Exercising it on hardware still requires a working N1 board/loader setup.

The change serializes the ownership check and resource acquisition, not exclusive ownership for the rest of the device lifetime. Separately, the existing centauri_t6050_free_ipc() path appears to clear Alpha's PM domain without the device lock required by dev_pm_domain_set(). That pre-existing path is unchanged here and merits separate review.

Developed and reviewed with AI assistance; the commits retain the assistant attribution and the author's DCO sign-off.

Testing and limitations

  • This adaptation: ARM64 16-KiB-page ARCH=arm64 LLVM=1 W=1 build of drivers/net/wireless/apple/centauri/t6050/apple_centauri_t6050.o. The composite object compiled and linked; this was not a full-kernel or module build.
  • Host regression: all six cases passed, including a fresh review run of python3 tools/testing/selftests/drivers/apple/centauri-t6050-probe.py. This uses modeled operations, not real kernel locks or PCI hardware. The adapted fixture was not run against unpatched Aurora; the earlier local four-case fixture separately reproduced -16 before the local fix.
  • Earlier local 0007: one recorded native J714s boot reconnected Wi-Fi automatically, passed Wi-Fi SSH/ICMP/HTTPS, and exposed a powered Bluetooth HCI controller after a preceding boot failed with IPC -EBUSY. This is not Bluetooth pairing/audio qualification and is not a hardware test of this upstream adaptation.
  • Not tested: booting this adapted branch on hardware, lockdep, and concurrent bind/unbind.
  • Style checks during preparation: separate checkpatch.pl --no-tree --no-signoff runs reported zero errors, with two attribution-trailer warnings for the driver and those two plus a new-file/MAINTAINERS warning for the test; both exited nonzero for warnings. A tree-aware check of the two-patch stream could not run its SPDX helper because Python ply was unavailable. These were not SPDX or DCO validation results; the owner has since explicitly authorized the sign-offs.

betizzel and others added 2 commits November 10, 2026 00:31
The driver core sets a sibling device driver before calling its probe.
On T6050, the Bluetooth function can be probing only to defer until
shared firmware is ready. An unlocked ownership check may mistake that
transient pointer for a bound driver, aborting IPC startup with -EBUSY.

Hold each sibling device lock across the ownership check and resource
setup. This waits for an in-progress probe to finish, still rejects an
actually bound driver and releases the lock on each error path. The
control function is not locked by its own asynchronous boot worker.

Adapted from omarchy-m5 patch 0007. The original patch was exercised on
a J714s; this port to the restructured upstream T6050 driver has not
been tested on hardware.

Signed-off-by: betizzel <betizzel@pm.me>
Link: betizzel/omarchy-m5@0228851
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: Claude <noreply@anthropic.com>
Exercise the actual T6050 sibling acquisition function with a controlled
concurrent deferred Beta probe. Verify that a genuinely bound driver is
rejected and that mapping, enable, DMA and IRQ failures release the
sibling device lock.

Adapted from the MIT-licensed omarchy-m5 smoke-bootstrap.py fixture.
The host-side test models PCI and driver-core operations; it does not
replace a hardware or kernel lockdep test.

Signed-off-by: betizzel <betizzel@pm.me>
Link: betizzel/omarchy-m5@0228851
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants