summaryrefslogtreecommitdiff
path: root/drivers/firmware/arm_scmi/bus.c
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2023-01-18 15:14:23 +0300
committerSudeep Holla <sudeep.holla@arm.com>2023-01-20 14:41:23 +0300
commitba80acb0dfca87e6a6257932414350da85dde48f (patch)
tree9ec8ea4add0ec5dcd6d66c53dc14444d94e793de /drivers/firmware/arm_scmi/bus.c
parent74225707b3349d52e6b99a2e15185b5db8126637 (diff)
downloadlinux-ba80acb0dfca87e6a6257932414350da85dde48f.tar.xz
firmware: arm_scmi: Reject SCMI drivers when configured in raw mode
Reject SCMI driver registration when SCMI raw mode support is configured, so as to avoid interferences between the SCMI raw mode transactions and the normal SCMI stack operations. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Vincent Guittot <vincent.guittot@linaro.org> Link: https://lore.kernel.org/r/20230118121426.492864-15-cristian.marussi@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/bus.c')
-rw-r--r--drivers/firmware/arm_scmi/bus.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 6228f1581fe3..8601d75f5b9b 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -59,6 +59,12 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table)
pr_debug("Requesting SCMI device (%s) for protocol %x\n",
id_table->name, id_table->protocol_id);
+ if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) {
+ pr_warn("SCMI Raw mode active. Rejecting '%s'/0x%02X\n",
+ id_table->name, id_table->protocol_id);
+ return -EINVAL;
+ }
+
/*
* Search for the matching protocol rdev list and then search
* of any existent equally named device...fails if any duplicate found.