linux/sound/pci
Takashi Iwai 222bde0388 ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug
The recent change in HD-audio HDMI/DP codec driver for allowing the
dynamic PCM binding introduced a new spec->pcm_mutex.  One of the
protected area by this mutex is hdmi_present_sense().  As reported by
Intel CI tests, unfortunately, the new mutex causes a deadlock when
the hotplug/unplug is triggered during the codec is in runtime
suspend.  The buggy code path is like the following:

  hdmi_unsol_event() -> ...
    -> hdmi_present_sense()
==>     ** here taking pcm_mutex
      -> hdmi_present_sense_via_verbs()
        -> snd_hda_power_up_pm() -> ... (runtime resume calls)
          -> generic_hdmi_resume()
            -> hdmi_present_sense()
==>           ** here taking pcm_mutex again!

As we can see here, the problem is that the mutex is taken before
snd_hda_power_up_pm() call that triggers the runtime resume.  That is,
the obvious solution is to move the power up/down call outside the
mutex; it is exactly what this patch provides.

The patch also clarifies why this bug wasn't caught beforehand.  We
used to have the i915 audio component for hotplug for all Intel chips,
and in that code path, there is no power up required but the
information is taken directly from the graphics side.  However, we
recently switched back to the old method for some old Intel chips due
to regressions, and now the deadlock issue is surfaced.

Fixes: a76056f2e5 ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug')
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-17 15:38:35 +01:00
..
ac97 ALSA: ac97: Fix ifdef CONFIG_PROC_FS 2015-05-29 07:52:43 +02:00
ali5451 ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
asihpi x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
au88x0 ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
aw2 ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
ca0106 ALSA: ca0106: Fix/cleanup ifdef CONFIG_PROC_FS 2015-05-29 07:54:45 +02:00
cs46xx ALSA: cs46xx: Fix suspend for all channels 2015-10-30 12:33:21 +01:00
cs5535audio ALSA: cs5535audio: constify cs5535audio_dma_ops structures 2015-12-30 22:49:40 +01:00
ctxfi ALSA: ctxfi: constify rsc ops structures 2015-11-11 08:40:56 +01:00
echoaudio ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
emu10k1 ALSA: emu10k1: correctly handling failed thread creation 2016-01-29 17:30:25 +01:00
hda ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug 2016-03-17 15:38:35 +01:00
ice1712 ALSA: i2c: constify snd_i2c_ops structures 2015-11-30 11:40:08 +01:00
korg1212 ALSA: korg1212: Use snd_pcm_hw_constraint_single() 2015-10-21 14:24:27 +02:00
lola ALSA: Deletion of checks before the function call "iounmap" 2015-01-04 15:13:45 +01:00
lx6464es ALSA: lx6464es: Use snd_pcm_hw_constraint_single() 2015-10-21 14:24:28 +02:00
mixart ALSA: mixart: silence an uninitialized variable warning 2016-03-16 16:35:16 +01:00
nm256 ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
oxygen ALSA: oxygen: Fix logical-not-parentheses warning 2015-08-03 10:15:09 +02:00
pcxhr ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
riptide ALSA: off by one bug in snd_riptide_joystick_probe() 2015-02-09 14:57:15 +01:00
rme9652 ALSA: hdsp: Fix wrong boolean ctl value accesses 2016-02-29 18:13:34 +01:00
trident ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
vx222 ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
ymfpci ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
ad1889.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
ad1889.h
ak4531_codec.c ALSA: pci: Drop superfluous ifdef CONFIG_PROC_FS 2015-05-29 08:00:06 +02:00
als300.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
als4000.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
atiixp_modem.c ALSA: atiixp: constify atiixp_dma_ops structures 2015-12-30 22:49:37 +01:00
atiixp.c ALSA: atiixp: constify atiixp_dma_ops structures 2015-12-30 22:49:37 +01:00
azt3328.c ALSA: azt3328: Remove unnecessary synchronize_irq() before free_irq() 2015-11-21 17:40:07 +01:00
azt3328.h
bt87x.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
cmipci.c ALSA: pci: Drop superfluous ifdef CONFIG_PROC_FS 2015-05-29 08:00:06 +02:00
cs4281.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
cs5530.c ASoC: sb16: Simplify snd_sb16dsp_pcm() 2015-01-02 16:28:35 +01:00
ens1370.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
ens1371.c
es1938.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
es1968.c [media] media, sound: tea575x: constify snd_tea575x_ops structures 2015-12-03 11:26:45 -02:00
fm801.c sound updates for 4.5-rc1 2016-01-17 12:05:31 -08:00
intel8x0.c ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41. 2016-03-14 08:24:25 +01:00
intel8x0m.c ALSA: pci: Drop superfluous ifdef CONFIG_PROC_FS 2015-05-29 08:00:06 +02:00
Kconfig ALSA: jack: Allow building the jack layer without input device 2016-02-23 09:03:07 +01:00
maestro3.c ALSA: maestro3: Fix Allegro mute until master volume/mute is touched 2015-11-02 08:46:30 +01:00
Makefile ALSA: Add the driver for Digigram Lola PCI-e boards 2011-05-03 16:31:05 +02:00
rme32.c ALSA: rme32: Use snd_pcm_hw_constraint_single() 2015-10-21 14:24:28 +02:00
rme96.c ALSA: rme96: Fix unexpected volume reset after rate changes 2015-12-04 20:39:49 +01:00
sis7019.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
sis7019.h
sonicvibes.c ALSA: remove deprecated use of pci api 2015-04-16 12:19:52 +02:00
via82xx_modem.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
via82xx.c ALSA: Use const struct ac97_quirk 2015-04-05 08:41:05 +02:00