From patchwork Wed Feb 7 13:09:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tor Vic X-Patchwork-Id: 197926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2215836dyb; Wed, 7 Feb 2024 05:11:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfeIp8vbeG/E0Rch24CoOaxRCSZiFp8m37SaeNDRYSLALIYFw8TKBm+zWC7CCFBWurl/8L X-Received: by 2002:a05:6122:4f10:b0:4b8:7a16:b757 with SMTP id gh16-20020a0561224f1000b004b87a16b757mr1807559vkb.5.1707311498580; Wed, 07 Feb 2024 05:11:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707311498; cv=pass; d=google.com; s=arc-20160816; b=m4JXa1IVK+uKPQiTW56HYs8LQkGDg0IYASd6XEfg2iRpIKCiS80eaZLWoAYxtayueH sIMkBBkC+MtfGSzknSSiji6hN4sotfZ7gghHFSemXidVM2efi1ed9DrhXRDsU7Qamc+n 6d7bjv9UnLhrafC9Z0B/FnRQeVFp2eT1F0ILsBQDGmH6ywWY0U0cRiyhJj8/130Q7c6S TEC4qGyihfxwWFjAqmcLPpZZ9X7gM9ToCMr5yzAr0E7TUyIH6n1959hh+i5fMWkniRIv 6ndkHDEVXJ3M9Cdp7RphjZ2OtzOm0s686d6YCuQosYmaVLl6NAUxt/e7rdcZ5+8izt+1 b7mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:from:cc:to:content-language :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=xxONrTvJa5WGKkunFtaEoZBXl9eRExoEHx1SGG+4XXs=; fh=HVIVJpRy+uywqGtdXMX3RlZJRg2BGdWDnbnqV5/ovpo=; b=xxgNkv1r0v2nv7oCym/lQJszNCZ0fKRreZ0daneYdtsHF3bP14V6ecTOHGz5z0CMjP uT04KVZk8K7rn1ruG/E4pIpJUvwWBarj4gU2bFsdf8g309iQ9qE+8x3Fn7CwcRdQ4Zn2 4v0Mr2wateegmDFrAAJM+KDqU6033IxP3/DDJxsOeZmKTKvlK+NcVNZqd6jIpHLXpjH9 VYbHYHEpcpKn79yIkVoJx5/fWiIsz18qHCCG9y16T1YWOTGjG8bgLFFkUBco+Ve6T4C8 1A+CN0sh183O3qsTKjK6kZM98PJJhfIeFT2pZVFZjbVXFQZ+C8TnnutakepPbDftFfnf KCrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b="ikhlTEK/"; arc=pass (i=1 spf=pass spfdomain=mailbox.org dkim=pass dkdomain=mailbox.org dmarc=pass fromdomain=mailbox.org); spf=pass (google.com: domain of linux-kernel+bounces-56520-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56520-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org X-Forwarded-Encrypted: i=2; AJvYcCVn6yIpsIJFhDRhCMmFZIj0UsxWRklkrtnIan/Bkm0tPdb4GugUn8p0jAOHExe4rRTug3/GDcrTpMMSR5bvxuZATJy16g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n1-20020ab07bc1000000b007cca100d3fesi128810uav.129.2024.02.07.05.11.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 05:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56520-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b="ikhlTEK/"; arc=pass (i=1 spf=pass spfdomain=mailbox.org dkim=pass dkdomain=mailbox.org dmarc=pass fromdomain=mailbox.org); spf=pass (google.com: domain of linux-kernel+bounces-56520-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56520-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 14CF41C26945 for ; Wed, 7 Feb 2024 13:11:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CD017C081; Wed, 7 Feb 2024 13:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="ikhlTEK/" Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B1377F0A; Wed, 7 Feb 2024 13:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707311359; cv=none; b=sT+myDD5JFeIBkAQn1fzO7+aduYokuVasOtedNhwK/Ai1p75NsvnPsIN733SNuGYWz4sqwR5j1H1WuZ+s8rjmaOxYCz0CK/qSzqv5DDJbrQ+Fi51Nvno9qlt0jtQDAXQh7GzPM2lPkjWL24Xtu/Da0npt43wydYkY2TC0dd7jcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707311359; c=relaxed/simple; bh=GWAgaDJ3zdRn3qm1MtZe+axa+R6PJ8fMMxWJrbGg7AQ=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=gitN/5VlSPgv1+2mgTH3p6U6SXDKHcz4XZRYMCXbJng2IgJjJ1xkEpmI7wQIPFMFD9xxkAdJDDlsZ5WsWo2PbHWvE+CIo1MV7YKpNrMs5zMxQqq4Z4CBbpDSQSXi+Sc74K8r+eni8ZnoLah9KrvLvBMSTyvt6ClrytmzIbFAoos= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=ikhlTEK/; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4TVL6W6k3kz9sw2; Wed, 7 Feb 2024 14:09:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1707311347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxONrTvJa5WGKkunFtaEoZBXl9eRExoEHx1SGG+4XXs=; b=ikhlTEK/L4z8v8ELl0gxcfrTW0e38Po69NiBubwHSN+SOYzu5zRmVd9D4U/hu1G0XYYJSW hjBMa7Coevc9BrQTTOhJ3xTSVDZVPp3XlyUvpgRzz5U6MpNkF0dHAQoRfBUHWMKK2ft+Cd 4LB5Pw12gbTkPUdPy0X7QL+K9mXqFVZ9Kt8WFw611WHat/vIpxW2WY1n4RTMg4WjBQPsDr azO9ekKjmiqVP80MT92e+I/5DwhDsI8TQmlPsfP//RHz7aAuSF5pN761kasdRNT1GtTFvt ySgUISiYpN+GupU7IYMw4Hmm4H1RDP4xlRvdejGzxN9qBb18Fv52dB0ENVhqfA== Message-ID: <41f82085-8ea9-4ffa-a93a-8e39ce0f4c27@mailbox.org> Date: Wed, 7 Feb 2024 14:09:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Language: en-US To: Huang Rui , Perry Yuan , rafael@kernel.org Cc: Linux Kernel Mailing List , linux-pm@vger.kernel.org, Oleksandr Natalenko From: Tor Vic Subject: [PATCH][next] cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf() X-MBO-RS-META: 4wcfr81h7xkjb3at6zuheac1jr4e8dqn X-MBO-RS-ID: 76e10efaad271e17016 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790245861721362085 X-GMAIL-MSGID: 1790245861721362085 In the function amd_pstate_adjust_perf(), the 'min_perf' variable is set to 'highest_perf' instead of 'lowest_perf'. Fixes: 1d215f0319c2 ("cpufreq: amd-pstate: Add fast switch function for AMD P-State") Reported-by: Oleksandr Natalenko Signed-off-by: Tor Vic Reviewed-by: Perry Yuan --- IIRC, this was first reported by Oleksandr, hence the 'Reported-by' tag. --- 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 08e112444c27..aa5e57e27d2b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -577,7 +577,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu, if (target_perf < capacity) des_perf = DIV_ROUND_UP(cap_perf * target_perf, capacity); - min_perf = READ_ONCE(cpudata->highest_perf); + min_perf = READ_ONCE(cpudata->lowest_perf); if (_min_perf < capacity) min_perf = DIV_ROUND_UP(cap_perf * _min_perf, capacity);