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 X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C863C43462 for ; Wed, 12 May 2021 22:38:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC8AC6142C for ; Wed, 12 May 2021 22:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349525AbhELWiz (ORCPT ); Wed, 12 May 2021 18:38:55 -0400 Received: from mail.ispras.ru ([83.149.199.84]:37386 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443603AbhELWff (ORCPT ); Wed, 12 May 2021 18:35:35 -0400 Received: from monopod.intra.ispras.ru (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id CF6394076B2A; Wed, 12 May 2021 22:34:22 +0000 (UTC) Date: Thu, 13 May 2021 01:34:22 +0300 (MSK) From: Alexander Monakov To: Huang Rui cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Deucher , Jason Bagavatsingham , "Pierre-Loup A . Griffais" , Nathan Fontenot , "Rafael J . Wysocki" , Borislav Petkov , x86@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some specific generations In-Reply-To: <20210425073451.2557394-1-ray.huang@amd.com> Message-ID: References: <20210425073451.2557394-1-ray.huang@amd.com> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 25 Apr 2021, Huang Rui wrote: > Some AMD Ryzen generations has different calculation method on maximum > perf. 255 is not for all asics, some specific generations should use 166 > as the maximum perf. Otherwise, it will report incorrect frequency value > like below: The commit message says '255', but the code: > --- a/arch/x86/kernel/cpu/amd.c > +++ b/arch/x86/kernel/cpu/amd.c > @@ -1170,3 +1170,19 @@ void set_dr_addr_mask(unsigned long mask, int dr) > break; > } > } > + > +u32 amd_get_highest_perf(void) > +{ > + struct cpuinfo_x86 *c = &boot_cpu_data; > + > + if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) || > + (c->x86_model >= 0x70 && c->x86_model < 0x80))) > + return 166; > + > + if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) || > + (c->x86_model >= 0x40 && c->x86_model < 0x70))) > + return 166; > + > + return 225; > +} says 225? This is probably a typo? In any case they are out of sync. Alexander