]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: fsl_sai: Eliminate possible interrupt storm during probe
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 12 May 2026 06:52:52 +0000 (14:52 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 18 May 2026 16:37:16 +0000 (17:37 +0100)
commitfd3b95866d86844ae747fce9b3438d73ed5f1e7a
treedbe61510a894b84b1c2abd0a395f18fd98d6c760
parent6e4bfd9da8851f562f04503d8e43221957f96eeb
ASoC: fsl_sai: Eliminate possible interrupt storm during probe

When the SAI peripheral is left in a running state by the bootloader,
the driver can experience an interrupt storm during probe that prevents
successful initialization. This occurs because the current code registers
the IRQ handler before resetting the hardware to a known state.

The issue manifests as:
- Continuous interrupts firing immediately after devm_request_irq()
- Driver probe failure or system hang
- Error messages about unhandled interrupts

This is particularly problematic on systems where U-Boot or other
bootloaders enable SAI for boot-time audio feedback or diagnostics
and don't properly disable it before handing control to Linux.

Fix this by reordering the probe sequence:
1. Add fsl_sai_reset_hw() to clear TCSR/RCSR control registers,
   which disables the transmitter/receiver and all interrupt sources
2. Move devm_request_irq() to after hardware initialization

This ensures the SAI is in a clean reset state before the interrupt
handler can be invoked, preventing the storm while maintaining proper
error handling and cleanup paths.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260512065252.75859-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_sai.c