public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK
@ 2021-12-22 14:53 Ville Syrjala
  2021-12-22 16:57 ` Kai Vehmanen
  2021-12-25  8:17 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Ville Syrjala @ 2021-12-22 14:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: intel-gfx, stable, Harsha Priya, Emmanuel Jillela, Kai Vehmanen,
	Takashi Iwai

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The silent stream stuff recurses back into i915 audio
component .get_power() from the .pin_eld_notify() hook.
On GLK this will deadlock as i915 may already be holding
the relevant modeset locks during .pin_eld_notify() and
the GLK audio vs. CDCLK workaround will try to grab the
same locks from .get_power().

Until someone comes up with a better fix just disable the
silent stream support on GLK.

Cc: stable@vger.kernel.org
Cc: Harsha Priya <harshapriya.n@intel.com>
Cc: Emmanuel Jillela <emmanuel.jillela@intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2623
Fixes: 951894cf30f4 ("ALSA: hda/hdmi: Add Intel silent stream support")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 415701bd10ac..ffcde7409d2a 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2947,7 +2947,8 @@ static int parse_intel_hdmi(struct hda_codec *codec)
 
 /* Intel Haswell and onwards; audio component with eld notifier */
 static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid,
-				 const int *port_map, int port_num, int dev_num)
+				 const int *port_map, int port_num, int dev_num,
+				 bool send_silent_stream)
 {
 	struct hdmi_spec *spec;
 	int err;
@@ -2980,7 +2981,7 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid,
 	 * Enable silent stream feature, if it is enabled via
 	 * module param or Kconfig option
 	 */
-	if (enable_silent_stream)
+	if (send_silent_stream)
 		spec->send_silent_stream = true;
 
 	return parse_intel_hdmi(codec);
@@ -2988,12 +2989,18 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid,
 
 static int patch_i915_hsw_hdmi(struct hda_codec *codec)
 {
-	return intel_hsw_common_init(codec, 0x08, NULL, 0, 3);
+	return intel_hsw_common_init(codec, 0x08, NULL, 0, 3,
+				     enable_silent_stream);
 }
 
 static int patch_i915_glk_hdmi(struct hda_codec *codec)
 {
-	return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3);
+	/*
+	 * Silent stream calls audio component .get_power() from
+	 * .pin_eld_notify(). On GLK this will deadlock in i915 due
+	 * to the audio vs. CDCLK workaround.
+	 */
+	return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3, false);
 }
 
 static int patch_i915_icl_hdmi(struct hda_codec *codec)
@@ -3004,7 +3011,8 @@ static int patch_i915_icl_hdmi(struct hda_codec *codec)
 	 */
 	static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb};
 
-	return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3);
+	return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3,
+				     enable_silent_stream);
 }
 
 static int patch_i915_tgl_hdmi(struct hda_codec *codec)
@@ -3016,7 +3024,8 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec)
 	static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
 	int ret;
 
-	ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4);
+	ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
+				    enable_silent_stream);
 	if (!ret) {
 		struct hdmi_spec *spec = codec->spec;
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK
  2021-12-22 14:53 [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK Ville Syrjala
@ 2021-12-22 16:57 ` Kai Vehmanen
  2021-12-25  8:17 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Kai Vehmanen @ 2021-12-22 16:57 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: alsa-devel, intel-gfx, stable, Harsha Priya, Emmanuel Jillela,
	Kai Vehmanen, Takashi Iwai

Hi,

On Wed, 22 Dec 2021, Ville Syrjala wrote:

> The silent stream stuff recurses back into i915 audio
> component .get_power() from the .pin_eld_notify() hook.
> On GLK this will deadlock as i915 may already be holding
> the relevant modeset locks during .pin_eld_notify() and
> the GLK audio vs. CDCLK workaround will try to grab the
> same locks from .get_power().
>
> Until someone comes up with a better fix just disable the
> silent stream support on GLK.

decoupling the call to get_power() is a non-trivial change
(especially as it's done from generic hda_codec.c code),
so I'd say let's go with this patch for GLK:

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

Br, Kai

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK
  2021-12-22 14:53 [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK Ville Syrjala
  2021-12-22 16:57 ` Kai Vehmanen
@ 2021-12-25  8:17 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2021-12-25  8:17 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: alsa-devel, intel-gfx, stable, Harsha Priya, Emmanuel Jillela,
	Kai Vehmanen

On Wed, 22 Dec 2021 15:53:50 +0100,
Ville Syrjala wrote:
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The silent stream stuff recurses back into i915 audio
> component .get_power() from the .pin_eld_notify() hook.
> On GLK this will deadlock as i915 may already be holding
> the relevant modeset locks during .pin_eld_notify() and
> the GLK audio vs. CDCLK workaround will try to grab the
> same locks from .get_power().
> 
> Until someone comes up with a better fix just disable the
> silent stream support on GLK.
> 
> Cc: stable@vger.kernel.org
> Cc: Harsha Priya <harshapriya.n@intel.com>
> Cc: Emmanuel Jillela <emmanuel.jillela@intel.com>
> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Cc: Takashi Iwai <tiwai@suse.de>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2623
> Fixes: 951894cf30f4 ("ALSA: hda/hdmi: Add Intel silent stream support")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-25  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-22 14:53 [PATCH] ALSA: hda/hdmi: Disable silent stream on GLK Ville Syrjala
2021-12-22 16:57 ` Kai Vehmanen
2021-12-25  8:17 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox