Skip to content

J813: WFxT, T8142 idle and i2c-pasemi resume - #807

Closed
sithglan wants to merge 3 commits into
aurora-silicon:integration/aurorafrom
sithglan:j813/feat/platform
Closed

sithglan wants to merge 3 commits into
aurora-silicon:integration/aurorafrom
sithglan:j813/feat/platform

Conversation

@sithglan

@sithglan sithglan commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Three small pieces the MacBook Air M5 needs:

  • arm64: cpufeature: treat WFxT as absent on Apple M5 and M6 cores
  • arm64: idle: T8142 idles in WFI even with idle=nop (aura passes idle=nop for kernels without the WFI register quirk; this kernel has it, and spinning idle keeps the SoC near 90 C)
  • i2c: pasemi: restore the controller after system sleep (s2idle)

Tested on the MacBook Air 13-inch M5 (J813): all seven J813 branches (nvme, platform, dts, soc, wireless, media, sound) merged onto integration/aurora 41c4055, built with the J813 config (7.3.0, no warnings) and booted once through aura's aura-try trial boot. systemd reaches running with no deferred devices; NVMe root, Wi-Fi and USB Ethernet, the AppleJ813 sound card, the camera (ISP) and the video decoder (AVD), PSCI cpuidle, the E/P states, CLPC/PMC and the PMP all come up, and integration's drm/apple drives the panel.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

Apple T8142 (M5) and T8152 (M6) cores clear architectural state across
WFIT, the FP/SIMD registers included. apple_m5_cpu_wfit() preserves the
general-purpose registers around the WFIT in __delay(), but not FP/SIMD,
and __delay() runs from any context: apple-soc-cpufreq polls the DVFS
command register with readq_poll_timeout_atomic() on every transition,
which schedutil and ondemand do from the scheduler or a kworker on a CPU
whose current task still has live FP/SIMD state.

On a J873 (Mac mini M6), 12 workers hashing a 128 MiB tmpfs file with
sha256sum, with short sleeps in between, got 25-56% wrong results under
schedutil or ondemand, each one different; fio verify found 64-byte runs
of zeros in reads, and systemd and Python crashed. The performance,
powersave and userspace governors were clean, as was the same load with
arm64.nowfxt (0 of 288 under schedutil twice and under ondemand, with
~1200/550 transitions per run).

Do what arm64.nowfxt does for these MIDRs: ARM64_HAS_WFXT is not
detected, so __delay() falls back to the event-stream WFE loop. The
userspace HWCAP2_WFXT still follows ID_AA64ISAR2_EL1. Only T8152 was
measured; T8142 is included because apple_m5_needs_wait_save() already
groups its cores with T8152 for this state loss.

Signed-off-by: Thomas Glanzmann <[email protected]>
The Apple I2C controllers sit in PMGR power domains. Without runtime PM
the domain stays on while the system runs, but genpd powers it off for
s2idle once all its devices are suspended, which resets the controller:
the clock divider and, from revision 6, the enable bit. The driver only
programmed them at probe and after a failed transfer.

After an s2idle on the MacBook Air J813 (T8142), the first amplifier on
I2C3 synced its registers, the next transfer of the second one timed out
(status 0x10850140) and the bus stayed stuck. In an earlier cycle a NACK
happened first, its reset path restored the divider and the remaining
sync worked.

Reprogram the controller in resume_noirq, after genpd has powered the
domain back on and before any client resumes, and mark the adapter
suspended across the noirq phase so a late transfer cannot reach an
unpowered controller.

Tested on J813: four SN012776 on I2C3 resync without errors after s2idle
(I2C3 domain powered off during it), speakers play afterwards.

Signed-off-by: Thomas Glanzmann <[email protected]>
aura, the J813 boot loader, passes idle=nop on M5 for kernels that do
not preserve registers across WFI. This kernel does (apple_wfi_quirk_init),
so on T8142 keep WFI as the default idle: spinning keeps all ten cores
busy, cpuidle's own WFI state spins too, and the SoC sits near 90 C and
throttles.

Signed-off-by: Thomas Glanzmann <[email protected]>
@sithglan

sithglan commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #996: the same work rebased onto integration/aurora 11eccbe and boot-tested on the J813.

@sithglan sithglan closed this Nov 5, 2026
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