ASoC: hdac_hdmi: Offload dapm update at jack detection
authorTakashi Iwai <tiwai@suse.de>
Fri, 9 Aug 2019 15:15:31 +0000 (17:15 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 9 Aug 2019 17:02:03 +0000 (18:02 +0100)
commit332ccf00bf85adbf48015084be0e60f5cc57a055
tree70fc59c76bee493af49ac281ed41adad822db377
parent804cbf4bb063204ca6c2471baa694548aab02ce3
ASoC: hdac_hdmi: Offload dapm update at jack detection

hdac_hdmi_present_sense() calls the audio component to get ELD update,
then it reports the jack status change and updates DAPM graph
accordingly.  This works when it's called from the normal code paths.

However, it may lead to a dead lock when it's called from the audio
component notifier.  Namely, the DAPM update involves with the runtime
PM, and it eventually calls again the audio component get_power()
ops.  Since i915 driver already takes a mutex around the audio
component ops calls, we'll eventually get the mutex doubly.

As a workaround, in this patch, only the jack state is updated in the
code path from hdac_hdmi_eld_notify_cb(), and the DAPM update is
deferred to a work so that it's processed in another context.

Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20190809151531.24359-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdac_hdmi.c