From: Suma Hegde <Suma.Hegde@amd.com>
To: Gregory Price <gourry@gourry.net>
Cc: platform-driver-x86@vger.kernel.org,
ilpo.jarvinen@linux.intel.com, hdegoede@redhat.com,
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Subject: Re: [PATCH] platform/x86/amd/hsmp: Check for hsmp ACPI device
Date: Fri, 25 Apr 2025 14:53:14 +0530 [thread overview]
Message-ID: <c6972a3f-8715-4a87-96a6-7fb346852c4b@amd.com> (raw)
In-Reply-To: <aAp6Z2DLJdqcLoYE@gourry-fedora-PF4VCD3F>
Hi Gregory,
On 4/24/2025 11:22 PM, Gregory Price wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Thu, Apr 24, 2025 at 06:25:44AM +0000, Suma Hegde wrote:
>> 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().
>>
>> Signed-off-by: Suma Hegde <suma.hegde@amd.com>
>> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
>> ---
>> This patch should be rebased on below patch by Gregory Price.
>> https://lore.kernel.org/platform-driver-x86/60715d85-48b4-4066-8a9a-c8d2b62ebb45@redhat.com/T/#t
> Just roll my patch into this and add
Ok, I will merge your changes into this, add below lines and send v2.
>
> Link: https://lore.kernel.org/platform-driver-x86/aALZxvHWmphNL1wa@gourry-fedora-PF4VCD3F/
> Fixes: 7d3135d163 ("platform/x86/amd/hsmp: Create separate ACPI, plat and common drivers")
> Co-developed-by: Gregory Price <gourry@gourry.net>
> Signed-off-by: Gregory Price <gourry@gourry.net>
>
> should make the pick up easier, and they both deal with the same patch.
>
>
>
>> 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(-)
>>
>> diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
>> index 088cb2416d7e..eaae044e4f82 100644
>> --- a/drivers/platform/x86/amd/hsmp/acpi.c
>> +++ b/drivers/platform/x86/amd/hsmp/acpi.c
>> @@ -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"
>> diff --git a/drivers/platform/x86/amd/hsmp/hsmp.h b/drivers/platform/x86/amd/hsmp/hsmp.h
>> index af8b21f821d6..d58d4f0c20d5 100644
>> --- a/drivers/platform/x86/amd/hsmp/hsmp.h
>> +++ b/drivers/platform/x86/amd/hsmp/hsmp.h
>> @@ -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;
>> diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
>> index b9782a078dbd..81931e808bbc 100644
>> --- a/drivers/platform/x86/amd/hsmp/plat.c
>> +++ b/drivers/platform/x86/amd/hsmp/plat.c
>> @@ -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;
>> --
>> 2.25.1
Thanks and Regards,
Suma
prev parent reply other threads:[~2025-04-25 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 6:25 [PATCH] platform/x86/amd/hsmp: Check for hsmp ACPI device Suma Hegde
2025-04-24 17:52 ` Gregory Price
2025-04-25 9:23 ` Suma Hegde [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6972a3f-8715-4a87-96a6-7fb346852c4b@amd.com \
--to=suma.hegde@amd.com \
--cc=gourry@gourry.net \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=naveenkrishna.chatradhi@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox