platform/x86/amd/hsmp: Check for hsmp ACPI device
Subsystems (2)
PATCH 1/1 platform/x86/amd/hsmp: Check for hsmp ACPI device
If the hsmp ACPI device entry exists, allow the hsmp_acpi driver to manage the hsmp and return error from plat.c.
amd_hsmp and hsmp_acpi are intended to be mutually exclusive drivers and this check for availability of hsmp ACPI device is necessary to ensure this.
Also, support both platform device-based and ACPI-based probing for family 0x1A models 0x00 to 0x0F, implement only ACPI-based probing for family 0x1A, models 0x10 to 0x1F. Return false from legacy_hsmp_support() for this platform.
This aligns with the condition check in is_f1a_m0h().
---
This patch should be rebased on below patch by Gregory Price.
https://lore.kernel.org/platform-driver-x86/[email protected]/T/#t
drivers/platform/x86/amd/hsmp/acpi.c | 1 - drivers/platform/x86/amd/hsmp/hsmp.h | 1 + drivers/platform/x86/amd/hsmp/plat.c | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/platform/x86/amd/hsmp/acpi.c +0 -1
@@ -29,7 +29,6 @@#define DRIVER_NAME "hsmp_acpi"#define DRIVER_VERSION "2.3" -#define ACPI_HSMP_DEVICE_HID "AMDI0097"/* These are the strings specified in ACPI table */ #define MSG_IDOFF_STR "MsgIdOffset"
drivers/platform/x86/amd/hsmp/hsmp.h +1 -0
@@ -23,6 +23,7 @@#define HSMP_CDEV_NAME "hsmp_cdev"#define HSMP_DEVNODE_NAME "hsmp" +#define ACPI_HSMP_DEVICE_HID "AMDI0097"struct hsmp_mbaddr_info {u32 base_addr;
drivers/platform/x86/amd/hsmp/plat.c +5 -1
@@ -11,6 +11,7 @@#include <asm/amd_hsmp.h> +#include <linux/acpi.h> #include <linux/build_bug.h> #include <linux/device.h> #include <linux/module.h>
@@ -266,7 +267,7 @@ static bool legacy_hsmp_support(void) }case 0x1A :switch (boot_cpu_data.x86_model) { - case 0x00 ... 0x1F: + case 0x00 ... 0x0F:return true;default :return false;
@@ -288,6 +289,9 @@ static int __init hsmp_plt_init(void)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
Quoted 13 lines · Suma Hegde
If the hsmp ACPI device entry exists, allow the
hsmp_acpidriver to manage the hsmp and return error fromplat.c.
amd_hsmpandhsmp_acpiare intended to be mutually exclusive drivers and this check for availability of hsmp ACPI device is necessary to ensure this.Also, support both platform device-based and ACPI-based probing for family
0x1Amodels0x00to0x0F, implement only ACPI-based probing for family0x1A, models0x10to0x1F. Return false fromlegacy_hsmp_support()for this platform.
This aligns with the condition check inis_f1a_m0h().
Quoted 5 lines
Signed-off-by Suma Hegde <[email protected]>Reviewed-by Naveen Krishna Chatradhi <[email protected]>---
This patch should be rebased on below patch by Gregory Price.
https://lore.kernel.org/platform-driver-x86/[email protected]/T/#t
Just roll my patch into this and add
should make the pick up easier, and they both deal with the same patch.
Quoted 64 lines
drivers/platform/x86/amd/hsmp/acpi.c | 1 - drivers/platform/x86/amd/hsmp/hsmp.h | 1 + drivers/platform/x86/amd/hsmp/plat.c | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-)drivers/platform/x86/amd/hsmp/acpi.c +0
-1@@ -29,7 +29,6 @@#define DRIVER_NAME "hsmp_acpi"#define DRIVER_VERSION "2.3" -#define ACPI_HSMP_DEVICE_HID "AMDI0097"/* These are the strings specified in ACPI table */ #define MSG_IDOFF_STR "MsgIdOffset"drivers/platform/x86/amd/hsmp/hsmp.h +1
-0@@ -23,6 +23,7 @@#define HSMP_CDEV_NAME "hsmp_cdev"#define HSMP_DEVNODE_NAME "hsmp" +#define ACPI_HSMP_DEVICE_HID "AMDI0097"struct hsmp_mbaddr_info {u32 base_addr;drivers/platform/x86/amd/hsmp/plat.c +5
-1@@ -11,6 +11,7 @@#include <asm/amd_hsmp.h> +#include <linux/acpi.h> #include <linux/build_bug.h> #include <linux/device.h> #include <linux/module.h> @@ -266,7 +267,7 @@ static bool legacy_hsmp_support(void) }case 0x1A :switch (boot_cpu_data.x86_model) { - case 0x00 ... 0x1F: + case 0x00 ... 0x0F:return true;default :return false;@@ -288,6 +289,9 @@ static int __init hsmp_plt_init(void)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
Hi Gregory,
Quoted 17 lines · Gregory Price
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Quoted 13 lines · Suma Hegde
If the hsmp ACPI device entry exists, allow the
hsmp_acpidriver to manage the hsmp and return error fromplat.c.
amd_hsmpandhsmp_acpiare intended to be mutually exclusive drivers and this check for availability of hsmp ACPI device is necessary to ensure this.Also, support both platform device-based and ACPI-based probing for family
0x1Amodels0x00to0x0F, implement only ACPI-based probing for family0x1A, models0x10to0x1F. Return false fromlegacy_hsmp_support()for this platform.
This aligns with the condition check inis_f1a_m0h().
Quoted 6 lines
Quoted 5 lines
Signed-off-by Suma Hegde <[email protected]>Reviewed-by Naveen Krishna Chatradhi <[email protected]>---
This patch should be rebased on below patch by Gregory Price.
https://lore.kernel.org/platform-driver-x86/[email protected]/T/#tJust roll my patch into this and add
Ok, I will merge your changes into this, add below lines and send v2.
Quoted 64 lines
Fixes 7d3135d163 ("platform/x86/amd/hsmp: Create separate ACPI, plat and common drivers")Co-developed-by Gregory Price <[email protected]>Signed-off-by Gregory Price <[email protected]>should make the pick up easier, and they both deal with the same patch.
Quoted 54 lines
drivers/platform/x86/amd/hsmp/acpi.c | 1 - drivers/platform/x86/amd/hsmp/hsmp.h | 1 + drivers/platform/x86/amd/hsmp/plat.c | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-)drivers/platform/x86/amd/hsmp/acpi.c +0
-1@@ -29,7 +29,6 @@#define DRIVER_NAME "hsmp_acpi"#define DRIVER_VERSION "2.3" -#define ACPI_HSMP_DEVICE_HID "AMDI0097"/* These are the strings specified in ACPI table */ #define MSG_IDOFF_STR "MsgIdOffset"drivers/platform/x86/amd/hsmp/hsmp.h +1
-0@@ -23,6 +23,7 @@#define HSMP_CDEV_NAME "hsmp_cdev"#define HSMP_DEVNODE_NAME "hsmp" +#define ACPI_HSMP_DEVICE_HID "AMDI0097"struct hsmp_mbaddr_info {u32 base_addr;drivers/platform/x86/amd/hsmp/plat.c +2
-1@@ -11,6 +11,7 @@#include <asm/amd_hsmp.h> +#include <linux/acpi.h> #include <linux/build_bug.h> #include <linux/device.h> #include <linux/module.h> @@ -266,7 +267,7 @@ static bool legacy_hsmp_support(void) }case 0x1A :switch (boot_cpu_data.x86_model) { - case 0x00 ... 0x1F: + case 0x00 ... 0x0F:return true;default :return false;@@ -288,6 +289,9 @@ static int __init hsmp_plt_init(void)return ret; }
Quoted 8 lines
Quoted 8 lines
drivers/platform/x86/amd/hsmp/plat.c +3
-1+if (acpi_dev_present (ACPI_HSMP_DEVICE_HID ,NULL ,-1 )) +return -ENODEV ; + hsmp_pdev =get_hsmp_pdev ();if (!hsmp_pdev)return -ENOMEM ; --2.25.1
Thanks and Regards,
Suma