diff mbox series

[v2,1/4] firmware: arm_scmi: fix deps arm-smccc-discovery deps in Kconfig

Message ID 20210521134055.24271-1-etienne.carriere@linaro.org (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] firmware: arm_scmi: fix deps arm-smccc-discovery deps in Kconfig | expand

Commit Message

Etienne Carriere May 21, 2021, 1:40 p.m. UTC
ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
not MAILBOX only. This change fixes this in Kconfig file and driver
private header file.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
No change since v1
---
 drivers/firmware/Kconfig           | 2 +-
 drivers/firmware/arm_scmi/common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Sudeep Holla May 21, 2021, 3:15 p.m. UTC | #1
+ Florian

On Fri, May 21, 2021 at 03:40:51PM +0200, Etienne Carriere wrote:
> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
> not MAILBOX only. This change fixes this in Kconfig file and driver
> private header file.
>

Since HAVE_ARM_SMCCC_DISCOVERY depends on ARM_PSCI_FW, I want to check
if this is used on any 32-bit platforms w/o ARM_PSCI_FW
Florian Fainelli May 21, 2021, 3:20 p.m. UTC | #2
On 5/21/2021 8:15 AM, Sudeep Holla wrote:
> + Florian
> 
> On Fri, May 21, 2021 at 03:40:51PM +0200, Etienne Carriere wrote:
>> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
>> not MAILBOX only. This change fixes this in Kconfig file and driver
>> private header file.
>>
> 
> Since HAVE_ARM_SMCCC_DISCOVERY depends on ARM_PSCI_FW, I want to check
> if this is used on any 32-bit platforms w/o ARM_PSCI_FW

Not on ARCH_BRCMSTB, there is no SMCCC without PSCI.
Sudeep Holla May 21, 2021, 3:26 p.m. UTC | #3
On Fri, May 21, 2021 at 08:20:29AM -0700, Florian Fainelli wrote:
> On 5/21/2021 8:15 AM, Sudeep Holla wrote:
> > + Florian
> > 
> > On Fri, May 21, 2021 at 03:40:51PM +0200, Etienne Carriere wrote:
> >> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
> >> not MAILBOX only. This change fixes this in Kconfig file and driver
> >> private header file.
> >>
> > 
> > Since HAVE_ARM_SMCCC_DISCOVERY depends on ARM_PSCI_FW, I want to check
> > if this is used on any 32-bit platforms w/o ARM_PSCI_FW
> 
> Not on ARCH_BRCMSTB, there is no SMCCC without PSCI.

Thanks for the confirmation.
Cristian Marussi May 27, 2021, 1:28 p.m. UTC | #4
Hi Etienne,

On Fri, May 21, 2021 at 03:40:51PM +0200, Etienne Carriere wrote:
> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
> not MAILBOX only. This change fixes this in Kconfig file and driver
> private header file.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
> ---
> No change since v1
> ---
>  drivers/firmware/Kconfig           | 2 +-
>  drivers/firmware/arm_scmi/common.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
> index db0ea2d2d75a..a9c613c32282 100644
> --- a/drivers/firmware/Kconfig
> +++ b/drivers/firmware/Kconfig
> @@ -9,7 +9,7 @@ menu "Firmware Drivers"
>  config ARM_SCMI_PROTOCOL
>  	tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
>  	depends on ARM || ARM64 || COMPILE_TEST
> -	depends on MAILBOX
> +	depends on MAILBOX || HAVE_ARM_SMCCC_DISCOVERY
>  	help
>  	  ARM System Control and Management Interface (SCMI) protocol is a
>  	  set of operating system-independent software interfaces that are
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index 228bf4a71d23..8685619d38f9 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -331,7 +331,7 @@ struct scmi_desc {
>  };
>  
>  extern const struct scmi_desc scmi_mailbox_desc;
> -#ifdef CONFIG_HAVE_ARM_SMCCC
> +#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
>  extern const struct scmi_desc scmi_smc_desc;
>  #endif
>  

This seems reasonable to me as of now, but I have to say in the original 
virtio-scmi series from Peter this issue is tackled a bit differently:

(https://lore.kernel.org/linux-arm-kernel/20210511002040.802226-1-peter.hilber@opensynergy.com/)

adding something like ARM_SCMI_HAVE_SHMEM and ARM_SCMI_HAVE_MSG and then
make mailbox and smc transport select HAVE_SHMEM while virtio selects
HAVE_MSG and keeping ARM_SCMI_PROTOCOL depends on either of those.

I found such approach a bit better in term of abstraction indeed, but
given that such virtio-scmi series I'm reworking is still probably a bit
further down the line in terms of posting, I think that your solution is
good enough for now if Sudeep agrees with it, and we can switch to the
above mentioned HAVE_* abstractions once virtio-scmi is pushed forward.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian

> -- 
> 2.17.1
>
Sudeep Holla June 2, 2021, 10:55 a.m. UTC | #5
On Fri, May 21, 2021 at 03:40:51PM +0200, Etienne Carriere wrote:
> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
> not MAILBOX only. This change fixes this in Kconfig file and driver
> private header file.
> 

Applied unless there are any new build issues.
Sudeep Holla June 4, 2021, 8:53 a.m. UTC | #6
On Fri, 21 May 2021 15:40:51 +0200, Etienne Carriere wrote:
> ARM_SCMI_PROTOCOL depends one either MAILBOX or HAVE_ARM_SMCCC_DISCOVERY,
> not MAILBOX only. This change fixes this in Kconfig file and driver
> private header file.

Applied to sudeep.holla/linux (v5.13/scmi_dt_schema), thanks!

[1/4] firmware: arm_scmi: fix deps arm-smccc-discovery deps in Kconfig
      https://git.kernel.org/sudeep.holla/c/c05b07963e

--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index db0ea2d2d75a..a9c613c32282 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -9,7 +9,7 @@  menu "Firmware Drivers"
 config ARM_SCMI_PROTOCOL
 	tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
 	depends on ARM || ARM64 || COMPILE_TEST
-	depends on MAILBOX
+	depends on MAILBOX || HAVE_ARM_SMCCC_DISCOVERY
 	help
 	  ARM System Control and Management Interface (SCMI) protocol is a
 	  set of operating system-independent software interfaces that are
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 228bf4a71d23..8685619d38f9 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -331,7 +331,7 @@  struct scmi_desc {
 };
 
 extern const struct scmi_desc scmi_mailbox_desc;
-#ifdef CONFIG_HAVE_ARM_SMCCC
+#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
 extern const struct scmi_desc scmi_smc_desc;
 #endif