[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220227205608.30812-17-cristian.marussi@arm.com>
Date: Sun, 27 Feb 2022 20:56:08 +0000
From: Cristian Marussi <cristian.marussi@....com>
To: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc: sudeep.holla@....com, james.quinlan@...adcom.com,
Jonathan.Cameron@...wei.com, f.fainelli@...il.com,
vincent.guittot@...aro.org, souvik.chakravarty@....com,
peter.hilber@...nsynergy.com, cristian.marussi@....com
Subject: [RFC PATCH 16/16] [DEBUG]: firmware: arm_scmi: Add Kconfig to allow SCMI Testing driver coexistence
firmware: arm_scmi: Add Kconfig to allow SCMI Testing driver coexistence
Signed-off-by: Cristian Marussi <cristian.marussi@....com>
---
drivers/firmware/arm_scmi/Kconfig | 6 ++++++
drivers/firmware/arm_scmi/driver.c | 15 ++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
index a3726074c89e..c3fc608d5373 100644
--- a/drivers/firmware/arm_scmi/Kconfig
+++ b/drivers/firmware/arm_scmi/Kconfig
@@ -160,4 +160,10 @@ config ARM_SCMI_TEST_DRIVER
This driver can also be built as a module. If so, the module
will be called scmi_test_driver.
+config ARM_SCMI_TEST_DRIVER_COEXISTENCE
+ bool "Allow Coexistence of SCMI standard drivers and test driver"
+ depends on ARM_SCMI_TEST_DRIVER
+ help
+ This enables coexistence for concurrent SCMI drievrs and testing driver.
+
endmenu
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 8c4706b24368..ff692c458a0b 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1782,14 +1782,15 @@ 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_TEST_DRIVER)
- /* Reject non-testing SCMI drivers */
- if (strncmp(id_table->name, "__scmi_test", strlen("__scmi_test"))) {
- pr_warn("SCMI Test driver loaded. Rejecting '%s'/0x%X\n",
- id_table->name, id_table->protocol_id);
- return -EINVAL;
+ if (IS_ENABLED(CONFIG_ARM_SCMI_TEST_DRIVER) &&
+ !IS_ENABLED(CONFIG_ARM_SCMI_TEST_DRIVER_COEXISTENCE)) {
+ /* Reject non-testing SCMI drivers */
+ if (strncmp(id_table->name, "__scmi_test", strlen("__scmi_test"))) {
+ pr_warn("SCMI Test driver loaded. Rejecting driver: '%s'/0x%X\n",
+ id_table->name, id_table->protocol_id);
+ return -EBUSY;
+ }
}
-#endif
/*
* Search for the matching protocol rdev list and then search
--
2.17.1
Powered by blists - more mailing lists