From patchwork Thu May 15 21:19:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 890800 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 184D229C339; Thu, 15 May 2025 21:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747344019; cv=none; b=VfV+qhA84RXmu0PmxWD932vSxbz51r4/uLFIDIPhFQI1Bph1B0YbB+eYKC5UGbYNgkwJ5B707r1rgWP4u/3vbawC2nPThvemQ1p0SgFcxlrRyX4SGjvczCpDTqgQkK5w/wkaTfiOtjMdiJl9eo+nyW8nz8m/3VgWwJPEOp36bis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747344019; c=relaxed/simple; bh=jwHq1Dgz4Xlf3NTJxaMhCnIsdmCBSmUIMBR+/cZEj8Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aB+D4yzXiBbkl4WarKcOh7+NDQdNBryUapQaOe3jtskjSVyruzC+lOWw0TyVcnX8caokr2ZnXg3gqArgWFDy2rdzO2ax7+Jp21W0xSUhFZIn11RNo10pp3Eu1ygZ+4NDGO0Lt1hS5cy1xgEslaqLgYhLWanDd5nbf/mopCBet0Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PVFb4tf+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PVFb4tf+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9BC6C4CEF1; Thu, 15 May 2025 21:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747344018; bh=jwHq1Dgz4Xlf3NTJxaMhCnIsdmCBSmUIMBR+/cZEj8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PVFb4tf+h3F0gnbuUp/oWHIV5JfiFqkb4Vkyi7JuU6mWrgo9qFl+t+1HEjdxbhIxh HEB832jQkY/lYyTlerK2fiM0b2IzTNHm7CnizGZlyDkqhpl5hckzkn+/P7BqjahTNg x/h6fPZ4gayc9D1BnynN63yT65nLHcyUddoVq+AKyN4322k+Q4S9VyZzLTfdZZHBmQ 16HzvetqEpVD/BzvnmzgaGBrOKiEIdD57l9fcEi8dtZlWq6VicbkYy76sgJDOYFF/U 5xmRMTzMJP4CPSkE1xTimgl12I+WpOKadAzDqt83D3tui3wdB7mSsHWq/3H8z1qc6X 9XnoZDhWZ4bGg== From: Mario Limonciello To: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: Mario Limonciello , Perry Yuan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H . Peter Anvin" , Jonathan Corbet , Huang Rui , "Gautham R . Shenoy" , "Rafael J . Wysocki" , Viresh Kumar , platform-driver-x86@vger.kernel.org (open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER), linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-pm@vger.kernel.org (open list:AMD PSTATE DRIVER) Subject: [PATCH v10 10/13] cpufreq/amd-pstate: Disable preferred cores on designs with workload classification Date: Thu, 15 May 2025 16:19:47 -0500 Message-ID: <20250515211950.3102922-11-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250515211950.3102922-1-superm1@kernel.org> References: <20250515211950.3102922-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Mario Limonciello On designs that have workload classification, it's preferred that the amd-hfi driver is used to provide hints to the scheduler of which cores to use instead of the amd-pstate driver. Reviewed-by: Gautham R. Shenoy Reviewed-by: Perry Yuan Signed-off-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 66fdc74f13ef4..bdaf2034aaa10 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -801,6 +801,12 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) /* user disabled or not detected */ if (!amd_pstate_prefcore) return; + /* should use amd-hfi instead */ + if (cpu_feature_enabled(X86_FEATURE_AMD_WORKLOAD_CLASS) && + IS_ENABLED(CONFIG_AMD_HFI)) { + amd_pstate_prefcore = false; + return; + } cpudata->hw_prefcore = true;