Skip to content

ASoC: tas2764: Free the fault IRQ when the component is removed - #765

Open
erikwb wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-free-irq
Open

erikwb wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-free-irq

Conversation

@erikwb

@erikwb erikwb commented Nov 1, 2026

Copy link
Copy Markdown

Every time the sound card binds again, each TAS2764 adds another handler for itself on its fault IRQ. This frees the IRQ when the component is removed.

What happens

tas2764_codec_probe() requests the fault IRQ with devm_request_threaded_irq() on the I2C device. The I2C device stays bound when the card is torn down, so the handler outlives the component. The next bind probes the component again and requests the IRQ again, and tas2764_codec_remove() never frees it.

On the J713 the four amps share one active-low fault line. After two rebinds of the speaker card (for example rmmod snd_soc_macaudio; modprobe snd_soc_macaudio, or reloading snd-soc-aop with #759), /proc/interrupts listed twelve tas2764 handlers on it. Each fault interrupt runs every one of them, and each reads six latch registers over I2C, so faults are handled later with every rebind. That includes the over-temperature and over-current group shutdown.

The change

  • Free the IRQ in the remove: tas2764_codec_remove() frees it with devm_free_irq() when the probe got it. That's tracked, because an amp outside an SDZ group carries on without the IRQ if the request fails.
  • Request it last: the request moves to the end of the probe, after the steps that can fail, so a probe that fails after it can't leave a handler behind either. The interrupt masks are still written right after the reset, as before.

Testing (J713)

Handlers on the fault line
Without this commit, after two card rebinds 12
With it: fresh module 4
With it: after two macaudio rebinds and an snd-soc-aop reload 4
  • The IRQ still works: after the speaker stream closed, the amps reported the stopped bus clock 19 times and each report was handled. Nothing was logged about unhandled interrupts or a disabled line.
  • Checks:
    • checkpatch --strict is clean;
    • the module builds with W=1 on integration/aurora with no warnings.

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>
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