linux_dsm_epyc7002/sound/soc/sof
Keyon Jie 7fd572e7d3
ASoC: SOF: Intel: hda-stream: fix a deadlock with bus->reg_lock
We should use irq disabled mode when read/write hda registers from
thread context, as we need to hold the same bus->reg_lock in interrupt
context hda_dsp_stream_interrupt(), otherwise, when we are holding the
lock in hda_dsp_stream_hw_free() and the interrupt arrives, we will get
deadlock in the interrupt handler.

Error logs like this:

[    5.603606]        CPU0
[    5.603606]        ----
[    5.603607]   lock(&(&bus->reg_lock)->rlock);
[    5.603608]   <Interrupt>
[    5.603609]     lock(&(&bus->reg_lock)->rlock);
[    5.603610]
                *** DEADLOCK ***

[    5.603611] 2 locks held by pulseaudio/2329:
[    5.603612]  #0: 000000005fcf26c6 (&card->mutex/1){+.+.}, at: dpcm_fe_dai_hw_free+0x2b/0x110 [snd_soc_core]
[    5.603619]  #1: 00000000ef369faf (&rtd->pcm_mutex){+.+.}, at: soc_pcm_hw_free+0x2e/0x1c0 [snd_soc_core]

The fix is simple, let's switch to use spin_lock/unlock_irq().

Reported-by: Xun Zhang <xun2.zhang@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-17 13:44:50 +01:00
..
intel ASoC: SOF: Intel: hda-stream: fix a deadlock with bus->reg_lock 2019-06-17 13:44:50 +01:00
xtensa ASoC: SOF: fix DSP oops definitions in FW ABI 2019-06-03 17:56:38 +01:00
control.c ASoC: SOF: dont wake dsp up in kcontrol IO 2019-06-13 19:56:07 +01:00
core.c ASoC: SOF: core: fix error handling with the probe workqueue 2019-05-28 15:47:19 +01:00
debug.c ASoC: SOF: debug: add new debugfs entries for IPC flood test 2019-06-03 18:59:07 +01:00
ipc.c ASoC: SOF: ipc: clarify operator precedence 2019-06-13 19:54:38 +01:00
Kconfig ASoC: SOF: debug: add new debugfs entries for IPC flood test 2019-06-03 18:59:07 +01:00
loader.c ASoC: SOF: add mode parameter for snd_sof_debugfs_buf_item 2019-06-03 17:47:13 +01:00
Makefile ASoC: SOF: Add Build support for SOF core and Intel drivers 2019-04-28 02:51:46 +09:00
nocodec.c ASoC: sof: use modern dai_link style 2019-06-06 22:10:38 +01:00
ops.c ASoC: SOF: Fix a compile warning with CONFIG_PCI=n 2019-05-07 11:23:57 +09:00
ops.h ASoC: SOF: Intel: hda: couple host and link DMA during FE hw_free 2019-06-17 13:44:15 +01:00
pcm.c ASoC: SOF: Intel: hda: couple host and link DMA during FE hw_free 2019-06-17 13:44:15 +01:00
pm.c ASoC: SOF: Intel: hda: release link DMA for paused streams during suspend 2019-06-17 13:43:48 +01:00
sof-acpi-dev.c ASoC: Intel: use common helpers to detect CPUs 2019-05-30 16:33:26 +01:00
sof-pci-dev.c ASoC: SOF: add COMPILE_TEST for PCI options 2019-05-30 16:35:26 +01:00
sof-priv.h ASoC: SOF: Intel: hda: couple host and link DMA during FE hw_free 2019-06-17 13:44:15 +01:00
topology.c ASoC: SOF: Intel: hda: assign link DMA channel at run-time 2019-06-17 13:37:16 +01:00
trace.c ASoC: SOF: send time stamp to FW for alignment 2019-06-03 18:41:23 +01:00
utils.c ASoC: SOF: Add utils 2019-04-28 02:49:47 +09:00