Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp293576rdh; Wed, 7 Feb 2024 05:11:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDpENsywfHrTypxfKntbHZJ1EhZjsg8rCXm6XwACzwjbkqAvE0jA0+4mki9TqD48hgkens X-Received: by 2002:a2e:8011:0:b0:2cd:9959:53a0 with SMTP id j17-20020a2e8011000000b002cd995953a0mr3839005ljg.1.1707311467108; Wed, 07 Feb 2024 05:11:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707311467; cv=pass; d=google.com; s=arc-20160816; b=y0Kk9fZpHL8uUJ96PhO+jjJE/u/0eGlE4CjOFc3wu9P3wf5tms6/PPbf9KOWswOGsd X4EtTCPqRimW/lkFrM1I+qhThKa02EE8n/M0slxA/K2rrYBGp0iB9vOfaZrdIjJXip7l L5NtsAMYl+siJtO08/UEFi4YTBm3YmWqAw5PqRiJ42xejYlpRIYJzIkYjSEVNREErpHt ZALnM++Qnw1YVtgsJ/usAKRGrZz9YXs5RE4Q/fcvkowgLTGlVF3Fs6WmOdc4YRtsXb2h 8qdDi3GILjN63yDzjZah7rs9nZLzoSV6vthCwz9LB9XFFnD3tyLRbXFyGUmCrSSEVU8W 7xRA== 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=t9eQJBoEXmoGn/forj3a+R1dPlrZtz1fKAm6oofAd6Q=; b=Eyp5Pv9MHdVwb8CBQBHQn5wGy8ipHXf93RTZxesGe2v8heeUgXq8m2HjVFUQVuMqk7 b4fB6ia56tgAznmexQOR7SJdWvIjdhflKLZSSApMgkII++EQx5fQ2hYvhMWDM48T1eD5 5HcWSecieFol97WQ6kRVbR3wWs4bDZJ7M1nF9Av9UnurwsTrSrxFN+6ydb63JBrKJoM8 hPJR/L6ZNnbwkilWmWbNiuvZOsTKuzbBg/KSAnm+UPLM9T1EVEZb4Q6sIZK6Q4ubJNaM 1LXCgUI3YErbbWi7TAjtZXbL5iRFlKpkjBxZP2lTbD5PXxbPa9KtGUaOPIlJ8t88PP46 VLTg==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org X-Forwarded-Encrypted: i=2; AJvYcCUsAxo8jlhARxWTqqpxl+Ydviy4dWxkcNshsMA5xsdlWFGaGcS1cORwUHGbE4PDTfHln2nRqi/s7Ifcaq45smQQ1yxdnmiXGdy+9UfGlw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c15-20020a056402120f00b005608bcdac11si850762edw.531.2024.02.07.05.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 05:11:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56520-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id CFE0B1F27E5A for ; Wed, 7 Feb 2024 13:11:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3329A7A702; Wed, 7 Feb 2024 13:09:20 +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() Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MBO-RS-META: 4wcfr81h7xkjb3at6zuheac1jr4e8dqn X-MBO-RS-ID: 76e10efaad271e17016 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 --- 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); -- 2.43.0