summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwi@linutronix.de>2026-03-27 05:15:15 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2026-03-28 02:27:11 +0300
commit93a1f0e61329f538cfc7122d7fa0e7a1803e326d (patch)
tree76024df6b0cec8eef9251ad1239ee89d9e16ea53
parent584d752b8a1f0ee3a7d5a831e55623c10e7ca0ee (diff)
downloadlinux-93a1f0e61329f538cfc7122d7fa0e7a1803e326d.tar.xz
ASoC: Intel: avs: Check maximum valid CPUID leaf
The Intel AVS driver queries CPUID(0x15) before checking if the CPUID leaf is available. Check the maximum-valid CPU standard leaf beforehand. Use the CPUID_LEAF_TSC macro instead of the custom local one for the CPUID(0x15) leaf number. Fixes: cbe37a4d2b3c ("ASoC: Intel: avs: Configure basefw on TGL-based platforms") Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20260327021645.555257-2-darwi@linutronix.de
-rw-r--r--sound/soc/intel/avs/tgl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/intel/avs/tgl.c b/sound/soc/intel/avs/tgl.c
index afb066516101..4649d749b41e 100644
--- a/sound/soc/intel/avs/tgl.c
+++ b/sound/soc/intel/avs/tgl.c
@@ -11,8 +11,6 @@
#include "debug.h"
#include "messages.h"
-#define CPUID_TSC_LEAF 0x15
-
static int avs_tgl_dsp_core_power(struct avs_dev *adev, u32 core_mask, bool power)
{
core_mask &= AVS_MAIN_CORE_MASK;
@@ -49,7 +47,11 @@ static int avs_tgl_config_basefw(struct avs_dev *adev)
unsigned int ecx;
#include <asm/cpuid/api.h>
- ecx = cpuid_ecx(CPUID_TSC_LEAF);
+
+ if (boot_cpu_data.cpuid_level < CPUID_LEAF_TSC)
+ goto no_cpuid;
+
+ ecx = cpuid_ecx(CPUID_LEAF_TSC);
if (ecx) {
ret = avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(ecx), &ecx);
if (ret)
@@ -57,6 +59,7 @@ static int avs_tgl_config_basefw(struct avs_dev *adev)
}
#endif
+no_cpuid:
hwid.device = pci->device;
hwid.subsystem = pci->subsystem_vendor | (pci->subsystem_device << 16);
hwid.revision = pci->revision;