Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1321822pxu; Fri, 16 Oct 2020 09:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc8rJW9niEwQ0tWkZWozBGnSaUKUBUqhDl4RMbxk6k7PvSbcV3tQUD2Nb/dXcuYdY0N7H8 X-Received: by 2002:a19:c142:: with SMTP id r63mr1519976lff.234.1602864536226; Fri, 16 Oct 2020 09:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602864536; cv=none; d=google.com; s=arc-20160816; b=ISCIsMna1xzLhxIrDjHSfhtTacYuFluSkdFXy2fPv2S00VYeoGwHezBd1QHDsAJ53P pQsS003L0uU3ZDZxYGtfhJFy8Xod3nbQCECucoktRGj2CNIdLiVIonpe9KGFyX3IaRdF hTvMJVSqnJmZoPrt42gY22Ljfo1UO6lnp/NVUWeZgX09EILGDzrKl9tu/TlXYjXtIkMy IS1FLg0tOqi1chs1Ap1gQD7EGZ7LrbDaLf27kcPTSeAcg+Vykr6KHyREfiuvbkesOUUa YcEYakoIV8y+C4wQ9V9yVsICDzJK8VQOcfqNU1+opyL8ZQwz5hR7JRtYaJzBHgHhZ7Gp Jhdg== 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=52P5CCJjU8JsAThqwGL00Sl+HuNSijfO2WktQIA1FOs=; b=fOE5h+iw4Wc+W26BhW35jbmk9DNf4oTLYy8zYqMc7mu5livfzXr5D5tXIW/TvGX5wR tT2cgw9f71XF2S9fOtm9fEKU50NiKy8BkH2cPz/GbaEZH1H0cqO/DmgfHoK00k/ULEZM ClfaONZZ0utjwnURWadgb45iflK9Psnbu9HTU6lQL8WK40I9CLeFERB6UssJpL2X2vQI FLPh9UFzkAEyj0Ilqc2Ykw43rAda3RyXGBznSGdzxEDYxe2VV4tq4IGiB+eO/9xzw4jn CJO2pFThOboHP3dy59m7KtRcX/WPik6tdQ/0dEZpbncb6VMF2hdnk3Ec6SIGZF6m1tyJ LfOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si1955088ejf.349.2020.10.16.09.08.33; Fri, 16 Oct 2020 09:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2409668AbgJPO6a (ORCPT + 99 others); Fri, 16 Oct 2020 10:58:30 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:44997 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406936AbgJPO62 (ORCPT ); Fri, 16 Oct 2020 10:58:28 -0400 Received: by mail-oi1-f195.google.com with SMTP id x62so2709913oix.11; Fri, 16 Oct 2020 07:58:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=52P5CCJjU8JsAThqwGL00Sl+HuNSijfO2WktQIA1FOs=; b=IG0K1MpKSGCk/zT4pCMftJ00p4OPEHdkOURfhNc2VgzoxVErFKKBu2feIaOYrET2So 6wyW9hsW7iOBNDtSG0hZ2aZBcjKT3LF9M23t7tRsFUmdbxBXPQX/cldOoWCBaVygFC/J h/eKqIHTNtiC37hJM7gL3pSIxOAOhe0OIzJbZOzDCQS482CRVoLS/v1ch8E+YcahY2Fl khh8QvnyCbEfX6Lv0fA2wd3JSpaR4wO3lK+BMnEKkxtfyv91Ab2/O94gtL9nkokmOgFy ML6vrbROKRLL9UKamtZ15dSSlihg+++h/18/DUHE2aTim/vVMu0sGh+9Vrmu3FAg6tGq DeBA== X-Gm-Message-State: AOAM531jNubtIXZcrmdHgRuUiDs5w82DbQxRV0+j0GKnXxdTbibLc/gc KDeeVWJkPYclxWfRwuMkDbked9xoUSFxvinpY2K8UCad1sw= X-Received: by 2002:aca:724a:: with SMTP id p71mr2747907oic.157.1602860307729; Fri, 16 Oct 2020 07:58:27 -0700 (PDT) MIME-Version: 1.0 References: <20201007204412.565881-1-wei.huang2@amd.com> In-Reply-To: <20201007204412.565881-1-wei.huang2@amd.com> From: "Rafael J. Wysocki" Date: Fri, 16 Oct 2020 16:58:16 +0200 Message-ID: Subject: Re: [PATCH 1/1] acpi-cpufreq: Honor _PSD table setting in CPU frequency control To: Wei Huang Cc: Linux Kernel Mailing List , "Rafael J. Wysocki" , Viresh Kumar , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 7, 2020 at 10:44 PM Wei Huang wrote: > > acpi-cpufreq has a old quirk that overrides the _PSD table supplied by > BIOS on AMD CPUs. However the _PSD table of new AMD CPUs (Family 19h+) > now accurately reports the P-state dependency of CPU cores. Hence this > quirk needs to be fixed in order to support new CPUs' frequency control. > > Fixes: acd316248205 ("acpi-cpufreq: Add quirk to disable _PSD usage on all AMD CPUs") > Signed-off-by: Wei Huang > --- > drivers/cpufreq/acpi-cpufreq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > index e4ff681faaaa..1e6e2abde428 100644 > --- a/drivers/cpufreq/acpi-cpufreq.c > +++ b/drivers/cpufreq/acpi-cpufreq.c > @@ -691,7 +691,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) > cpumask_copy(policy->cpus, topology_core_cpumask(cpu)); > } > > - if (check_amd_hwpstate_cpu(cpu) && !acpi_pstate_strict) { > + if (check_amd_hwpstate_cpu(cpu) && (c->x86 < 0x19) && Why don't you use boot_cpu_data instead of *c? And why don't you do the extra check in check_amd_hwpstate_cpu()? Also the parens around it are not necessary here and is there any chance for having a proper symbol instead of the raw 0x19 in that check? > + !acpi_pstate_strict) { > cpumask_clear(policy->cpus); > cpumask_set_cpu(cpu, policy->cpus); > cpumask_copy(data->freqdomain_cpus, > -- > 2.26.2 >