From patchwork Thu May 15 21:19:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 890513 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 EFF4029C33E; Thu, 15 May 2025 21:20:20 +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=1747344021; cv=none; b=tLGgPWNPy6xHKk7JZ9jZ1kYtpLgRswVVfGvZlCNIt8v8gg/yR+gtMmC8uLSZImussPkDMqHbUtqGbheub7C8ogs2U24xZB28U7S/VkkwPIehgGciOxmercWMoD1VgmXNAHw/BIGjanj6CSCk3pfCLSqpozcDc9HLuJxaNgljICI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747344021; c=relaxed/simple; bh=oHtRIsAptTXF54+4BJ34mKmBZlrungbNMyhnHWfvkmQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GxIuhvuQ1vtyjfP0UigplvuJ/LETSvN4Odhr4SXs5RtUy2o0oc+t9NNOit0YuviB7kla3jXs8j/D1URv5UMMqGsPhmWLiD9Z+4oz+j9bjss6S41LGiUqrkSEgehyex9oLzpdsc0Dotk7j5ksTKMXzVHtOvsbSwkZI/X/FS2mqRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rgqMLdBh; 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="rgqMLdBh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDCFDC4CEF0; Thu, 15 May 2025 21:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747344020; bh=oHtRIsAptTXF54+4BJ34mKmBZlrungbNMyhnHWfvkmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rgqMLdBh4HHkLxDE2dm7yZzg683Lk4TI5wewdTUI/e2STalfYfOeqKvIlHT6mamkT Lr+L0LFv8hO+CnMs+I7EZba/PpP0RErg6GT82vccAKmKxqbbTleM3UzNaYebQ2zCxr 2DR0J+EO944yTTk2YUfrhMmjKAJdnav9T2tR6FOG+GXOecQzcNYOgvQMQIYcnMC63h u2BmjNZ3xgVGJhablmGJN1rMGxxuViO+83sbbxgoyokVRPyZo5GtICG0R4ZhwlOu51 GjYrox8nFpSSuTmLewLd/I2sII6cEK0P3ExSbScm7F3X9frW2aAufxvBTbEoZRf972 WY0iTKuBmB5iw== 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 11/13] platform/x86/amd: hfi: Set ITMT priority from ranking data Date: Thu, 15 May 2025 16:19:48 -0500 Message-ID: <20250515211950.3102922-12-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 The static ranking data that is read at module load should be used to set up the priorities for the cores relative to the performance values. Reviewed-by: Gautham R. Shenoy Signed-off-by: Mario Limonciello --- drivers/platform/x86/amd/hfi/Kconfig | 1 + drivers/platform/x86/amd/hfi/hfi.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/platform/x86/amd/hfi/Kconfig b/drivers/platform/x86/amd/hfi/Kconfig index 476e4a9ed67a9..75b0f73407047 100644 --- a/drivers/platform/x86/amd/hfi/Kconfig +++ b/drivers/platform/x86/amd/hfi/Kconfig @@ -7,6 +7,7 @@ config AMD_HFI bool "AMD Hetero Core Hardware Feedback Driver" depends on ACPI depends on CPU_SUP_AMD + depends on SCHED_MC_PRIO help Select this option to enable the AMD Heterogeneous Core Hardware Feedback Interface. If selected, hardware provides runtime thread diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c index 921e07acf2ff1..22a5bf977daf5 100644 --- a/drivers/platform/x86/amd/hfi/hfi.c +++ b/drivers/platform/x86/amd/hfi/hfi.c @@ -114,6 +114,12 @@ static DEFINE_PER_CPU(struct amd_hfi_cpuinfo, amd_hfi_cpuinfo) = {.class_index = static DEFINE_MUTEX(hfi_cpuinfo_lock); +static void amd_hfi_sched_itmt_work(struct work_struct *work) +{ + sched_set_itmt_support(); +} +static DECLARE_WORK(sched_amd_hfi_itmt_work, amd_hfi_sched_itmt_work); + static int find_cpu_index_by_apicid(unsigned int target_apicid) { int cpu_index; @@ -237,6 +243,8 @@ static int amd_set_hfi_ipcc_score(struct amd_hfi_cpuinfo *hfi_cpuinfo, int cpu) WRITE_ONCE(hfi_cpuinfo->ipcc_scores[i], hfi_cpuinfo->amd_hfi_classes[i].perf); + sched_set_itmt_core_prio(hfi_cpuinfo->ipcc_scores[0], cpu); + return 0; } @@ -458,6 +466,8 @@ static int amd_hfi_probe(struct platform_device *pdev) if (ret < 0) return ret; + schedule_work(&sched_amd_hfi_itmt_work); + return 0; }