X86 platform drivers
 help / color / mirror / Atom feed
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: [v2 07/11] platform/x86/amd/hsmp: Create mutually exclusive ACPI and plat drivers
Date: Thu, 11 Jul 2024 13:02:30 +0300 (EEST)	[thread overview]
Message-ID: <4bb0600e-06b4-5f59-7aa3-9bc65f1698b4@linux.intel.com> (raw)
In-Reply-To: <20240711073314.2704871-7-suma.hegde@amd.com>

On Thu, 11 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 v1:
> Rename "plat_dev" to "hsmp_pdev"
> 
>  arch/x86/include/asm/amd_hsmp.h        |   2 +-
>  drivers/platform/x86/amd/hsmp/Kconfig  |  25 ++++-
>  drivers/platform/x86/amd/hsmp/Makefile |  10 +-
>  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 +++++++------------------
>  7 files changed, 186 insertions(+), 125 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/hsmp/Kconfig b/drivers/platform/x86/amd/hsmp/Kconfig
> index b55d4ed9bceb..15888a89581a 100644
> --- a/drivers/platform/x86/amd/hsmp/Kconfig
> +++ b/drivers/platform/x86/amd/hsmp/Kconfig
> @@ -3,9 +3,30 @@
>  # AMD HSMP Driver
>  #
>  
> +menu "AMD Host System Management Port driver"
> +	depends on AMD_NB
> +
> +config AMD_HSMP_ACPI
> +	tristate "AMD HSMP ACPI driver"
> +	depends on ACPI
> +	help
> +	  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.
> +
> +	  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
>  	tristate "AMD HSMP Driver"
> -	depends on AMD_NB && X86_64 && ACPI
> +	depends on AMD_HSMP_ACPI=n
>  	help
>  	  The driver provides a way for user space tools to monitor and manage
>  	  system management functionality on EPYC server CPUs from AMD.
> @@ -15,3 +36,5 @@ config AMD_HSMP
>  
>  	  If you choose to compile this driver as a module the module will be
>  	  called amd_hsmp.
> +
> +endmenu
> diff --git a/drivers/platform/x86/amd/hsmp/Makefile b/drivers/platform/x86/amd/hsmp/Makefile
> index 0cc92865c0a2..53ebc462b0f9 100644
> --- a/drivers/platform/x86/amd/hsmp/Makefile
> +++ b/drivers/platform/x86/amd/hsmp/Makefile
> @@ -4,5 +4,11 @@
>  # AMD HSMP Driver
>  #
>  
> -obj-$(CONFIG_AMD_HSMP)		+= amd_hsmp.o
> -amd_hsmp-objs			:= hsmp.o plat.o acpi.o
> +ifneq ($(CONFIG_AMD_HSMP), )
> +obj-$(CONFIG_AMD_HSMP)          += amd_hsmp.o
> +amd_hsmp-objs = hsmp.o plat.o
> +endif
> +ifneq ($(CONFIG_AMD_HSMP_ACPI), )
> +obj-$(CONFIG_AMD_HSMP_ACPI)     += amd_hsmp.o
> +amd_hsmp-objs = hsmp.o acpi.o
> +endif

I still don't agree with this approach. You can add another config for the 
hsmp core and select it, and it will work with the existing configs when 
they're properly run through make oldconfig or olddefconfig before 
building.

-- 
 i.


  reply	other threads:[~2024-07-11 10:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  7:33 [v2 01/11] platform/x86/amd/hsmp: Create hsmp/ directory Suma Hegde
2024-07-11  7:33 ` [v2 02/11] platform/x86/amd/hsmp: Create wrapper function init_acpi() Suma Hegde
2024-07-11  7:33 ` [v2 03/11] platform/x86/amd/hsmp: Move structure and macros to header file Suma Hegde
2024-07-11  7:33 ` [v2 04/11] platform/x86/amd/hsmp: Move platform device specific code to plat.c Suma Hegde
2024-07-11  7:33 ` [v2 05/11] platform/x86/amd/hsmp: Move ACPI code to acpi.c Suma Hegde
2024-07-11  7:33 ` [v2 06/11] platform/x86/amd/hsmp: Change generic plat_dev name to hsmp_pdev Suma Hegde
2024-07-11  9:54   ` Ilpo Järvinen
2024-07-11  7:33 ` [v2 07/11] platform/x86/amd/hsmp: Create mutually exclusive ACPI and plat drivers Suma Hegde
2024-07-11 10:02   ` Ilpo Järvinen [this message]
2024-07-11  7:33 ` [v2 08/11] platform/x86/amd/hsmp: Use name space while exporting module symbols Suma Hegde
2024-07-11  7:33 ` [v2 09/11] platform/x86/amd/hsmp: Move read() and is_bin_visible() to respective files Suma Hegde
2024-07-11  7:33 ` [v2 10/11] platform/x86/amd/hsmp: Use dev_groups in the driver structure Suma Hegde
2024-07-11  7:33 ` [v2 11/11] platform/x86/amd/hsmp: Fix potential spectre issue Suma Hegde

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=4bb0600e-06b4-5f59-7aa3-9bc65f1698b4@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