]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86/amd: hfi: Support for ranking table versions
authorKrishnamoorthi M <krishnamoorthi.m@amd.com>
Thu, 7 May 2026 19:09:26 +0000 (00:39 +0530)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 19 May 2026 10:42:04 +0000 (13:42 +0300)
Add changes to support new ranking table version. Version 2 of the
heterogeneous ranking table provides static CPU rankings. Version 3 adds
dynamic ranking table support on newer AMD platforms. These changes ensure
that platforms still reporting version 2 continue to function with the
existing static ranking path, avoiding regressions on older hardware
that does not supply a dynamic ranking table.

Signed-off-by: Krishnamoorthi M <krishnamoorthi.m@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20260507190926.1211726-1-krishnamoorthi.m@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/hfi/hfi.c

index 83863a5e0fbc6f43c383a1d47d035c9d7015739f..e0ebcb0c4acdea1f630ca246ca4657fc9921d755 100644 (file)
@@ -33,7 +33,8 @@
 
 #define AMD_HFI_DRIVER         "amd_hfi"
 #define AMD_HFI_MAILBOX_COUNT          1
-#define AMD_HETERO_RANKING_TABLE_VER   2
+#define AMD_HETERO_RANKING_TABLE_MIN_VER       2
+#define AMD_HETERO_RANKING_TABLE_MAX_VER       3
 
 #define AMD_HETERO_CPUID_27    0x80000027
 
@@ -158,7 +159,8 @@ static int amd_hfi_fill_metadata(struct amd_hfi_data *amd_hfi_data)
                dev_err(amd_hfi_data->dev, "invalid signature in shared memory\n");
                return -EINVAL;
        }
-       if (amd_hfi_data->shmem->version_number != AMD_HETERO_RANKING_TABLE_VER) {
+       if (amd_hfi_data->shmem->version_number < AMD_HETERO_RANKING_TABLE_MIN_VER ||
+           amd_hfi_data->shmem->version_number > AMD_HETERO_RANKING_TABLE_MAX_VER) {
                dev_err(amd_hfi_data->dev, "invalid version %d\n",
                        amd_hfi_data->shmem->version_number);
                return -EINVAL;