Repository navigation
Conversation
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]>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small pieces the MacBook Air M5 needs:
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