From nobody Thu Apr 2 14:09:50 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7192D2877F7; Fri, 27 Mar 2026 23:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774655543; cv=none; b=WvS2XQ+hBu/yZowJnayRFl139p4MpDKMHfbPcxR4PmHNIPqaQX19YPdLj7AZVVjWiYbRGFH3jay3Yf8SO+dG/KulS+dCyfmTSaVDG/Hzg9GOJqOY7UERfpCJO6TnisEpttNScQFry0Dy6hXDzDr63RRs+/EDgbviCW0Oy1YJdw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774655543; c=relaxed/simple; bh=N5c1Xb+acxUIBqOiE1LmKZMTSXh1pan36UFZCXP/dio=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=hv6Efns4KGCWICJd7Y13Dk/Xv31uIPDVHhWIXas7c+hwyZmaFVepww0uT2Oof3iG8256tRPA5/hp8m32IfAKNSN2Y/AYcZDIVXYHDCsDmOTFe+XzjBgoAJDVs/wfj+4+qQjF4pGzR3q0CfH+B3O706h8a9F5Q0jp5HxehqY7cUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zYToHcP+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0BP8jsjU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zYToHcP+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0BP8jsjU" Date: Fri, 27 Mar 2026 23:52:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774655539; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5KZASh8KA0mXhn34hUK4hV0BGaULMosye7d1kvvwWc=; b=zYToHcP+4ER5xlc6/xtHxMZ39t0B4AQTbFyE121kVryjGaWgF4I4RMsqIIhM2c8B1e7izM GQwfrFFpezQVjP9ztpT+2JDW3wLXqH3/oaFQGXuKIYzoEhvRGbSiHjF3gnY0MLGRD1+u10 eCwa8zsEA4UgeVuwNSlD1nsrCaWf9BrSev3fA+JemsefnXShOOpCiSQL7fNTcYkDphQiHq HhKjXTMlHqMB9avHW9XaGfW+5xOzWbSPoPSb3OZC+oOXFakQ2BmBSW9TLNdC+sI+WbDoLD oxQH5qXX7yHf2rnVCtZd7XZKr652OQua1UB+nMOYpIxYOlI0PZkAMEDzn/ytlw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774655539; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m5KZASh8KA0mXhn34hUK4hV0BGaULMosye7d1kvvwWc=; b=0BP8jsjU6UdS6/YAP5cC8OmL4CA3D7cm2GKRtV88g90cpu2m8GUhrpjYHXChyhHkxHjEUd /oFQWKvge0rVf5CQ== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] ASoC: Intel: avs: Include CPUID header at file scope Cc: Borislav Petkov , "Ahmed S. Darwish" , Cezary Rojewski , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177465553374.1647592.4182013451621395213.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 7f78e0b46e9984e955cb73ffada8dace8b4dd059 Gitweb: https://git.kernel.org/tip/7f78e0b46e9984e955cb73ffada8dace8= b4dd059 Author: Ahmed S. Darwish AuthorDate: Fri, 27 Mar 2026 03:15:16 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Sat, 28 Mar 2026 00:29:30 +01:00 ASoC: Intel: avs: Include CPUID header at file scope Commit cbe37a4d2b3c ("ASoC: Intel: avs: Configure basefw on TGL-based platform= s") includes the main CPUID header from within a C function. This works by luck and forbids valid refactoring inside that header. Include the CPUID header at file scope instead. Remove the COMPILE_TEST build flag so that the CONFIG_X86 conditionals can be removed. The driver gets enough compilation testing already on x86. For clarity, refactor the CPUID(0x15) code into its own function without changing any of the driver's logic. Fixes: cbe37a4d2b3c ("ASoC: Intel: avs: Configure basefw on TGL-based platf= orms") Suggested-by: Borislav Petkov # CONFIG_X86 removal Signed-off-by: Ahmed S. Darwish Signed-off-by: Borislav Petkov (AMD) Acked-by: Cezary Rojewski Link: https://lore.kernel.org/all/20250612234010.572636-3-darwi@linutronix.= de --- sound/soc/intel/Kconfig | 2 +- sound/soc/intel/avs/tgl.c | 37 ++++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index 412555e..6336736 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig @@ -95,7 +95,7 @@ config SND_SOC_INTEL_KEEMBAY =20 config SND_SOC_INTEL_AVS tristate "Intel AVS driver" - depends on X86 || COMPILE_TEST + depends on X86 depends on PCI depends on COMMON_CLK select ACPI_NHLT if ACPI diff --git a/sound/soc/intel/avs/tgl.c b/sound/soc/intel/avs/tgl.c index 4649d74..a712363 100644 --- a/sound/soc/intel/avs/tgl.c +++ b/sound/soc/intel/avs/tgl.c @@ -7,6 +7,7 @@ // =20 #include +#include #include "avs.h" #include "debug.h" #include "messages.h" @@ -38,28 +39,38 @@ static int avs_tgl_dsp_core_stall(struct avs_dev *adev,= u32 core_mask, bool stal return avs_dsp_core_stall(adev, core_mask, stall); } =20 -static int avs_tgl_config_basefw(struct avs_dev *adev) +/* + * Succeed if CPUID(0x15) is not available, or if the nominal core crystal= clock + * frequency cannot be enumerated from it. There is nothing to do in both= cases. + */ +static int avs_tgl_set_xtal_freq(struct avs_dev *adev) { - struct pci_dev *pci =3D adev->base.pci; - struct avs_bus_hwid hwid; + unsigned int freq; int ret; -#ifdef CONFIG_X86 - unsigned int ecx; - -#include =20 if (boot_cpu_data.cpuid_level < CPUID_LEAF_TSC) - goto no_cpuid; + return 0; =20 - ecx =3D cpuid_ecx(CPUID_LEAF_TSC); - if (ecx) { - ret =3D avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(e= cx), &ecx); + freq =3D cpuid_ecx(CPUID_LEAF_TSC); + if (freq) { + ret =3D avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(f= req), &freq); if (ret) return AVS_IPC_RET(ret); } -#endif =20 -no_cpuid: + return 0; +} + +static int avs_tgl_config_basefw(struct avs_dev *adev) +{ + struct pci_dev *pci =3D adev->base.pci; + struct avs_bus_hwid hwid; + int ret; + + ret =3D avs_tgl_set_xtal_freq(adev); + if (ret) + return ret; + hwid.device =3D pci->device; hwid.subsystem =3D pci->subsystem_vendor | (pci->subsystem_device << 16); hwid.revision =3D pci->revision;