* [PATCH] ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback
@ 2025-12-10 13:15 Takashi Iwai
2025-12-10 13:39 ` Péter Ujfalusi
0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2025-12-10 13:15 UTC (permalink / raw)
To: linux-sound; +Cc: sound-open-firmware, Askar Safin
When config table entries don't match with the device to be probed,
currently we fall back to SND_INTEL_DSP_DRIVER_ANY, which means to
allow any drivers to bind with it.
This was set so with the assumption (or hope) that all controller
drivers should cover the devices generally, but in practice, this
caused a problem as reported recently. Namely, when a specific
kconfig for SOF isn't set for the modern Intel chips like Alderlake,
a wrong driver (AVS) got probed and failed. This is because we have
entries like:
#if IS_ENABLED(CONFIG_SND_SOC_SOF_ALDERLAKE)
/* Alder Lake / Raptor Lake */
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
.device = PCI_DEVICE_ID_INTEL_HDA_ADL_S,
},
....
#endif
so this entry is effective only when CONFIG_SND_SOC_SOF_ALDERLAKE is
set. If not set, there is no matching entry, hence it returns
SND_INTEL_DSP_DRIVER_ANY as fallback. OTOH, if the kconfig is set, it
explicitly falls back to SND_INTEL_DSP_DRIVER_LEGACY when no DMIC or
SoundWire is found -- that was the working scenario. That being said,
the current setup may be broken for modern Intel chips that are
supposed to work with either SOF or legacy driver when the
corresponding kconfig were missing.
For addressing the problem above, this patch changes the fallback
driver to the legacy driver, i.e. return SND_INTEL_DSP_DRIVER_LEGACY
type as much as possible. When CONFIG_SND_HDA_INTEL is also disabled,
the fallback is set to SND_INTEL_DSP_DRIVER_ANY type, just to be sure.
Reported-by: Askar Safin <safinaskar@gmail.com>
Closes: https://lore.kernel.org/all/20251014034156.4480-1-safinaskar@gmail.com/
Tested-by: Askar Safin <safinaskar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/hda/core/intel-dsp-config.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/hda/core/intel-dsp-config.c b/sound/hda/core/intel-dsp-config.c
index c401c0658421..0c25e87408de 100644
--- a/sound/hda/core/intel-dsp-config.c
+++ b/sound/hda/core/intel-dsp-config.c
@@ -718,7 +718,8 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
/* find the configuration for the specific device */
cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table));
if (!cfg)
- return SND_INTEL_DSP_DRIVER_ANY;
+ return IS_ENABLED(CONFIG_SND_HDA_INTEL) ?
+ SND_INTEL_DSP_DRIVER_LEGACY : SND_INTEL_DSP_DRIVER_ANY;
if (cfg->flags & FLAG_SOF) {
if (cfg->flags & FLAG_SOF_ONLY_IF_SOUNDWIRE &&
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback
2025-12-10 13:15 [PATCH] ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback Takashi Iwai
@ 2025-12-10 13:39 ` Péter Ujfalusi
0 siblings, 0 replies; 2+ messages in thread
From: Péter Ujfalusi @ 2025-12-10 13:39 UTC (permalink / raw)
To: Takashi Iwai, linux-sound; +Cc: sound-open-firmware, Askar Safin
On 10/12/2025 15:15, Takashi Iwai wrote:
> When config table entries don't match with the device to be probed,
> currently we fall back to SND_INTEL_DSP_DRIVER_ANY, which means to
> allow any drivers to bind with it.
>
> This was set so with the assumption (or hope) that all controller
> drivers should cover the devices generally, but in practice, this
> caused a problem as reported recently. Namely, when a specific
> kconfig for SOF isn't set for the modern Intel chips like Alderlake,
> a wrong driver (AVS) got probed and failed. This is because we have
> entries like:
>
> #if IS_ENABLED(CONFIG_SND_SOC_SOF_ALDERLAKE)
> /* Alder Lake / Raptor Lake */
> {
> .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
> .device = PCI_DEVICE_ID_INTEL_HDA_ADL_S,
> },
> ....
> #endif
>
> so this entry is effective only when CONFIG_SND_SOC_SOF_ALDERLAKE is
> set. If not set, there is no matching entry, hence it returns
> SND_INTEL_DSP_DRIVER_ANY as fallback. OTOH, if the kconfig is set, it
> explicitly falls back to SND_INTEL_DSP_DRIVER_LEGACY when no DMIC or
> SoundWire is found -- that was the working scenario. That being said,
> the current setup may be broken for modern Intel chips that are
> supposed to work with either SOF or legacy driver when the
> corresponding kconfig were missing.
>
> For addressing the problem above, this patch changes the fallback
> driver to the legacy driver, i.e. return SND_INTEL_DSP_DRIVER_LEGACY
> type as much as possible. When CONFIG_SND_HDA_INTEL is also disabled,
> the fallback is set to SND_INTEL_DSP_DRIVER_ANY type, just to be sure.
Makes sense.
> Reported-by: Askar Safin <safinaskar@gmail.com>
> Closes: https://lore.kernel.org/all/20251014034156.4480-1-safinaskar@gmail.com/
> Tested-by: Askar Safin <safinaskar@gmail.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ---
> sound/hda/core/intel-dsp-config.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/hda/core/intel-dsp-config.c b/sound/hda/core/intel-dsp-config.c
> index c401c0658421..0c25e87408de 100644
> --- a/sound/hda/core/intel-dsp-config.c
> +++ b/sound/hda/core/intel-dsp-config.c
> @@ -718,7 +718,8 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
> /* find the configuration for the specific device */
> cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table));
> if (!cfg)
> - return SND_INTEL_DSP_DRIVER_ANY;
> + return IS_ENABLED(CONFIG_SND_HDA_INTEL) ?
> + SND_INTEL_DSP_DRIVER_LEGACY : SND_INTEL_DSP_DRIVER_ANY;
>
> if (cfg->flags & FLAG_SOF) {
> if (cfg->flags & FLAG_SOF_ONLY_IF_SOUNDWIRE &&
--
Péter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-10 13:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10 13:15 [PATCH] ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback Takashi Iwai
2025-12-10 13:39 ` Péter Ujfalusi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox