public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] platform/x86/amd: Don't allow HSMP to be loaded on non-server hardware
@ 2024-04-16 18:20 Mario Limonciello
  2024-04-18  9:04 ` Hans de Goede
  2024-04-22 13:31 ` Hans de Goede
  0 siblings, 2 replies; 7+ messages in thread
From: Mario Limonciello @ 2024-04-16 18:20 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: Naveen Krishna Chatradhi, Carlos Bilbao,
	open list:AMD HSMP DRIVER, open list, Mario Limonciello

From: Mario Limonciello <mario.limonciello@amd.com>

If the HSMP driver is compiled into the kernel or a module manually loaded
on client hardware it can cause problems with the functionality of the PMC
module since it probes a mailbox with a different definition on servers.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2414
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3285
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v1->v2:
 * use pm preferred profile instead
---
 drivers/platform/x86/amd/hsmp.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c
index 1927be901108..102a49c3e945 100644
--- a/drivers/platform/x86/amd/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp.c
@@ -907,6 +907,17 @@ static int hsmp_plat_dev_register(void)
 	return ret;
 }
 
+static bool hsmp_supported_profile(void)
+{
+	switch (acpi_gbl_FADT.preferred_profile) {
+	case PM_ENTERPRISE_SERVER:
+	case PM_SOHO_SERVER:
+	case PM_PERFORMANCE_SERVER:
+		return true;
+	}
+	return false;
+}
+
 static int __init hsmp_plt_init(void)
 {
 	int ret = -ENODEV;
@@ -917,6 +928,11 @@ static int __init hsmp_plt_init(void)
 		return ret;
 	}
 
+	if (!hsmp_supported_profile()) {
+		pr_err("HSMP is only supported on servers");
+		return ret;
+	}
+
 	/*
 	 * amd_nb_num() returns number of SMN/DF interfaces present in the system
 	 * if we have N SMN/DF interfaces that ideally means N sockets
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-22 13:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16 18:20 [PATCH v2] platform/x86/amd: Don't allow HSMP to be loaded on non-server hardware Mario Limonciello
2024-04-18  9:04 ` Hans de Goede
2024-04-18 11:27   ` Mario Limonciello
2024-04-18 12:12     ` Hans de Goede
2024-04-18 13:51     ` Ilpo Järvinen
2024-04-19  1:38       ` Mario Limonciello
2024-04-22 13:31 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox