[PATCH 0/4] ASoC: amd: fix IRQ handler races in AMD SoundWire drivers

From: Vijendar Mukunda

Date: Sat Nov 07 2026 - 12:55:22 EST


These four patches fix two related race conditions in the AMD SoundWire
IRQ handlers for the PS (ACP63) and SOF platforms.

Patches 1 and 2 guard against a NULL dereference in the ACP external IRQ
handler. The handler is registered before sdw_amd_probe() assigns
adata->sdw, so a stray interrupt in the probe window, or one that fires
after sdw_amd_exit() frees the context, can reach the adata->sdw->pdev[i]
dereference with adata->sdw still NULL.

Patches 3 and 4 guard schedule_work() calls with the interrupt_enabled
flag so that an in-flight IRQ arriving while the SoundWire manager is
being torn down does not queue new work after amd_disable_sdw_interrupts()
has cleared the flag.

NOTE: Patches 3 and 4 depend on the following patch which introduces the
interrupt_enabled field in the AMD SoundWire manager:

https://lore.kernel.org/linux-sound/20261107154659.3358223-18-Vijendar.Mukunda@xxxxxxx/

Until that patch is merged, patches 3 and 4 should not be picked up
independently.

Vijendar Mukunda (4):
ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ
handler
ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ
handler
ASoC: SOF: amd: guard SDW IRQ work scheduling with interrupt_enabled
flag
ASoC: amd: ps: guard SDW IRQ work scheduling with interrupt_enabled
flag

sound/soc/amd/ps/pci-ps.c | 32 ++++++++++++++++++++------------
sound/soc/sof/amd/acp.c | 32 ++++++++++++++++++++------------
2 files changed, 40 insertions(+), 24 deletions(-)

--
2.53.0