From nobody Sat Oct 18 02:15:33 2025 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 2AB78C4332F for ; Wed, 19 Oct 2022 11:03:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231241AbiJSLD0 (ORCPT ); Wed, 19 Oct 2022 07:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234770AbiJSLC7 (ORCPT ); Wed, 19 Oct 2022 07:02:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D17BA171CCF; Wed, 19 Oct 2022 03:32:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8AF86B8249D; Wed, 19 Oct 2022 09:07:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9DF5C433D6; Wed, 19 Oct 2022 09:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170470; bh=GYMheR2uDf5Pu2mG9xm6Hst+j27aQrPCPR8epawv2K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GZpVM1VASNxlV9WB3gSaYFs9If9Leo8Kd1EVovpCa4Lkp5mTH4QQEB7yA8oLbX/oD gBm25XdOmRkS/3mtNUx75wM8rpFch+5su6fQ9jEDpZT1NdOW9mW8EYS+vDZEjw+Fh/ 545m5uzeI7CKXhdzgOlb31iH2U6HlhoQf1mKVJ24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huang Rui , Viresh Kumar , Perry Yuan , Su Jinzhou , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.0 666/862] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Wed, 19 Oct 2022 10:32:33 +0200 Message-Id: <20221019083319.391323874@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Perry Yuan [ Upstream commit b185c5053c65b7704ead4537e4d4d9b33dc398dc ] 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- 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 365f3ad166a7..d63a28c5f95a 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -322,7 +322,7 @@ static int amd_pstate_target(struct cpufreq_policy *pol= icy, return -ENODEV; =20 cap_perf =3D READ_ONCE(cpudata->highest_perf); - min_perf =3D READ_ONCE(cpudata->lowest_nonlinear_perf); + min_perf =3D READ_ONCE(cpudata->lowest_perf); max_perf =3D cap_perf; =20 freqs.old =3D policy->cur; --=20 2.35.1