linux/sound
Mohan Kumar 7faa26c1bb ALSA: hda: Reset stream if DMA RUN bit not cleared
Tegra HDA has FIFO size which can hold upto 10 audio frames to support
DVFS. When HDA DMA RUN bit is set to 0 to stop the stream, the DMA RUN
bit will be cleared to 0 only after transferring all the remaining audio
frames queued up in the fifo. This is not in sync with spec which states
the controller will stop transmitting(output) in the beginning of the
next frame for the relevant stream.

The above behavior with Tegra HDA was resulting in machine check error
during the system suspend flow with active audio playback with below kernel
error logs.
[ 33.524583] mc-err: [mcerr] (hda) csr_hdar: EMEM address decode error
[ 33.531088] mc-err: [mcerr] status = 0x20000015; addr = 0x00000000
[ 33.537431] mc-err: [mcerr] secure: no, access-type: read, SMMU fault: none

This was due to the fifo has more than one audio frame when the DMA
RUN bit is set to 0 during system suspend flow and the timeout handling in
snd_hdac_stream_sync() was not designed to handle this scenario. So the
DMA will continue running even after timeout hit until all remaining
audio frames in the fifo are transferred, but the suspend flow will try
to reset the controller and turn off the hda clocks without the knowledge
of the DMA is still running and could result in mc-err.

The above issue can be resolved by doing stream reset with the help of
snd_hdac_stream_reset() which would ensure the DMA RUN bit is cleared
if the timeout was hit in snd_hdac_stream_sync().

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Link: https://lore.kernel.org/r/20200128051508.26064-1-mkumard@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-28 10:29:41 +01:00
..
ac97 ALSA: ac97: Constify snd_ac97_bus_ops definitions 2020-01-03 09:24:11 +01:00
aoa ALSA: aoa: More constifications 2020-01-05 16:14:27 +01:00
arm ALSA: arm: More constification 2020-01-05 16:15:07 +01:00
atmel ALSA: atmel: Constify snd_ac97_bus_ops definitions 2020-01-03 09:24:12 +01:00
core ALSA: pcm: Set per-card upper limit of PCM buffer allocations 2020-01-21 07:11:55 +01:00
drivers ALSA: serial-u16550: More constification 2020-01-05 16:15:08 +01:00
firewire Merge branch 'for-linus' into for-next 2020-01-20 11:44:51 +01:00
hda ALSA: hda: Reset stream if DMA RUN bit not cleared 2020-01-28 10:29:41 +01:00
i2c ALSA: i2c: Constify snd_kcontrol_new items 2020-01-03 09:24:24 +01:00
isa ALSA: sc6000: More constification 2020-01-05 16:15:05 +01:00
mips ALSA: mips: Constify snd_device_ops definitions 2020-01-03 09:24:02 +01:00
oss compat_ioctl: remove translation for sound ioctls 2019-10-23 17:23:45 +02:00
parisc ALSA: parisc: Constify snd_kcontrol_new items 2020-01-03 09:24:35 +01:00
pci Merge branch 'for-linus' into for-next 2020-01-26 09:31:41 +01:00
pcmcia ALSA: pdaudiocf: More constification 2020-01-05 16:15:13 +01:00
ppc ALSA: ppc: More constifications 2020-01-05 16:14:43 +01:00
sh ALSA: sh: Fix compile warning wrt const 2020-01-05 16:15:14 +01:00
soc ASoC: Updates for v5.6 2020-01-27 17:45:44 +01:00
sparc ALSA: sparc: More constifications 2020-01-05 16:14:56 +01:00
spi ALSA: spi: More constification 2020-01-05 16:15:13 +01:00
synth ALSA: emux: More constifications 2020-01-05 16:14:46 +01:00
usb Merge branch 'for-linus' into for-next 2020-01-26 09:31:41 +01:00
x86 ALSA: x86: Drop superfluous ioctl PCM ops 2019-12-11 07:25:34 +01:00
xen ALSA: xen: Drop superfluous ioctl PCM ops 2019-12-11 07:25:35 +01:00
ac97_bus.c ALSA: ac97: Treat snd_ac97_bus_ops as const 2020-01-03 09:24:08 +01:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
last.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Makefile
sound_core.c sound: fix a memory leak bug 2019-08-08 08:18:32 +02:00