Repository navigation
Conversation
The component probe requests the fault IRQ as a devres of the I2C device, which stays bound when the sound card is torn down. Every rebind of the card probes the component again and adds another handler for the same amp on the line: after two rebinds the J713's four amps had twelve handlers on their shared IRQ, each fault interrupt ran every one of them, and each does six I2C reads. Free the IRQ in the component remove. Request it as the probe's last step, so that a probe that fails later does not leave a handler behind either. Signed-off-by: Erik Bourget <erik@ebourget.net>
tas2764_codec_probe() enables the SDZ supply and raises the shutdown GPIO before it resets the amp and writes its setup. When one of those writes fails, or an amp in an SDZ group can't get its fault IRQ, the probe returns with the supply still enabled. ASoC doesn't call the component's remove after a failed probe, so nothing balances that enable, and every later probe attempt adds another. The supply then stays on after the card is removed and, for an amp outside an SDZ group, through system sleep as well. Undo the power-up on those failures: lower the shutdown GPIO and drop the supply enable, unless the group failed and its supply was already forced off, as the remove does. Signed-off-by: Erik Bourget <erik@ebourget.net>
Author
|
Superseded by #820, where this is commit 21, unchanged. |
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.
When the TAS2764 component probe fails after powering the amp up, it returns with the SDZ supply still enabled. This undoes the power-up on those failures.
Stacked on #765, which moved the fault IRQ request to the end of the same function; the first commit here is #765's.
What happens
tas2764_codec_probe()enables the SDZ supply and raises the shutdown GPIO, then resets the amp and writes its setup over I2C. Ten of those writes, and the fault IRQ request for an amp in an SDZ group, can fail and return early. ASoC doesn't call the component's remove after a failed probe (soc_probe_component()only setsprobedonce the probe succeeded), so nothing drops that enable:The group shutdown on over-temperature or over-current is not affected: it forces the supply off regardless of enables.
The change
The failures after the power-up now go through one exit that lowers the shutdown GPIO and drops the supply enable. It skips the disable when the amp's group has failed and its supply was already forced off, as the remove does. A successful probe is unchanged.
Testing (J713)
I made the first setup write fail with a test-only module parameter, bound the speaker card twice (both binds fail at the first amp, 1-0038), then cleared the parameter and bound it again. Enables on the
sn012776-sdzsupply, from the regulator debugfs:With the commit, both cards come back on the good bind and the speaker protection daemon runs normally.
--strictis clean;