Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4854334iog; Wed, 22 Jun 2022 07:08:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sFCimdSisrmDC8XV6yAs0T/LizeIQqFcCIoIAfQPLzBe6iAMQe/GbKiMn6SDKQyugS3KA+ X-Received: by 2002:a05:6a00:3498:b0:525:448a:de0 with SMTP id cp24-20020a056a00349800b00525448a0de0mr3935937pfb.85.1655906903366; Wed, 22 Jun 2022 07:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655906903; cv=none; d=google.com; s=arc-20160816; b=ChuedgA0FJVTsuAr20CIgKqHWuQajnA9hK8uQXDJpQOASUWC9nwB0k70j/DQCeTPYY 3cuzIrna79YD/cOIoTybUu4bkO0dmu9sVMM8yOqQqeSVeOpekUNfqTMCK3ls4Wc63qe8 ObiT8XlpeYeiqWUcL4t9KQJSFYCzl2gGRQ4ahPxbjz9ZB5e2mYLd36CnwOMqDVXHwaEU 4wY+I3M4CJqDee9mXlkI58t370rX3xAP9JZ2hnY7piN+hCRA2qf5VLMk5wAc2GacI72e ndsNSESr4/nDw9SukUKPaC8wPwt5FajcrVJGA3U7cstMLrdomT4b6Ju4jSgSYgWw+dSS o/bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=QWDg0rhyoZvpLGpAqxxEbA8VkAjLaf+fxygRl5YnWAo=; b=CcGRhkQrsckja/RELgSI67mASWi7shJTLqsYErefLdQOZV+rMZPahjK/d9c9gXNIiP uye3FnE/UwzKFDYbu2n2cUjC3fsAP+2I1IfyJi5QEur3RIfQfxRHNk1EaoBLBNSfPocX YlCTzkc1N4Edpr0xVaMxCsHUQblzdKSNG4xyUx84ruuvVRvH02uYORgT0Za5stBAKbZ6 kA/LuAg9yhHNjP3GwW5piadx0GH/iEN8vlZzMPkgRgC3nbywwXHYgxLnix77GiPq9tl6 tQuukurHWVsZAORXLxp6wcDzrGH2APsNYO5Cuazg/NJEdPs5LfKasZ2L5umlYs+vk4++ IDZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mn6-20020a17090b188600b001ec9e904597si11042440pjb.27.2022.06.22.07.08.09; Wed, 22 Jun 2022 07:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356462AbiFVNkG (ORCPT + 99 others); Wed, 22 Jun 2022 09:40:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355133AbiFVNkC (ORCPT ); Wed, 22 Jun 2022 09:40:02 -0400 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C2A121816; Wed, 22 Jun 2022 06:40:01 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id r3so30252346ybr.6; Wed, 22 Jun 2022 06:40:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QWDg0rhyoZvpLGpAqxxEbA8VkAjLaf+fxygRl5YnWAo=; b=voLxEs8HPNIYm2jdQWC/XV1R0cPFew9gkojHnC1QyjXhFWfsQEcM3fLjquv7S5YLyH +P+o0CPXsbA5aatNwFKshTGm871EpGQOufZsN05Ar21fk20/lZfXKgGJE6rUUKJk7Jnq drwACxAKoYgW9dCJTl4tcnXwc5eS4+38K4GRCUObDqAC+iqcFTkktJF6KV06XA1gnyi8 zxK5i7Jg/hbJYBJKQdbFRfni7r5bySVCTfLYqKDuIcHs9FvF9cirkTmi4pr98cRpzr8R zgWR+1QcWtwem3nSwAeyqnttUPkCjYwV2jFGiQBaOCoMdAld1Es5wrVVnOWPzGlFVXLo W4nw== X-Gm-Message-State: AJIora/NbQaT5n71MPoZulibCWbhvooLgEiynQNSmd2aysGzTcBmICd3 3sBuRJDrCPvCuyRPO5amhIS7O7CMTMUwPikhczU= X-Received: by 2002:a05:6902:1141:b0:669:3f2a:c6bb with SMTP id p1-20020a056902114100b006693f2ac6bbmr3828070ybu.365.1655905200472; Wed, 22 Jun 2022 06:40:00 -0700 (PDT) MIME-Version: 1.0 References: <8b748cc6-09c9-081c-c0c5-2e75f017b032@zhaoxin.com> In-Reply-To: <8b748cc6-09c9-081c-c0c5-2e75f017b032@zhaoxin.com> From: "Rafael J. Wysocki" Date: Wed, 22 Jun 2022 15:39:49 +0200 Message-ID: Subject: Re: [PATCH] cpufreq: Add Zhaoxin turbo boost control interface support To: Tony W Wang-oc Cc: "Rafael J. Wysocki" , Viresh Kumar , Linux PM , Linux Kernel Mailing List , CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LindaChai@zhaoxin.com, LeoLiu@zhaoxin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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