Skip to content

Commit 7e16c12

Browse files
Ahmed S. Darwishgregkh
authored andcommitted
ASoC: Intel: avs: Check maximum valid CPUID leaf
[ Upstream commit 93a1f0e ] 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: cbe37a4 ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e2a2781 commit 7e16c12

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

sound/soc/intel/avs/tgl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "debug.h"
1212
#include "messages.h"
1313

14-
#define CPUID_TSC_LEAF 0x15
15-
1614
static int avs_tgl_dsp_core_power(struct avs_dev *adev, u32 core_mask, bool power)
1715
{
1816
core_mask &= AVS_MAIN_CORE_MASK;
@@ -49,14 +47,19 @@ static int avs_tgl_config_basefw(struct avs_dev *adev)
4947
unsigned int ecx;
5048

5149
#include <asm/cpuid/api.h>
52-
ecx = cpuid_ecx(CPUID_TSC_LEAF);
50+
51+
if (boot_cpu_data.cpuid_level < CPUID_LEAF_TSC)
52+
goto no_cpuid;
53+
54+
ecx = cpuid_ecx(CPUID_LEAF_TSC);
5355
if (ecx) {
5456
ret = avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(ecx), &ecx);
5557
if (ret)
5658
return AVS_IPC_RET(ret);
5759
}
5860
#endif
5961

62+
no_cpuid:
6063
hwid.device = pci->device;
6164
hwid.subsystem = pci->subsystem_vendor | (pci->subsystem_device << 16);
6265
hwid.revision = pci->revision;

0 commit comments

Comments
 (0)