]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: qcom: Actually clear DMA interrupt register for HDMI
authorStephen Boyd <swboyd@chromium.org>
Wed, 9 Feb 2022 23:25:20 +0000 (15:25 -0800)
committerMark Brown <broonie@kernel.org>
Thu, 10 Feb 2022 13:14:38 +0000 (13:14 +0000)
commitc8d251f51ee61df06ee0e419348d8c9160bbfb86
treed9ed1e8924c522bd1356f4fe500abe20662d9198
parente4e3a93c6e267572ca2345d8d86053e166843a8c
ASoC: qcom: Actually clear DMA interrupt register for HDMI

In commit da0363f7bfd3 ("ASoC: qcom: Fix for DMA interrupt clear reg
overwriting") we changed regmap_write() to regmap_update_bits() so that
we can avoid overwriting bits that we didn't intend to modify.
Unfortunately this change breaks the case where a register is writable
but not readable, which is exactly how the HDMI irq clear register is
designed (grep around LPASS_HDMITX_APP_IRQCLEAR_REG to see how it's
write only). That's because regmap_update_bits() tries to read the
register from the hardware and if it isn't readable it looks in the
regmap cache to see what was written there last time to compare against
what we want to write there. Eventually, we're unable to modify this
register at all because the bits that we're trying to set are already
set in the cache.

This is doubly bad for the irq clear register because you have to write
the bit to clear an interrupt. Given the irq is level triggered, we see
an interrupt storm upon plugging in an HDMI cable and starting audio
playback. The irq storm is so great that performance degrades
significantly, leading to CPU soft lockups.

Fix it by using regmap_write_bits() so that we really do write the bits
in the clear register that we want to. This brings the number of irqs
handled by lpass_dma_interrupt_handler() down from ~150k/sec to ~10/sec.

Fixes: da0363f7bfd3 ("ASoC: qcom: Fix for DMA interrupt clear reg overwriting")
Cc: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20220209232520.4017634-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-platform.c