From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71D11C43334 for ; Thu, 23 Jun 2022 01:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235060AbiFWBLv (ORCPT ); Wed, 22 Jun 2022 21:11:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbiFWBLs (ORCPT ); Wed, 22 Jun 2022 21:11:48 -0400 Received: from ZXSHCAS1.zhaoxin.com (ZXSHCAS1.zhaoxin.com [210.0.225.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7B830F68; Wed, 22 Jun 2022 18:11:46 -0700 (PDT) Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 09:11:44 +0800 Received: from [10.32.64.1] (10.32.64.1) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 09:11:42 +0800 Subject: Re: [PATCH] cpufreq: Add Zhaoxin turbo boost control interface support To: "Rafael J. Wysocki" CC: Viresh Kumar , Linux PM , Linux Kernel Mailing List , , , , References: <8b748cc6-09c9-081c-c0c5-2e75f017b032@zhaoxin.com> From: Tony W Wang-oc Message-ID: Date: Thu, 23 Jun 2022 09:11:43 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.32.64.1] X-ClientProxiedBy: ZXSHCAS2.zhaoxin.com (10.28.252.162) To zxbjmbx1.zhaoxin.com (10.29.252.163) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/6/2022 21:39, Rafael J. Wysocki wrote: > On Wed, Jun 22, 2022 at 5:44 AM Tony W Wang-oc wrote: >> >> Recent Zhaoxin CPUs support X86_FEATURE_IDA and the turbo boost can >> be dynamically enabled or disabled through MSR 0x1a0[38] in the same >> way as Intel. So add turbo boost control support for Zhaoxin too. > > And for Centaur too according to the code changes below. Ok, thanks a lot. > >> >> Signed-off-by: Tony W Wang-oc >> --- >> drivers/cpufreq/acpi-cpufreq.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c >> index 3d514b8..1bb2b90 100644 >> --- a/drivers/cpufreq/acpi-cpufreq.c >> +++ b/drivers/cpufreq/acpi-cpufreq.c >> @@ -78,6 +78,8 @@ static bool boost_state(unsigned int cpu) >> >> switch (boot_cpu_data.x86_vendor) { >> case X86_VENDOR_INTEL: >> + case X86_VENDOR_CENTAUR: >> + case X86_VENDOR_ZHAOXIN: >> rdmsr_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &lo, &hi); >> msr = lo | ((u64)hi << 32); >> return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE); >> @@ -97,6 +99,8 @@ static int boost_set_msr(bool enable) >> >> switch (boot_cpu_data.x86_vendor) { >> case X86_VENDOR_INTEL: >> + case X86_VENDOR_CENTAUR: >> + case X86_VENDOR_ZHAOXIN: >> msr_addr = MSR_IA32_MISC_ENABLE; >> msr_mask = MSR_IA32_MISC_ENABLE_TURBO_DISABLE; >> break; >> -- >> 2.7.4 > . > -- Sincerely TonyWWang-oc