From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Suma Hegde <suma.hegde@amd.com>
Cc: platform-driver-x86@vger.kernel.org,
Hans de Goede <hdegoede@redhat.com>,
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Subject: Re: [v3 07/11] platform/x86/amd/hsmp: Create mutually exclusive ACPI and plat drivers
Date: Wed, 7 Aug 2024 17:17:45 +0300 (EEST) [thread overview]
Message-ID: <79261dbf-f1b8-c357-3a03-d8c9f99b45a6@linux.intel.com> (raw)
In-Reply-To: <20240720174552.946255-7-suma.hegde@amd.com>
On Sat, 20 Jul 2024, Suma Hegde wrote:
> Separate the probes for ACPI and platform device drivers.
> Provide a Kconfig option to select either the
> ACPI or the platform device based driver.
>
> Signed-off-by: Suma Hegde <suma.hegde@amd.com>
> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
> ---
> Changes since v2:
> Following files are modified to add new symbol
> - drivers/platform/x86/amd/hsmp/Kconfig,
> - drivers/platform/x86/amd/hsmp/Makefile
> - drivers/platform/x86/amd/Makefile
> AMD_HSMP is used as common symbol and new AMD_HSMP_PLAT symbol is added
>
> Changes since v1:
> Rename "plat_dev" to "hsmp_pdev"
>
> arch/x86/include/asm/amd_hsmp.h | 2 +-
> drivers/platform/x86/amd/Makefile | 2 +-
> drivers/platform/x86/amd/hsmp/Kconfig | 33 ++++++-
> drivers/platform/x86/amd/hsmp/Makefile | 6 +-
> drivers/platform/x86/amd/hsmp/acpi.c | 119 ++++++++++++++++++++++--
> drivers/platform/x86/amd/hsmp/hsmp.c | 25 ++---
> drivers/platform/x86/amd/hsmp/hsmp.h | 8 +-
> drivers/platform/x86/amd/hsmp/plat.c | 122 +++++++------------------
> 8 files changed, 188 insertions(+), 129 deletions(-)
>
> diff --git a/arch/x86/include/asm/amd_hsmp.h b/arch/x86/include/asm/amd_hsmp.h
> index 03c2ce3edaf5..ada14e55f9f4 100644
> --- a/arch/x86/include/asm/amd_hsmp.h
> +++ b/arch/x86/include/asm/amd_hsmp.h
> @@ -5,7 +5,7 @@
>
> #include <uapi/asm/amd_hsmp.h>
>
> -#if IS_ENABLED(CONFIG_AMD_HSMP)
> +#if IS_ENABLED(CONFIG_AMD_HSMP) || IS_ENABLED(CONFIG_AMD_HSMP_ACPI)
> int hsmp_send_message(struct hsmp_message *msg);
> #else
> static inline int hsmp_send_message(struct hsmp_message *msg)
> diff --git a/drivers/platform/x86/amd/Makefile b/drivers/platform/x86/amd/Makefile
> index 96ec24c8701b..f0b2fe81c685 100644
> --- a/drivers/platform/x86/amd/Makefile
> +++ b/drivers/platform/x86/amd/Makefile
> @@ -5,6 +5,6 @@
> #
>
> obj-$(CONFIG_AMD_PMC) += pmc/
> -obj-y += hsmp/
> +obj-$(CONFIG_AMD_HSMP) += hsmp/
> obj-$(CONFIG_AMD_PMF) += pmf/
> obj-$(CONFIG_AMD_WBRF) += wbrf.o
> diff --git a/drivers/platform/x86/amd/hsmp/Kconfig b/drivers/platform/x86/amd/hsmp/Kconfig
> index b55d4ed9bceb..23fb98066225 100644
> --- a/drivers/platform/x86/amd/hsmp/Kconfig
> +++ b/drivers/platform/x86/amd/hsmp/Kconfig
> @@ -4,14 +4,39 @@
> #
>
> config AMD_HSMP
> - tristate "AMD HSMP Driver"
> - depends on AMD_NB && X86_64 && ACPI
> + tristate "AMD Host System Management Port driver"
> + depends on AMD_NB
> help
> + Host System Management Port (HSMP) interface is a mailbox interface
> + between the x86 core and the System Management Unit (SMU) firmware.
> The driver provides a way for user space tools to monitor and manage
> system management functionality on EPYC server CPUs from AMD.
>
> - Host System Management Port (HSMP) interface is a mailbox interface
> - between the x86 core and the System Management Unit (SMU) firmware.
> +menu "AMD HSMP Probe"
> + depends on AMD_HSMP
> +
> +config AMD_HSMP_ACPI
> + tristate "ACPI based probe"
> + depends on ACPI
> + help
> + This driver supports ACPI based probing.
> +
> + You may enable this, if your platform bios provides an ACPI object
> + as described in the documentation.
>
> If you choose to compile this driver as a module the module will be
> called amd_hsmp.
> +
> +config AMD_HSMP_PLAT
> + tristate "Platform device based probe"
> + depends on AMD_HSMP_ACPI=n
> + help
> + This driver supports platform device based probing.
> +
> + You may enable this, if your platform bios does not provide
> + HSMP ACPI object.
> +
> + If you choose to compile this driver as a module the module will be
> + called amd_hsmp.
> +
One additional point, please also make sure it gets compiled if
COMPILE_TEST is set regardless of e.g. AMD_NB to get better
compile coverage.
--
i.
next prev parent reply other threads:[~2024-08-07 14:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-20 17:45 [v3 01/11] platform/x86/amd/hsmp: Create hsmp/ directory Suma Hegde
2024-07-20 17:45 ` [v3 02/11] platform/x86/amd/hsmp: Create wrapper function init_acpi() Suma Hegde
2024-07-20 17:45 ` [v3 03/11] platform/x86/amd/hsmp: Move structure and macros to header file Suma Hegde
2024-08-07 11:39 ` Ilpo Järvinen
2024-07-20 17:45 ` [v3 04/11] platform/x86/amd/hsmp: Move platform device specific code to plat.c Suma Hegde
2024-08-07 12:50 ` Ilpo Järvinen
2024-07-20 17:45 ` [v3 05/11] platform/x86/amd/hsmp: Move ACPI code to acpi.c Suma Hegde
2024-07-20 17:45 ` [v3 06/11] platform/x86/amd/hsmp: Change generic plat_dev name to hsmp_pdev Suma Hegde
2024-08-07 12:31 ` Ilpo Järvinen
2024-07-20 17:45 ` [v3 07/11] platform/x86/amd/hsmp: Create mutually exclusive ACPI and plat drivers Suma Hegde
2024-07-30 6:16 ` Suma Hegde
2024-07-30 13:20 ` Ilpo Järvinen
2024-08-06 11:40 ` Suma Hegde
2024-08-07 12:31 ` Ilpo Järvinen
2024-08-07 14:17 ` Ilpo Järvinen [this message]
2024-07-20 17:45 ` [v3 08/11] platform/x86/amd/hsmp: Use name space while exporting module symbols Suma Hegde
2024-07-20 17:45 ` [v3 09/11] platform/x86/amd/hsmp: Move read() and is_bin_visible() to respective files Suma Hegde
2024-08-07 12:37 ` Ilpo Järvinen
2024-07-20 17:45 ` [v3 10/11] platform/x86/amd/hsmp: Use dev_groups in the driver structure Suma Hegde
2024-07-20 17:45 ` [v3 11/11] platform/x86/amd/hsmp: Fix potential spectre issue Suma Hegde
2024-08-07 11:33 ` [v3 01/11] platform/x86/amd/hsmp: Create hsmp/ directory Ilpo Järvinen
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=79261dbf-f1b8-c357-3a03-d8c9f99b45a6@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=naveenkrishna.chatradhi@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=suma.hegde@amd.com \
/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