Skip to contentSkip to conversation

platform/x86/amd/hsmp: Improve the print messages to avoid confusion

PATCH Superseded Suma Hegde 2 participants 5 messages Jun 13, 2025 – Jun 17, 2025

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Suma Hegde

author
#0 lore raw

PATCH 1/1 platform/x86/amd/hsmp: Improve the print messages to avoid confusion

When the HSMP ACPI device is available, then loading the amd_hsmp.ko module incorrectly prints the message "HSMP is not supported on Family:%x model:%x\n" despite being supported by the hsmp_acpi.ko module, leading to confusion.

To resolve this, relocate the acpi_dev_present() check to the beginning of the hsmp_plt_init() and revise the print message to better reflect the current support status.

Also add messages indicating successful probing for both hsmp_acpi.ko and amd_hsmp.ko modules.

---
 drivers/platform/x86/amd/hsmp/acpi.c |  1 +
 drivers/platform/x86/amd/hsmp/plat.c | 17 ++++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/hsmp/acpi.c +1 -0
index 2f1faa82d13e..b631110e5834 100644
@@ -610,6 +610,7 @@ static int hsmp_acpi_probe(struct platform_device *pdev)
 		hsmp_pdev->is_probed = true;
 	}
 
+	dev_info(&pdev->dev, "AMD HSMP ACPI is probed successfully\n");
 	return 0;
 }
 
drivers/platform/x86/amd/hsmp/plat.c +12 -5
index e3874c47ed9e..724e5c7fc819 100644
@@ -215,7 +215,12 @@ static int hsmp_pltdrv_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	return hsmp_misc_register(&pdev->dev);
+	ret = hsmp_misc_register(&pdev->dev);
+	if (ret)
+		return ret;
+
+	dev_info(&pdev->dev, "AMD HSMP is probed successfully\n");
+	return 0;
 }
 
 static void hsmp_pltdrv_remove(struct platform_device *pdev)
@@ -287,15 +292,17 @@ static int __init hsmp_plt_init(void)
 {
 	int ret = -ENODEV;
 
+	if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1)) {
+		pr_info("HSMP is supported through ACPI on this platform, please use hsmp_acpi.ko\n");
+		return -ENODEV;
+	}
+
 	if (!legacy_hsmp_support()) {
-		pr_info("HSMP is not supported on Family:%x model:%x\n",
+		pr_info("HSMP interface is either disabled or not supported on family:%x model:%x\n",
 			boot_cpu_data.x86, boot_cpu_data.x86_model);
 		return ret;
 	}
 
-	if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
-		return -ENODEV;
-
 	hsmp_pdev = get_hsmp_pdev();
 	if (!hsmp_pdev)
 		return -ENOMEM;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Suma Hegde

When the HSMP ACPI device is available, then loading the amd_hsmp.ko module incorrectly prints the message "HSMP is not supported on Family:%x model:%x\n" despite being supported by the hsmp_acpi.ko module, leading to confusion.

To resolve this, relocate the acpi_dev_present() check to the beginning of the hsmp_plt_init() and revise the print message to better reflect the current support status.

Quoted 5 lines

Also add messages indicating successful probing for both hsmp_acpi.ko and amd_hsmp.ko modules.

Generally this seems really noisy, is it really necessary? I feel like the messages in hsmp_plt_init() have value because they show up in the error path. But in the success path if you don't get a return code it should be working.

Quoted 57 lines
---
  drivers/platform/x86/amd/hsmp/acpi.c |  1 +
  drivers/platform/x86/amd/hsmp/plat.c | 17 ++++++++++++-----
  2 files changed, 13 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/hsmp/acpi.c +1 -0
index 2f1faa82d13e..b631110e5834 100644
@@ -610,6 +610,7 @@ static int hsmp_acpi_probe(struct platform_device *pdev)
  		hsmp_pdev->is_probed = true;
  	}
 
+	dev_info(&pdev->dev, "AMD HSMP ACPI is probed successfully\n");
  	return 0;
  }
 
drivers/platform/x86/amd/hsmp/plat.c +12 -5
index e3874c47ed9e..724e5c7fc819 100644
@@ -215,7 +215,12 @@ static int hsmp_pltdrv_probe(struct platform_device *pdev)
  		return ret;
  	}
 
-	return hsmp_misc_register(&pdev->dev);
+	ret = hsmp_misc_register(&pdev->dev);
+	if (ret)
+		return ret;
+
+	dev_info(&pdev->dev, "AMD HSMP is probed successfully\n");
+	return 0;
  }
 
  static void hsmp_pltdrv_remove(struct platform_device *pdev)
@@ -287,15 +292,17 @@ static int __init hsmp_plt_init(void)
  {
  	int ret = -ENODEV;
 
+	if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1)) {
+		pr_info("HSMP is supported through ACPI on this platform, please use hsmp_acpi.ko\n");
+		return -ENODEV;
+	}
+
  	if (!legacy_hsmp_support()) {
-		pr_info("HSMP is not supported on Family:%x model:%x\n",
+		pr_info("HSMP interface is either disabled or not supported on family:%x model:%x\n",
  			boot_cpu_data.x86, boot_cpu_data.x86_model);
  		return ret;
  	}
 
-	if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
-		return -ENODEV;
-
  	hsmp_pdev = get_hsmp_pdev();
  	if (!hsmp_pdev)
  		return -ENOMEM;
author
#2 lore raw

Hi Mario,

Quoted 10 lines · Mario Limonciello
Quoted 9 lines · Suma Hegde

When the HSMP ACPI device is available, then loading the amd_hsmp.ko module incorrectly prints the message "HSMP is not supported on Family:%x model:%x\n" despite being supported by the hsmp_acpi.ko module, leading to confusion.

To resolve this, relocate the acpi_dev_present() check to the beginning of the hsmp_plt_init() and revise the print message to better reflect the current support status.

Quoted 8 lines
Quoted 5 lines

Also add messages indicating successful probing for both hsmp_acpi.ko and amd_hsmp.ko modules.

Generally this seems really noisy, is it really necessary?  I feel like the messages in hsmp_plt_init() have value because they show up in the error path.  But in the success path if you don't get a return code it should be working.

With the upstreamed HSMP patchset in linux v6.15, "Erwan Velu" encountered an issue on an AMD machine with a "9845 (Family 1A, Model 11)" processor.

He observed the error message: "amd_hsmp: HSMP is not supported on Family:1a model:11," which is misleading because the HSMP ACPI is actually functioning.

He raised a concern to correct the error message and ensure consistency in the message across both initialization paths (ACPI/PAT) so that users are informed that HSMP was successfully probed.

Could you please provide your suggestion to this issue?

Quoted 48 lines
Quoted 48 lines

---
  drivers/platform/x86/amd/hsmp/acpi.c |  1 + drivers/platform/x86/amd/hsmp/plat.c | 17 ++++++++++++-----

  2 files changed, 13 insertions(+), 5 deletions(-)
drivers/platform/x86/amd/hsmp/acpi.c +0 -0
index 2f1faa82d13e..b631110e5834 100644
@@ -610,6 +610,7 @@ static int hsmp_acpi_probe(struct platform_device 
 *pdev)
           hsmp_pdev->is_probed = true;
       }
   +    dev_info(&pdev->dev, "AMD HSMP ACPI is probed successfully\n");
       return 0;
   }

  diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c index e3874c47ed9e..724e5c7fc819 100644

drivers/platform/x86/amd/hsmp/plat.c +11 -1
@@ -215,7 +215,12 @@ static int hsmp_pltdrv_probe(struct 
 platform_device *pdev)
           return ret;
       }
   -    return hsmp_misc_register(&pdev->dev);
+    ret = hsmp_misc_register(&pdev->dev);
+    if (ret)
+        return ret;
+
+    dev_info(&pdev->dev, "AMD HSMP is probed successfully\n");
+    return 0;
   }
     static void hsmp_pltdrv_remove(struct platform_device *pdev)
@@ -287,15 +292,17 @@ static int __init hsmp_plt_init(void)
   {
       int ret = -ENODEV;
   +    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1)) {
+        pr_info("HSMP is supported through ACPI on this platform, 
 please use hsmp_acpi.ko\n");
+        return -ENODEV;
+    }
+
       if (!legacy_hsmp_support()) {
-        pr_info("HSMP is not supported on Family:%x model:%x\n",
+        pr_info("HSMP interface is either disabled or not supported 
 on family:%x model:%x\n",
               boot_cpu_data.x86, boot_cpu_data.x86_model);
Quoted 8 lines
Quoted 8 lines
drivers/platform/x86/amd/hsmp/plat.c +0 -2
           return ret;
       }
   -    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
-        return -ENODEV;
-
       hsmp_pdev = get_hsmp_pdev();
       if (!hsmp_pdev)

          return -ENOMEM;

Thanks and Regards,

Suma

#3 lore raw
Quoted 34 lines · Suma Hegde

Hi Mario,

Quoted 13 lines · Mario Limonciello
Quoted 12 lines · Suma Hegde

When the HSMP ACPI device is available, then loading the amd_hsmp.ko module incorrectly prints the message "HSMP is not supported on Family:%x model:%x\n" despite being supported by the hsmp_acpi.ko module, leading to confusion.

To resolve this, relocate the acpi_dev_present() check to the beginning of the hsmp_plt_init() and revise the print message to better reflect the current support status.

Also add messages indicating successful probing for both hsmp_acpi.ko and amd_hsmp.ko modules.

Quoted 8 lines
Quoted 2 lines

Generally this seems really noisy, is it really necessary?  I feel like the messages in hsmp_plt_init() have value because they show up in the error path.  But in the success path if you don't get a return code it should be working.

With the upstreamed HSMP patchset in linux v6.15, "Erwan Velu" encountered an issue on an AMD machine with a "9845 (Family 1A, Model 11)" processor.

He observed the error message: "amd_hsmp: HSMP is not supported on Family:1a model:11," which is misleading because the HSMP ACPI is actually functioning.

Quoted 5 lines

He raised a concern to correct the error message and ensure consistency in the message across both initialization paths (ACPI/PAT) so that users are informed that HSMP was successfully probed.

Could you please provide your suggestion to this issue?

How about in hsmp_plt_init() you re-order things? I think the acpi_dev_present() check can come before the legacy_hsmp_support() check.

Quoted 66 lines
Quoted 52 lines
Quoted 52 lines

---
  drivers/platform/x86/amd/hsmp/acpi.c |  1 + drivers/platform/x86/amd/hsmp/plat.c | 17 ++++++++++++-----

  2 files changed, 13 insertions(+), 5 deletions(-)
drivers/platform/ renamed from drivers/platform/x86/amd/hsmp/acpi.c +0 -0

x86/amd/hsmp/acpi.c
index 2f1faa82d13e..b631110e5834 100644

drivers/platform/x86/amd/hsmp/acpi.c +0 -0
@@ -610,6 +610,7 @@ static int hsmp_acpi_probe(struct platform_device 
 *pdev)
           hsmp_pdev->is_probed = true;
       }
   +    dev_info(&pdev->dev, "AMD HSMP ACPI is probed successfully\n");
       return 0;
   }

  diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/ platform/x86/amd/hsmp/plat.c
index e3874c47ed9e..724e5c7fc819 100644

drivers/platform/x86/amd/hsmp/plat.c +11 -1
@@ -215,7 +215,12 @@ static int hsmp_pltdrv_probe(struct 
 platform_device *pdev)
           return ret;
       }
   -    return hsmp_misc_register(&pdev->dev);
+    ret = hsmp_misc_register(&pdev->dev);
+    if (ret)
+        return ret;
+
+    dev_info(&pdev->dev, "AMD HSMP is probed successfully\n");
+    return 0;
   }
     static void hsmp_pltdrv_remove(struct platform_device *pdev)
@@ -287,15 +292,17 @@ static int __init hsmp_plt_init(void)
   {
       int ret = -ENODEV;
   +    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1)) {
+        pr_info("HSMP is supported through ACPI on this platform, 
 please use hsmp_acpi.ko\n");
+        return -ENODEV;
+    }
+
       if (!legacy_hsmp_support()) {
-        pr_info("HSMP is not supported on Family:%x model:%x\n",
+        pr_info("HSMP interface is either disabled or not supported 
 on family:%x model:%x\n",
               boot_cpu_data.x86, boot_cpu_data.x86_model);
Quoted 8 lines
Quoted 8 lines
drivers/platform/x86/amd/hsmp/plat.c +0 -2
           return ret;
       }
   -    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
-        return -ENODEV;
-
       hsmp_pdev = get_hsmp_pdev();
       if (!hsmp_pdev)

          return -ENOMEM;

Thanks and Regards,

Suma

author
#4 lore raw

Hi Mario,

Quoted 33 lines · Mario
Quoted 32 lines · Suma Hegde

Hi Mario,

Quoted 13 lines · Mario Limonciello
Quoted 12 lines · Suma Hegde

When the HSMP ACPI device is available, then loading the amd_hsmp.ko module incorrectly prints the message "HSMP is not supported on Family:%x model:%x\n" despite being supported by the hsmp_acpi.ko module, leading to confusion.

To resolve this, relocate the acpi_dev_present() check to the beginning of the hsmp_plt_init() and revise the print message to better reflect the current support status.

Also add messages indicating successful probing for both hsmp_acpi.ko and amd_hsmp.ko modules.

Quoted 7 lines
Quoted 2 lines

Generally this seems really noisy, is it really necessary?  I feel like the messages in hsmp_plt_init() have value because they show up in the error path.  But in the success path if you don't get a return code it should be working.

With the upstreamed HSMP patchset in linux v6.15, "Erwan Velu" encountered an issue on an AMD machine with a "9845 (Family 1A, Model 11)" processor.

He observed the error message: "amd_hsmp: HSMP is not supported on Family:1a model:11," which is misleading because the HSMP ACPI is actually functioning.

Quoted 7 lines
Quoted 5 lines

He raised a concern to correct the error message and ensure consistency in the message across both initialization paths (ACPI/PAT) so that users are informed that HSMP was successfully probed.

Could you please provide your suggestion to this issue?

How about in hsmp_plt_init() you re-order things? I think the acpi_dev_present() check can come before the legacy_hsmp_support() check.

Thank you for the suggestion. Additionally, how about having only a single probe message in acpi.c rather than printing it for each acpi device?

I will do this change and send v2.

Quoted 63 lines
Quoted 63 lines
Quoted 50 lines
Quoted 50 lines
---
   drivers/platform/x86/amd/hsmp/acpi.c |  1 +
   drivers/platform/x86/amd/hsmp/plat.c | 17 ++++++++++++-----
   2 files changed, 13 insertions(+), 5 deletions(-)
drivers/platform/ renamed from drivers/platform/x86/amd/hsmp/acpi.c +0 -0

x86/amd/hsmp/acpi.c
index 2f1faa82d13e..b631110e5834 100644

drivers/platform/x86/amd/hsmp/acpi.c +0 -0
@@ -610,6 +610,7 @@ static int hsmp_acpi_probe(struct platform_device
 *pdev)
           hsmp_pdev->is_probed = true;
       }
   +    dev_info(&pdev->dev, "AMD HSMP ACPI is probed successfully\n");
       return 0;
   }
   diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/

platform/x86/amd/hsmp/plat.c
index e3874c47ed9e..724e5c7fc819 100644

drivers/platform/x86/amd/hsmp/plat.c +11 -1
@@ -215,7 +215,12 @@ static int hsmp_pltdrv_probe(struct
 platform_device *pdev)
           return ret;
       }
   -    return hsmp_misc_register(&pdev->dev);
+    ret = hsmp_misc_register(&pdev->dev);
+    if (ret)
+        return ret;
+
+    dev_info(&pdev->dev, "AMD HSMP is probed successfully\n");
+    return 0;
   }
     static void hsmp_pltdrv_remove(struct platform_device *pdev)
@@ -287,15 +292,17 @@ static int __init hsmp_plt_init(void)
   {
       int ret = -ENODEV;
   +    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1)) {
+        pr_info("HSMP is supported through ACPI on this platform,
 please use hsmp_acpi.ko\n");
+        return -ENODEV;
+    }
+
       if (!legacy_hsmp_support()) {
-        pr_info("HSMP is not supported on Family:%x model:%x\n",
+        pr_info("HSMP interface is either disabled or not supported
 on family:%x model:%x\n",
               boot_cpu_data.x86, boot_cpu_data.x86_model);
Quoted 8 lines
Quoted 8 lines
drivers/platform/x86/amd/hsmp/plat.c +0 -2
           return ret;
       }
   -    if (acpi_dev_present(ACPI_HSMP_DEVICE_HID, NULL, -1))
-        return -ENODEV;
-
       hsmp_pdev = get_hsmp_pdev();
       if (!hsmp_pdev)

          return -ENOMEM;

Thanks and Regards,

Suma