Repository navigation
ASoC: tas2764: Fail an SDZ group closed when its restore after a reset fails - #2515
Merged
DjDeveloperr merged 3 commits intoNov 20, 2026
Merged
Conversation
…r-on Amps in an SDZ group keep the shared SDZ line across system sleep and only sync their register cache at resume. That holds for s2idle. A firmware-driven sleep powers the SoC's pin controller off, so the line drops while asleep and every amp comes back from a power-on reset when the pin controller restores it: TI's volatile quirk page is gone, and the page register is back at 0 while the cache may still hold another page. The cache sync at resume still succeeds, so nothing is logged then. On a J604 the first stream after a deep-sleep wake latched an over-current on one woofer amp, the failure the resume path's comment already names for an amp without its init quirks. The SDZ group then shut all six amps down, as it is meant to, and they stayed off the bus until a reboot. On a resume via firmware, treat a group like a power-on: wait the SDZ high to I2C time, reset the amp, drop the cached page so the next page switch reads the amp, sync the cache and apply the init quirks again, as the probe does. Say so when the amp does not answer on I2C, which means SDZ or the supply did not come back. s2idle keeps today's path. Tested on a J604 (M4 MacBook Pro 14"): before, the first stream after a deep wake logged "fault: over current" on a woofer amp and "SDZ group shut down"; with this change, a stream after seven deep wakes kept all six amps active with no I2C error and no over-current. Assisted-by: LLM Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
The previous change restores an SDZ group from a power-on reset when the resume comes through firmware. A sleep can still cut the shared SDZ line or the amps' supply without the firmware reporting it, for example an s2idle resume after a deep sleep that failed half way. The amps then sit in their reset state with the cache believing otherwise, and the first stream latches an over-current on a woofer amp, which takes the whole group down. Ask the amp. PWR_CTRL resets to 0x1a with BOP_SRC clear, and the probe sets BOP_SRC on every SN012776, so a read that bypasses the cache tells a reset amp from one that kept its registers. When it was reset, or does not answer, take the power-on path. This costs one register read per amp per resume. Assisted-by: LLM Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…t fails When an SDZ group amp comes back from a power-on reset and the resume cannot restore it (the reset write gets no answer, the cache sync or the init quirks fail), the resume only logs the error. ASoC ignores a component's resume error, the regmap stays live, and only a failed group refuses streams. The amp keeps its reset defaults (gain, brownout, interrupt masks, no quirk page) while the cache holds the restored values, so a later unmute writes PWR_CTRL active and the amp plays with its protection not set up. The macaudio floor writes find the cache unchanged and skip the amp too. The power-on path can now also be taken for an amp that kept its registers (an aborted deep sleep still reports a resume through firmware, and a failed read counts as a reset), so a transient I2C error can leave a healthy amp in that state. Fail the group closed in both cases, as a latched over-current or over-temperature does: the shared SDZ supply is forced off and every stream is refused until the driver is reloaded, which probes the amps again from scratch. Assisted-by: Claude Opus 5.5 Signed-off-by: Diljit Singh <hey@djdev.me> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged as Compile check: No hardware run: the success path that Isaac (J714s) and axboe (K116s) ran takes none of the new branches. |
This was referenced Nov 20, 2026
Merged
J714s: take port-only and wifibt-only SMC wakes as dark wakes (macsmc, dwc3, thunderbolt, ane)
#2231
Merged
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.
Follow-up to #1996 (stacked on its head
a4f5e7a1ac05; only the top commit80d147f1968dis new). Merge right after #1996.Why
Review of #1996 found one gap in its error paths. When an SDZ group amp comes back from a power-on reset, the resume may fail to restore it: the reset write gets no answer, or
regcache_syncor the init quirks fail. In that case the resume only logs the error.soc-component.c), and the regmap stays live.startupandupdate_pwr_ctrlrefuse only a failed group. So the next unmute writes PWR_CTRL active.#1996 also takes the reset path for amps that may have kept their registers. An aborted deep sleep still reports a resume through firmware, and a failed BOP_SRC read counts as a reset. So a transient I2C error can now put a healthy amp in that state.
What
On either failure, fail the group closed exactly as a latched over-current or over-temperature fault already does, with
tas2764_group_shutdown(). The SDZ supply is forced off and every stream is refused until the driver is reloaded, which probes the amps again from scratch.The success path is unchanged, and amps outside a group and s2idle are not touched.
Testing
tas2764.obuilt with the M5 asahi config at W=1 on integration/aurora449c6a19merged with ASoC: tas2764: Bring an SDZ group back from a deep sleep as from power-on #1996, wifi: centauri: recover after DMA was released before physical reset #2144 and T6050: a "freeze" with mem_sleep at deep is a suspend-to-idle (no dock teardown, no -67) #2510, with no compiler warnings.🤖 Generated with Claude Code