[PATCH v2 5/7] firmware: arm_scmi: Make use of FastChannels configurable

From: Cristian Marussi
Date: Mon Jun 06 2022 - 06:03:39 EST


Add a Kernel configuration entry used to optionally disable the usage of
SCMI FastChannels even on platforms where they are available.

Make such option default-yes to preserve the original SCMI system behaviour
of using any available FC.

Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
drivers/firmware/arm_scmi/Kconfig | 13 +++++++++++++
drivers/firmware/arm_scmi/perf.c | 3 ++-
drivers/firmware/arm_scmi/powercap.c | 3 ++-
3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
index 1e7b7fec97d9..624f32b61825 100644
--- a/drivers/firmware/arm_scmi/Kconfig
+++ b/drivers/firmware/arm_scmi/Kconfig
@@ -42,6 +42,19 @@ config ARM_SCMI_HAVE_MSG
This declares whether a message passing based transport for SCMI is
available.

+config ARM_SCMI_USE_FASTCHANNELS
+ bool "Use SCMI FastChannels when available"
+ default y
+ help
+ Use SCMI FastChannels when advertised as available by the platform.
+
+ On systems where the SCMI platform advertises the availability of
+ FastChannels, supported SCMI commands can be issued triggering a
+ one-way FastChannel request, much more quicker than using a
+ regular SCMI message transfer.
+ When set to N forces the OSPM to use instead regular SCMI message
+ transfers even if FastChannels are available. If unsure say Y.
+
config ARM_SCMI_TRANSPORT_MAILBOX
bool "SCMI transport based on Mailbox"
depends on MAILBOX
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 587b334589b0..3c491b3aa0bd 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -820,7 +820,8 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
scmi_perf_domain_attributes_get(ph, domain, dom, version);
scmi_perf_describe_levels_get(ph, domain, dom);

- if (dom->perf_fastchannels)
+ if (dom->perf_fastchannels &&
+ IS_ENABLED(CONFIG_ARM_SCMI_USE_FASTCHANNELS))
scmi_perf_domain_init_fc(ph, domain, &dom->fc_info);
}

diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c
index e9b4c34e1fb4..9e3a803d4f16 100644
--- a/drivers/firmware/arm_scmi/powercap.c
+++ b/drivers/firmware/arm_scmi/powercap.c
@@ -830,7 +830,8 @@ scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph)
if (ret)
return ret;

- if (pinfo->powercaps[domain].fastchannels)
+ if (pinfo->powercaps[domain].fastchannels &&
+ IS_ENABLED(CONFIG_ARM_SCMI_USE_FASTCHANNELS))
scmi_powercap_domain_init_fc(ph, domain,
&pinfo->powercaps[domain].fc_info);
}
--
2.32.0