All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/hdmi: fix warning about PCM count when used with SOF
@ 2022-04-14 15:05 Kai Vehmanen
  2022-04-15  7:21 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Vehmanen @ 2022-04-14 15:05 UTC (permalink / raw)
  To: alsa-devel, tiwai; +Cc: Mohan Kumar, kai.vehmanen, pierre-louis.bossart

With commit 13046370c4d1 ("ALSA: hda/hdmi: let new platforms assign the
pcm slot dynamically"), old behaviour to consider the HDA pin number,
when choosing PCM to assign, was dropped.

Build on this change and limit the number of PCMs created to number of
converters (= maximum number of concurrent display/receivers) when
"mst_no_extra_pcms" and "dyn_pcm_no_legacy" quirks are both set.

Fix the check in hdmi_find_pcm_slot() to ensure only spec->pcm_used
entries are considered in the search. Elsewhere in the driver
spec->pcm_used is already checked properly.

Doing this avoids following warning at SOF driver probe for multiple
machine drivers:

[  112.425297] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
PCM in topology for HDMI converter 4
[  112.425298] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
PCM in topology for HDMI converter 5
[  112.425299] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
PCM in topology for HDMI converter 6

BugLink: https://github.com/thesofproject/linux/issues/2573
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 3e086eebf88d..f9d67058d69d 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1395,7 +1395,7 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec,
 
  last_try:
 	/* the last try; check the empty slots in pins */
-	for (i = 0; i < spec->num_nids; i++) {
+	for (i = 0; i < spec->pcm_used; i++) {
 		if (!test_bit(i, &spec->pcm_bitmap))
 			return i;
 	}
@@ -2325,7 +2325,9 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
 	 * dev_num is the device entry number in a pin
 	 */
 
-	if (codec->mst_no_extra_pcms)
+	if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
+		pcm_num = spec->num_cvts;
+	else if (codec->mst_no_extra_pcms)
 		pcm_num = spec->num_nids;
 	else
 		pcm_num = spec->num_nids + spec->dev_num - 1;

base-commit: 4516d04608b40d9ad150df6c2faef4a12d038ff6
-- 
2.35.1


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

* Re: [PATCH] ALSA: hda/hdmi: fix warning about PCM count when used with SOF
  2022-04-14 15:05 [PATCH] ALSA: hda/hdmi: fix warning about PCM count when used with SOF Kai Vehmanen
@ 2022-04-15  7:21 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2022-04-15  7:21 UTC (permalink / raw)
  To: Kai Vehmanen; +Cc: alsa-devel, Mohan Kumar, pierre-louis.bossart

On Thu, 14 Apr 2022 17:05:16 +0200,
Kai Vehmanen wrote:
> 
> With commit 13046370c4d1 ("ALSA: hda/hdmi: let new platforms assign the
> pcm slot dynamically"), old behaviour to consider the HDA pin number,
> when choosing PCM to assign, was dropped.
> 
> Build on this change and limit the number of PCMs created to number of
> converters (= maximum number of concurrent display/receivers) when
> "mst_no_extra_pcms" and "dyn_pcm_no_legacy" quirks are both set.
> 
> Fix the check in hdmi_find_pcm_slot() to ensure only spec->pcm_used
> entries are considered in the search. Elsewhere in the driver
> spec->pcm_used is already checked properly.
> 
> Doing this avoids following warning at SOF driver probe for multiple
> machine drivers:
> 
> [  112.425297] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
> PCM in topology for HDMI converter 4
> [  112.425298] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
> PCM in topology for HDMI converter 5
> [  112.425299] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no
> PCM in topology for HDMI converter 6
> 
> BugLink: https://github.com/thesofproject/linux/issues/2573
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

Thanks, applied now.


Takashi

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

end of thread, other threads:[~2022-04-15  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 15:05 [PATCH] ALSA: hda/hdmi: fix warning about PCM count when used with SOF Kai Vehmanen
2022-04-15  7:21 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.