Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: <broonie@kernel.org>, <alsa-devel@alsa-project.org>,
	<linux-sound@vger.kernel.org>, <tiwai@suse.com>, <perex@perex.cz>,
	<jani.nikula@linux.intel.com>, <joonas.lahtinen@linux.intel.com>,
	<rodrigo.vivi@intel.com>, <tvrtko.ursulin@linux.intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<amadeuszx.slawinski@linux.intel.com>,
	<pierre-louis.bossart@linux.intel.com>, <hdegoede@redhat.com>
Subject: Re: [PATCH v2 2/4] ASoC: codecs: hda: Skip HDMI/DP registration if i915 is missing
Date: Fri, 23 Feb 2024 18:09:59 +0100	[thread overview]
Message-ID: <19f57fc4-ae64-4054-a85c-38ff37c1bded@intel.com> (raw)
In-Reply-To: <87plwn2qbs.wl-tiwai@suse.de>

On 2024-02-23 3:44 PM, Takashi Iwai wrote:
> On Fri, 23 Feb 2024 12:46:24 +0100,
> Cezary Rojewski wrote:
>>
>> If i915 does not support given platform but the hardware i.e.: HDAudio
>> codec is still there, the codec-probing procedure will succeed for such
>> device but the follow up initialization will always end up with -ENODEV.
>>
>> While bus could filter out address '2' which Intel's HDMI/DP codecs
>> always enumerate on, more robust approach is to check for i915 presence
>> before registering display codecs.
>>
>> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
>> ---
>>   sound/soc/codecs/hda.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/sound/soc/codecs/hda.c b/sound/soc/codecs/hda.c
>> index d2117e36ddd1..d9e7cd8aada2 100644
>> --- a/sound/soc/codecs/hda.c
>> +++ b/sound/soc/codecs/hda.c
>> @@ -350,6 +350,11 @@ static int hda_hdev_attach(struct hdac_device *hdev)
>>   	struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
>>   	struct snd_soc_component_driver *comp_drv;
>>   
>> +	if (hda_codec_is_display(codec) && !hdev->bus->audio_component) {
>> +		dev_dbg(&hdev->dev, "no i915, skip registration for 0x%08x\n", hdev->vendor_id);
>> +		return 0;
> 
> Should we return success here, or would it better with -ENODEV?
> IIUC, the code path is from the early hda_codec_driver_probe() hook,
> so returning an error can work.

Good suggestion. Indeed attach() is called by probe() which treats 
-ENODEV just fine.

There is a consequence to that though. Logs from LKF show:

snd_soc_hda_codec:hda_hdev_attach: snd_hda_codec_hdmi hdaudioB0D2: no 
i915, skip registration for 0x80862811
snd_soc_hda_codec:hda_hdev_attach: snd_hda_codec_generic hdaudioB0D2: no 
i915, skip registration for 0x80862811
snd_soc_hda_codec:hda_hdev_attach: snd_hda_codec_generic hdaudioB0D2: no 
i915, skip registration for 0x80862811
snd_hda_codec:snd_hda_codec_configure: hdaudio hdaudioB0D2: Unable to 
bind the codec
snd_soc_avs 0000:00:1f.3: failed to config codec -19
snd_soc_avs 0000:00:1f.3: Codec #2 probe error; disabling it...

i.e.: three attempts. One for HDMI via codec_bind_module() and two from 
codec_bind_generic(). Situation on CNL-based is different - two logs, no 
error. The reason for this is lack of codec->preset in LKF case.

Should I add stub entries for ICL-HP/LKF to patch_hdmi.c to address this?

HDA_CODEC_ENTRY(0x80862810, "Icelake-P HDMI",  NULL),
HDA_CODEC_ENTRY(0x80862811, "Lakefield HDMI",  NULL),


Czarek

  reply	other threads:[~2024-02-23 17:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 11:46 [PATCH v2 0/4] ALSA/ASoC: Conditionally skip i915 init and cleanups Cezary Rojewski
2024-02-23 11:46 ` [PATCH v2 1/4] ALSA: hda: Skip i915 initialization on CNL/LKF-based platforms Cezary Rojewski
2024-02-23 13:49   ` Rodrigo Vivi
2024-02-26 10:40   ` Jani Nikula
2024-02-26 12:25     ` Cezary Rojewski
2024-02-23 11:46 ` [PATCH v2 2/4] ASoC: codecs: hda: Skip HDMI/DP registration if i915 is missing Cezary Rojewski
2024-02-23 14:44   ` Takashi Iwai
2024-02-23 17:09     ` Cezary Rojewski [this message]
2024-02-26 11:09       ` Takashi Iwai
2024-02-26 12:33         ` Cezary Rojewski
2024-02-23 11:46 ` [PATCH v2 3/4] ASoC: codecs: hda: Cleanup error messages Cezary Rojewski
2024-02-23 11:46 ` [PATCH v2 4/4] ALSA: hda: Reuse for_each_pcm_streams() Cezary Rojewski
2024-02-23 14:50 ` [PATCH v2 0/4] ALSA/ASoC: Conditionally skip i915 init and cleanups Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19f57fc4-ae64-4054-a85c-38ff37c1bded@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox