Re: [PATCH 23/27] ALSA: hda/hdmi: Rewrite to new probe method

Takashi Iwai
2025-08-18T07:18:58Z

On Sun, 17 Aug 2025 12:55:48 +0200,
Mikhail Paulyshka wrote:
>
> On 7/9/25 7:04 PM, Takashi Iwai wrote:
> > diff --git a/sound/hda/codecs/hdmi/intelhdmi.c b/sound/hda/codecs/hdmi/intelhdmi.c
> > index a88ac1f80db6..23237d527430 100644
> > --- a/sound/hda/codecs/hdmi/intelhdmi.c
> > +++ b/sound/hda/codecs/hdmi/intelhdmi.c
> > @@ -701,51 +698,104 @@ static int patch_i915_byt_hdmi(struct hda_codec *codec)
> > }
> > /* Intel IronLake, SandyBIridge and IvyBridge; with eld notifier
> > */
> > -static int patch_i915_cpt_hdmi(struct hda_codec *codec)
> > +static int probe_i915_cpt_hdmi(struct hda_codec *codec)
> > +{
> > + return parse_intel_hdmi(codec);
> > +}
> > +
> > +/*
> > + * common driver probe
> > + */
> > +static int intelhdmi_probe(struct hda_codec *codec, const struct hda_device_id *id)
> > {
> > int err;
> > err = alloc_intel_hdmi(codec);
> > if (err < 0)
> > return err;
> > - return parse_intel_hdmi(codec);
> > +
> > + switch (id->driver_data) {
> > + case MODEL_HSW:
> > + err = probe_i915_hsw_hdmi(codec);
> > + break;
> > + case MODEL_GLK:
> > + err = probe_i915_glk_hdmi(codec);
> > + break;
> > + case MODEL_ICL:
> > + err = probe_i915_icl_hdmi(codec);
> > + break;
> > + case MODEL_TGL:
> > + err = probe_i915_tgl_hdmi(codec);
> > + break;
> > + case MODEL_ADLP:
> > + err = probe_i915_adlp_hdmi(codec);
> > + break;
> > + case MODEL_BYT:
> > + err = probe_i915_byt_hdmi(codec);
> > + break;
> > + case MODEL_CPT:
> > + err = probe_i915_cpt_hdmi(codec);
> > + break;
> > + default:
> > + err = -EINVAL;
> > + break;
> > + }
> > +
> > + if (err < 0) {
> > + snd_hda_hdmi_generic_spec_free(codec);
>
> Is this the intended behavior? It modifies the codec state even when
> it does not match any Intel model. We have reports from users on
> 6.17-rc1 with AMD BC-250 hardware experiencing HDMI audio detection
> issues. Adding a check for |EINVAL| resolves the problem.

Have you enabled CONFIG_SND_HDA_CODEC_HDMI_ATI?

The probe of intelhdmi.c is only for Intel chips, and no other devices
will be probed, as you can find in snd_hda_id_intelhdmi[] array.

thanks,

Takashi