alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
@ 2020-04-20 20:54 Kai Vehmanen
  2020-04-21 18:03 ` Mark Brown
  2020-04-21 18:53 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Kai Vehmanen @ 2020-04-20 20:54 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: hui.wang, Ranjani Sridharan, jaska.uimonen, Kai Vehmanen,
	Pierre-Louis Bossart

Recent fix for jack detection caused a regression on systems with HDA
audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel
oops at device probe. On these systems, HDA bus instance lookup fails,
as the first ASoC runtime of the card is connected to a dummy codec
(as no HDMI codec is present).

Fixes: 3a24f135e6cc ("ASoC: intel/skl/hda - set autosuspend timeout for hda codecs")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/intel/boards/skl_hda_dsp_generic.c | 34 +++++++++++---------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
index 35f222ed9912..fc9290fb4e99 100644
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -172,23 +172,25 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 
 static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card)
 {
-	struct snd_soc_pcm_runtime *rtd =
-		list_first_entry(&card->rtd_list,
-				 struct snd_soc_pcm_runtime, list);
-	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_pcm_runtime *rtd;
 	struct hdac_hda_priv *hda_pvt;
-
-	if (!codec_dai)
-		return;
-
-	/*
-	 * all codecs are on the same bus, so it's sufficient
-	 * to lookup the first runtime and its codec, and set
-	 * power save defaults for all codecs on the bus
-	 */
-	hda_pvt = snd_soc_component_get_drvdata(codec_dai->component);
-	snd_hda_set_power_save(hda_pvt->codec.bus,
-			       HDA_CODEC_AUTOSUSPEND_DELAY_MS);
+	struct snd_soc_dai *dai;
+
+	for_each_card_rtds(card, rtd) {
+		if (!strstr(rtd->dai_link->codecs->name, "ehdaudio"))
+			continue;
+		dai = asoc_rtd_to_codec(rtd, 0);
+		hda_pvt = snd_soc_component_get_drvdata(dai->component);
+		if (hda_pvt) {
+			/*
+			 * all codecs are on the same bus, so it's sufficient
+			 * to look up only the first one
+			 */
+			snd_hda_set_power_save(hda_pvt->codec.bus,
+					       HDA_CODEC_AUTOSUSPEND_DELAY_MS);
+			break;
+		}
+	}
 }
 
 static int skl_hda_audio_probe(struct platform_device *pdev)
-- 
2.26.0


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

* Re: [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
  2020-04-20 20:54 [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec Kai Vehmanen
@ 2020-04-21 18:03 ` Mark Brown
  2020-04-21 18:15   ` Pierre-Louis Bossart
  2020-04-21 18:53 ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2020-04-21 18:03 UTC (permalink / raw)
  To: Kai Vehmanen
  Cc: hui.wang, Pierre-Louis Bossart, alsa-devel, Ranjani Sridharan,
	jaska.uimonen

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

On Mon, Apr 20, 2020 at 11:54:31PM +0300, Kai Vehmanen wrote:
> Recent fix for jack detection caused a regression on systems with HDA
> audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel
> oops at device probe. On these systems, HDA bus instance lookup fails,
> as the first ASoC runtime of the card is connected to a dummy codec
> (as no HDMI codec is present).

This still doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
  2020-04-21 18:03 ` Mark Brown
@ 2020-04-21 18:15   ` Pierre-Louis Bossart
  2020-04-21 18:29     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-21 18:15 UTC (permalink / raw)
  To: Mark Brown, Kai Vehmanen
  Cc: hui.wang, alsa-devel, Ranjani Sridharan, jaska.uimonen



On 4/21/20 1:03 PM, Mark Brown wrote:
> On Mon, Apr 20, 2020 at 11:54:31PM +0300, Kai Vehmanen wrote:
>> Recent fix for jack detection caused a regression on systems with HDA
>> audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel
>> oops at device probe. On these systems, HDA bus instance lookup fails,
>> as the first ASoC runtime of the card is connected to a dummy codec
>> (as no HDMI codec is present).
> 
> This still doesn't apply against current code, please check and resend.

works for me with git am on the for-next and for-5.8 branches? The patch 
does not indeed apply on for-5.7 but not sure if this was the intended 
target?

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

* Re: [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
  2020-04-21 18:15   ` Pierre-Louis Bossart
@ 2020-04-21 18:29     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-21 18:29 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: hui.wang, alsa-devel, Ranjani Sridharan, Kai Vehmanen, jaska.uimonen

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Tue, Apr 21, 2020 at 01:15:30PM -0500, Pierre-Louis Bossart wrote:
> On 4/21/20 1:03 PM, Mark Brown wrote:

> > This still doesn't apply against current code, please check and resend.

> works for me with git am on the for-next and for-5.8 branches? The patch
> does not indeed apply on for-5.7 but not sure if this was the intended
> target?

Ah, my script for checking what branch a fix is in was broken by all the
x86 build breaks keeping the ASoC tree out of -next :(

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
  2020-04-20 20:54 [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec Kai Vehmanen
  2020-04-21 18:03 ` Mark Brown
@ 2020-04-21 18:53 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-21 18:53 UTC (permalink / raw)
  To: alsa-devel, Kai Vehmanen
  Cc: hui.wang, Pierre-Louis Bossart, Ranjani Sridharan, jaska.uimonen

On Mon, 20 Apr 2020 23:54:31 +0300, Kai Vehmanen wrote:
> Recent fix for jack detection caused a regression on systems with HDA
> audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel
> oops at device probe. On these systems, HDA bus instance lookup fails,
> as the first ASoC runtime of the card is connected to a dummy codec
> (as no HDMI codec is present).
> 
> Fixes: 3a24f135e6cc ("ASoC: intel/skl/hda - set autosuspend timeout for hda codecs")
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8

Thanks!

[1/1] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec
      commit: 5bf73b1b1deca46c7459cb4d732ba8bad6da93c5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2020-04-21 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 20:54 [PATCH v2] ASoC: intel/skl/hda - fix oops on systems without i915 audio codec Kai Vehmanen
2020-04-21 18:03 ` Mark Brown
2020-04-21 18:15   ` Pierre-Louis Bossart
2020-04-21 18:29     ` Mark Brown
2020-04-21 18:53 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).