From patchwork Mon Feb 6 06:27:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1738022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=sc5oBCvm; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P9GX56Nnmz23y3 for ; Mon, 6 Feb 2023 17:27:33 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pOuyN-0006rf-Fo; Mon, 06 Feb 2023 06:27:27 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pOuyM-0006rD-No for kernel-team@lists.ubuntu.com; Mon, 06 Feb 2023 06:27:26 +0000 Received: from canonical.com (unknown [10.101.194.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 878C54214B for ; Mon, 6 Feb 2023 06:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675664846; bh=5q/AEj+HfhS7a1WDY4zx0iSoQYWExUDgyBliX8B2z/g=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sc5oBCvmhh5IHHruZqrBZ92okHdMggd34MnLSFcP1whAUjrzgBinhCAF3uQfTfyiD nmr1IblbDFxbkJPdhLHkPL8ouvetBTbalOJqdNLmSYIMEV4O+yJ/VJzyQ95Uo5YxgI RagyuIAbNUDbTwLJDZuIm/9zZSne4ElP7q9CF84ufCkuyJQ/LPdrVU72vXnQHosjev qFZ1sqKS6RD8ogOn3rF1xfDLrehAj8ai45I5SM29Pm7O3QoN0ATlsOnWBGFkh2yY+y otOCE2Rb7031OS+pkTGr0CF0gzbk/plYRhdaClSx2bv3xtXIXJThr3X4NvMU6N/fm/ vyLy7JfIAnz8Q== From: Ivan Hu To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/3][SRU][J] ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported Date: Mon, 6 Feb 2023 14:27:11 +0800 Message-Id: <20230206062712.10732-3-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230206062712.10732-1-ivan.hu@canonical.com> References: <20230206062712.10732-1-ivan.hu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Pierre Gondois BugLink: https://bugs.launchpad.net/bugs/2006077 The _OSC method allows the OS and firmware to communicate about supported features/capabitlities. It also allows the OS to take control of some features. In ACPI 6.4, s6.2.11.2 Platform-Wide OSPM Capabilities, the CPPC (resp. v2) bit should be set by the OS if it 'supports controlling processor performance via the interfaces described in the _CPC object'. The OS supports CPPC and parses the _CPC object only if CONFIG_ACPI_CPPC_LIB is set. Replace the x86 specific boot_cpu_has(X86_FEATURE_HWP) dynamic check with an arch generic CONFIG_ACPI_CPPC_LIB build-time check. Note: CONFIG_X86_INTEL_PSTATE selects CONFIG_ACPI_CPPC_LIB. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki (cherry picked from commit 72f2ecb7ece7c1d89758d4929d98e95d95fe7199) Signed-off-by: Ivan Hu --- drivers/acpi/bus.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 9bc5bc5bc359..b074930a3295 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -314,10 +314,11 @@ static void acpi_bus_osc_negotiate_platform_control(void) #endif #ifdef CONFIG_X86 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT; - if (boot_cpu_has(X86_FEATURE_HWP)) { - capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT; - capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT; - } +#endif + +#ifdef CONFIG_ACPI_CPPC_LIB + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT; + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT; #endif if (IS_ENABLED(CONFIG_SCHED_MC_PRIO)) @@ -340,10 +341,9 @@ static void acpi_bus_osc_negotiate_platform_control(void) return; } -#ifdef CONFIG_X86 - if (boot_cpu_has(X86_FEATURE_HWP)) - osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] & - (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT)); +#ifdef CONFIG_ACPI_CPPC_LIB + osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] & + (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT)); #endif /*