Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp933644rwi; Wed, 19 Oct 2022 04:57:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6jdbbuK0R4fheaRz3kWxmh+23CdBjUwXMVSBSnprflVUZpjyuKBfnbT9BFASh9JOY9AP7I X-Received: by 2002:a17:906:cc58:b0:78d:d47e:19f2 with SMTP id mm24-20020a170906cc5800b0078dd47e19f2mr6381604ejb.388.1666180654344; Wed, 19 Oct 2022 04:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180654; cv=none; d=google.com; s=arc-20160816; b=Y69OoMe+W8cHt0IJmK422hcb78r2KKQrhkDjbIejUXzMW+lsxA0izZi1QnrEpwyafb TvTJe4psGbF3iZWdlNkwTbE+ehDaTf/3eRp1DNsxRLhVOcKsPEmqKo/o3XSzZlHOQnjn 6HmmeBwHZAQjLWhVNy1/seeVP2Sw5AWkZ/bD7NNMlmBVwYIU1sKKmzQmYEI5zkxby/t/ Nt+88OhCGExB2TjttAwPmy7GWlr6l7Ub2SFqX7ZwO3euJVv6ktYBjgaWoB5yCyJ0VoEK v4ynxog52W04Ge//hqT56WCGhXPK7Ar2AQfCvxYRDBRDLKP2pwp7owE8NnX5sJI4T2du Ikpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=56JKciz4SiEApXUJTwD43HaUclDvuqghf+HfwdyEQPc=; b=xJXmCr5mEvvaJ66yqc5Owbce7uJ+dRJ+48iu8fVhm0NT8fMd6y6ga+r+co1SN7VHn+ J4f2+30aPwJpeFl+5CwQI8FqlBOgsCoKXgCCNyEr9jnnbW8D9iKdj8Hnel14JGClrNFR yzg8sSHRb8Qc0Pj74MAaseBxkTOdwuGCteXHcw/5z/nr11MFzANFaPNNWpREafnYJTpM aLOFZZf9N3ysmDo9QNqpdLa4ALaYO9cv5vGuQ2U5NQducfM1S9rcqJ5adyPu5eLfHu99 qmzwJvp/0TIr3pMry0vCS4cwdlioLv2xkOId69J4a+xtZX62zx4BgoKsCux2ihzaVLDK +7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GZpVM1VA; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a056402190c00b0045d9a3adf48si8646632edz.591.2022.10.19.04.57.02; Wed, 19 Oct 2022 04:57:34 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GZpVM1VA; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230118AbiJSLDX (ORCPT + 99 others); Wed, 19 Oct 2022 07:03:23 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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 *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; -- 2.35.1