From patchwork Sat Oct 22 07:27:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7576 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106250wrr; Sat, 22 Oct 2022 01:37:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Apj4e/QkNexZpRmyHLzeLc5950v769IPXFlPFAaZ5f4lxNZUKXvMVbCa4cB0Yhpj+F99O X-Received: by 2002:a05:6402:496:b0:443:a5f5:d3b with SMTP id k22-20020a056402049600b00443a5f50d3bmr21902808edv.331.1666427841293; Sat, 22 Oct 2022 01:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427841; cv=none; d=google.com; s=arc-20160816; b=J7jJcE+ljneuS7UNo1cLAV8Haob+eE0TQgqOl34XGhitl1tm+26WoMDX0trTRgRbhW FDSVcQkiI2+Q5p2RE8F/Z+vgtnSHji/6cBqmauSy/nUKHxxuOlHK9lR6YzyLqSz0+W7A G+HSLAi9C6uqHKoL1mUWgHP84GpyyPqZPPA5l6zbLt4i2nD8kIOL1lHNVm0pccPKfxIh clVTt5POskzXmitec+J+CAyVaXXlLwAyoHgeB6bKVgWWFDeY2cmSs3cEBPATE+bQUNPK 1aMMHErwHXNap07FOb26XdOUNVCqMLQXHo5WxFNaobpyd0rAcs1QSeB9oNuYa2L/EYNe Xb9A== 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=g11IT5PHNoUI8iecjw0f94h55YHRtd9raeH1pLPSCRb+qlYwsCDPzjUchqvLICcBIa hGqQxFjU0uNDck30fKf8cwIbkfEi3E3Jmvy2aPvSKDWhsRTggD1+PlNJOBEvtuln+wM+ cYCEaO4zcY/UkgP+G0PvRDqfyzMw4F7kbrGCAQwoveyHpROHiLLhL/WyBaVhNldb+h5E D/GtNbNOVexfE25WRm0fzclG9RUhHfpP2qURoll4GjEoQnUcWsI+vOTrxwA8PvE7dQbA DZD574ktlUpl0AVwReClWdmCtConRwaoRho+m9LpUwfA8vC4alRJ8MQ7I+Lb9SQDv8nY YTtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v8mH59dz; 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 sa26-20020a1709076d1a00b0078c8dadd4bbsi21694768ejc.742.2022.10.22.01.36.52; Sat, 22 Oct 2022 01:37:21 -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=v8mH59dz; 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 S233657AbiJVIbU (ORCPT + 99 others); Sat, 22 Oct 2022 04:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233877AbiJVI2j (ORCPT ); Sat, 22 Oct 2022 04:28:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 056BE2E1B94; Sat, 22 Oct 2022 01:01:26 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2EFD360ADC; Sat, 22 Oct 2022 07:59:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08541C433D6; Sat, 22 Oct 2022 07:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425567; bh=GYMheR2uDf5Pu2mG9xm6Hst+j27aQrPCPR8epawv2K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v8mH59dz/vwuh9670EI9hy5RsbWgYInYBkOtKkfvhnduSG+lRSUXwR2D11tat9mqA DCEXxAHQBfXf7Vk5Hm7n79uxbddBMLYoRBGX1ku+gZLyTtN87sNoPZP5tyEKuvlw79 CMn7p7FGy08M5jKIsySe9A+rDxOmgnQi4RAjLlAk= 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 5.19 543/717] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Sat, 22 Oct 2022 09:27:02 +0200 Message-Id: <20221022072522.360550037@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376240241488515?= X-GMAIL-MSGID: =?utf-8?q?1747376240241488515?= 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;