From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382431; b=GlgK4rc10S4ZxA/JJqIj1Mt37la2+xbG8h6drnXmBEpLQvEhXnYal7ntJs1+uAysxJ0j 0ucIFV0rNvnv5rHppXzTEgIgRylxel8pgatP6Z4EmoRfpc9n0B0l8CnsdXed39E8lLOYD 43ztBxT36Dr6CczgtalMKXfJdR2Q5w9eE8nuESr8yEFEloehaP9FNL4hciMS7C26mEKOO /SpF9J6HzQpKQLOm1g67JWN0d14cH3gMVsfCCCbqK/AwFNIVIw6virS0TNJWlp8XMpv5s SXT/3YYArmmlaN5KlQcR5URswl2rleo67ODC/l419BnvU9eLd3S4vQi0yXZlyRfxdOA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382431; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=GxKfREKqxr1fzn4vmsaenBvdvEAukBmjEkHG/ObOohM=; b=znlxeZtqCQSq9n3WhyxFQPsxj7JE38OkeJc/Wh3lqzHFjbpCAGu2I5scle36vnDu3aVL legxs85lfSLTtIKzCbzkw/zIbb1qWo2m9tMpuUMgxi95G9bsQe/ixgEYSjuHcguzXsVaZ fcE+5ooNliCVIxjqMrFSPUMqExm2h/CKVnpIPt9aCv6lndkJTH7i38IfjJbRnsSlcmwzv 2YAaT30PfIdmQWKXIusSUJ0uiagZgrazUSErCpnV/okcf8t5dACda4e766ba5v9jB2geE PCsPoL0K945OrDpt6Rzk8Hh7+49vlNxrn7P+VWo0LgqmGK4QIoDcT29NJ9BkP2vFqQw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=T6daAFnT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E9A1606A339; Fri, 4 Dec 2026 11:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=T6daAFnT Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5FDA1F00936; Fri, 4 Dec 2026 11:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382431; bh=GxKfREKqxr1fzn4vmsaenBvdvEAukBmjEkHG/ObOohM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T6daAFnTyFF8yFC3jRBzGQZyo9NOi7ea43pjFDG96b01/ifXpm9qsKJs9OGR9IyWu Y4RQ8H7EiwfsogyiC7/7/e2M3fbuWSHYv1j59ZPLJos1nlR3WZ2iBG5zOmjEqD1byC yT1Nxo81oAI5Mfytb1yW2bANjoKa61undKlPIxkk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sumit Gupta , Christian Loehle , "Rafael J. Wysocki" Subject: [PATCH 6.18 409/703] cpufreq: CPPC: Set CPPC Enable register in cpu_init() Date: Fri, 4 Dec 2026 19:05:08 +0900 Message-ID: <20261204100638.710654277@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sumit Gupta commit 7cca01c39cc89f6ef39079484d26b6d99287a610 upstream. As per ACPI 6.x s8.4.6.1.4 (CPPC Enable Register): "If supported by the platform, OSPM writes a one to this register to enable CPPC on this processor. If not implemented, OSPM assumes the platform always has CPPC enabled." The driver never writes this register. CPPC therefore stays disabled on platforms such as NVIDIA GB10 that wait for OSPM to enable it. Call cppc_set_enable() in cppc_cpufreq_cpu_init(). Fail init if enabling CPPC fails. If init fails after CPPC is enabled, disable it again. The register is optional, so -EOPNOTSUPP is not an error. Fixes: 5477fb3bd1e8 ("ACPI / CPPC: Add a CPUFreq driver for use with CPPC") Cc: All applicable # ab482f1bac6b "ACPI: CPPC: Refactor register value get and set ABIs" Signed-off-by: Sumit Gupta Reviewed-by: Christian Loehle [ rjw: Subject tweak ] Link: https://patch.msgid.link/20261110101246.3665797-1-sumitg@nvidia.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/cppc_cpufreq.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -633,7 +633,17 @@ static int cppc_cpufreq_cpu_init(struct pr_debug("Unsupported CPU co-ord type: %d\n", policy->shared_type); ret = -EFAULT; - goto out; + goto out_put; + } + + /* + * Enable CPPC. The Enable register is optional - some platforms + * may not support it. + */ + ret = cppc_set_enable(cpu, true); + if (ret && ret != -EOPNOTSUPP) { + pr_err("Failed to enable CPPC for CPU%u (%d)\n", cpu, ret); + goto out_put; } policy->fast_switch_possible = cppc_allow_fast_switch(); @@ -661,6 +671,8 @@ static int cppc_cpufreq_cpu_init(struct return 0; out: + cppc_set_enable(cpu, false); +out_put: cppc_cpufreq_put_cpu_data(policy); return ret; }