Repository navigation
soc: apple: sleep: T8122: keep the audio clocks across deep sleep - #3590
Conversation
|
First hardware row on J613. The fix is inactive on a real machine, because the loader's devicetree has neither Setup: candidate kernel Results:
What the PR needs, as I read it: dropping the fixed-address fallback was right for the guidelines, but on current loaders it makes the fix a no-op. Either:
Leaving this a draft until one of those is in and a row shows 48,000 / 44,100 Hz after wake. |
92e725e to
0f75533
Compare
|
Checked at this head:
Still to do: a J613 row showing 48,000 / 44,100 Hz after a deep wake, once the test J613 has its recovery cable back. Staying a draft until then. |
|
Hardware row at this head on J613 (MacBook Air 13" M3, T8122): 3/3 Setup: Results:
Not yet:
|
|
Hardware rows at this head ( Kernel: The boot loader's device tree on this Mac predates the new Audio-rate check, before the first sleep and after every wake: 4.000 s of frames were captured from the MCA headset-jack PCM to
After each row: 0 failed units, and no new EDAC reports. Not tested:
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Deep sleep resets NCO0..3 and parks the four MCA audio clock muxes (clk-mux +0xd8..+0xe4) on the 24 MHz bypass, so audio after a wake runs at 93,750 Hz (24 MHz / 256) instead of the rate it was set to. Save NCO0..3 and the mux selections at the commit and put them back on wake, NCOs first. A mux only finishes a switch (BUSY, bit 30, clears) while its source clock runs, so, as T8103 already does, enable any NCO channel that is off before the commit and disable it again once the muxes have settled on wake. Without that, a mux left BUSY on a stopped NCO holds the commit, and the watchdog resets the machine. The NCO block comes from the sleep node's apple,nco phandle, else from the node matching "apple,t8122-nco". The mux block comes from the sleep node's "clk-mux" registers, else from the PMGR page 0x4000 below the NCO block, as T8122 lays them out: loaders whose devicetree predates those two properties still describe the NCO node. A half with no block found is skipped. Signed-off-by: Satya Benson <[email protected]>
0f75533 to
d6c980a
Compare
|
Rebased onto main |
|
host-tests at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
The applied patch matches the version used in the 15 J613 deep-wake cycles. The save and restore order brings the NCOs up before switching the muxes and returns the forced channels to their prior state. Apple build, DT checks and KUnit passed. The host failures are confined to AVE, Broadcom PS nap and G17 owed-stamp fixtures that already fail on the base. The J613 run exercised the legacy loader fallback. The named clk-mux and apple,nco path still needs a hardware row.
What: Keep the MCA audio clocks across T8122 deep sleep. Deep sleep resets NCO0..3 and parks the four audio clock muxes (
clk-mux+0xd8..+0xe4) on the 24 MHz bypass, so audio after a wake runs at 93,750 Hz instead of the rate it was set to. The sleep driver now saves the NCO channels and the mux selections at the commit and restores them on wake, NCOs first.As T8103 already does, it also enables any stopped NCO channel before the commit and stops it again once the muxes have settled. A mux switch only completes (BUSY, bit 30, clears) while its source runs, and a mux left BUSY on a stopped NCO holds the commit until the watchdog resets the SoC. The mux block comes from a new
clk-muxregister range on the sleep node, and the NCO block from a newapple,ncophandle. Neither is a fixed address, and without either that half is skipped.Tested: J613 (MacBook Air 13" M3, T8122) at
0f755337, on main7ccd92acwith #3504/#3605/#3607/#3608, non-debug,apple_sleep.deep=1 apple_sleep.untested_commit=1: 15/15 realmem/deepcycles (5 and then 10 in a row, RTC wakes after 15 s, no reset). After every wake, a timed capture on the MCA headset-jack PCM ran at the set rate, 48000 and 44100 Hz (4.000 s of frames in 4007–4088 ms). Every sleep after the first was entered with a stopped NCO behind a selected mux. 0 failed units. This loader's device tree has noclk-muxorapple,nco, so the fallback path ran.LLVM=1 W=1build ofdrivers/soc/apple/sleep.o; the apple-sleep KUnit suite (17 tests, 16 passed, 1 skipped);t8122-j613/t8122-j615DTBs build;dt_binding_checkofapple,t8140-sleep.yamlandCHECK_DTBSoft8122-j613.dtbclean.Risk: two-way · M3 (T8122)
Not yet: the device-tree path (a loader that passes
clk-muxandapple,nco); playback after a wake (only capture was timed); reading BUSY at the commit; J615.