From patchwork Wed Oct 19 08:32:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp264016wrs; Wed, 19 Oct 2022 04:19:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4t9i1BRuAH4wFzLnrVr51vNkAjfeNyamSLMPu0Hc+q8wFSh846zoR2GhecOmaCZDjzA3rw X-Received: by 2002:a05:6402:159a:b0:458:d744:8975 with SMTP id c26-20020a056402159a00b00458d7448975mr7011290edv.200.1666178352828; Wed, 19 Oct 2022 04:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178352; cv=none; d=google.com; s=arc-20160816; b=yCuuPjSJ1incCIQcYeeggBEOM7B5Cu22NiheC5pQdRUXj1xcztmmENgi9s8o98s4nW VQ4LI8D0hhI8l5+YoEftOWXu3mSl9hej75AcNG93Tu8Krfs5KsvgVnrwxY7TGjr3rWqV F8UXPR1XdCA1fmJIRpn5SYtFMu9Nx4hqltcDIq0lzueondmbWPGLclF/IyxEkKargRMA lMu7wYF/mlJBf8dhsAezryr+9Ry754NrlDvhM286bjp4FelUs3lUIBkb0DaFxg806lfE TBqAXitKNLw29SZNeAloX2b96CJfVQnfELQo+RWTCGfHfk5hyt/I0twJC073h5rJ6aay tCTw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a05640235d600b00458d43beac7si17228840edc.41.2022.10.19.04.18.17; Wed, 19 Oct 2022 04:19:12 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747114632660404658?= X-GMAIL-MSGID: =?utf-8?q?1747114632660404658?= 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;