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 00E41ECAAD8 for ; Thu, 1 Sep 2022 14:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232731AbiIAO65 (ORCPT ); Thu, 1 Sep 2022 10:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbiIAO6y (ORCPT ); Thu, 1 Sep 2022 10:58:54 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C9D82F95 for ; Thu, 1 Sep 2022 07:58:53 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id h204-20020a1c21d5000000b003a5b467c3abso1529879wmh.5 for ; Thu, 01 Sep 2022 07:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=l3pN9WTLDzQ+8KlJCzXudDXCI9w3a6U/8FEdLZWkej4=; b=t+yRLYgFAfpYbsBsNZOMWvUa+LWldRxgBE7fvUhpUuVzNEGpITBxg7Tlr5Zry9aMX8 Y93d//8aL++EZLaQkezBtD2T19ybIJm2DvG3BTRVMiRrUnOjFtruZU1gO0LD6xr/22Az x2khOiJ1T1ffUU4ouAzRCY2FW8hbhe+My9hIxFz1DsEhPG/UZ2srIXqgtx0WM36Lmf+L nOG+zyUHRCZD1byF3R7yiLjLcuyHA/R7pMJyFgyIpeLTGvY/ZlMUYWcagKpnRS18c7XH hirgSXStTeYhe/ozeOr7L8BlOvPb4B4Q96A7QR+cZMeIugzz8o1TRjpdxBqA5v0iIGku GR8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=l3pN9WTLDzQ+8KlJCzXudDXCI9w3a6U/8FEdLZWkej4=; b=bkuS3dHkLI/1JnRgpZYrhhiNWztmDcqhxviu/33WVA2sExWS4s65F/+3mwBACZG5Xf o1zzzdWf+nMuwm1ANfALgNEzPJge2V8Zxg0n3NMBjvQfk5OSxqOm27FAWOUowk7zapwc Mzk5jy+kzgDuJkaqBKc3YO9xcLcMMOvt9V1FXJfWdFI50BBqWYM4JcXrI4TxrhecozQn GtrifNqj06zf9h84sfpnsimem9n3LvIWHtuSqj60PQ8kUpdkV//j5Nj38Xi+GW1wPauF jO8/YHYNXwYgldcGueQr1s1+OPObC0G9XlEqRskFqLeMl2zv+7XOPEyAU8MrE1LwaYho y0aw== X-Gm-Message-State: ACgBeo1T/GMul7kYlN6cr01HNQ4iMJrKdUXeFX6Bh7dKTYSlLAtBQDfh 5x7NVLEGflo74jmnKk0TFB4exQ== X-Google-Smtp-Source: AA6agR40O+tmrN/8P8ot5nar8rBJAIDfzuJMk9lDEruG3cNSKjK9L5xlXYjGdR/2prsmMv8+9Kj0sQ== X-Received: by 2002:a05:600c:2909:b0:3a6:2ef5:772e with SMTP id i9-20020a05600c290900b003a62ef5772emr5414445wmd.16.1662044332316; Thu, 01 Sep 2022 07:58:52 -0700 (PDT) Received: from localhost ([95.148.15.66]) by smtp.gmail.com with ESMTPSA id n5-20020a05600c3b8500b003a319b67f64sm12398970wms.0.2022.09.01.07.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 07:58:51 -0700 (PDT) From: Punit Agrawal To: "Yuan, Perry" Cc: Punit Agrawal , "rafael.j.wysocki@intel.com" , "Huang, Ray" , "viresh.kumar@linaro.org" , "Sharma, Deepak" , "Limonciello, Mario" , "Fontenot, Nathan" , "Deucher, Alexander" , "Su, Jinzhou (Joe)" , "Huang, Shimmer" , "Du, Xiaojian" , "Meng, Li (Jassmine)" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 4/7] cpufreq: amd_pstate: fix wrong lowest perf fetch References: <20220814163548.326686-1-Perry.Yuan@amd.com> <20220814163548.326686-5-Perry.Yuan@amd.com> <87edxhim3j.fsf@stealth> Date: Thu, 01 Sep 2022 15:58:50 +0100 In-Reply-To: (Perry Yuan's message of "Wed, 31 Aug 2022 08:53:29 +0000") Message-ID: <87pmgfcf9x.fsf@stealth> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "Yuan, Perry" writes: [...] >> Perry Yuan writes: >> >> > Fix the wrong lowest perf value reading which is used for new des_perf >> > calculation by governor requested, the incorrect min_perf will get >> > incorrect des_perf to be set , that will cause the system frequency >> > changing unexpectedly. >> > >> > Reviewed-by: Huang Rui >> > Acked-by: Viresh Kumar >> > Signed-off-by: Perry Yuan >> > Signed-off-by: Su Jinzhou >> > --- >> > drivers/cpufreq/amd-pstate.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/drivers/cpufreq/amd-pstate.c >> > b/drivers/cpufreq/amd-pstate.c index 5cdef6638681..183cdd4ba00e 100644 >> > --- a/drivers/cpufreq/amd-pstate.c >> > +++ b/drivers/cpufreq/amd-pstate.c >> > @@ -307,7 +307,7 @@ static int amd_pstate_target(struct cpufreq_policy >> *policy, >> > return -ENODEV; >> > >> > cap_perf = READ_ONCE(cpudata->highest_perf); >> > - min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); >> > + min_perf = READ_ONCE(cpudata->lowest_perf); >> > max_perf = cap_perf; >> > >> > freqs.old = policy->cur; >> >> This looks to be a pretty big change (lowest nonlinear vs lowest). Does the patch >> need to be backported to older kernels? > > The patch fixes the min perf initial value, the correct min perf is lowest_perf which is captured through MSR_AMD_CPPC_CAP1 register or the cppc_get_perf_caps(). > Yes, the patch will need to be backported to other kernel branch as issue fix. Great, thanks for confirming! [...]