[PATCH] firmware: arm_scmi: Fix Raw coexistence mode behaviour on failure path

Cristian Marussi posted 1 patch 2 years, 6 months ago
drivers/firmware/arm_scmi/driver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] firmware: arm_scmi: Fix Raw coexistence mode behaviour on failure path
Posted by Cristian Marussi 2 years, 6 months ago
When SCMI Raw coexistence mode is enabled make the core stack probe
successfully even when basic Base protocol exchanges with the platform
server failed.
This behaviour enables the system to boot with a broken regular SCMI stack
but with a fully functional and accessible SCMI Raw debugfs interface that
can be used to further debug the issue.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 drivers/firmware/arm_scmi/driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 9d97e44519d9..a75469727dd0 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -2700,6 +2700,7 @@ static int scmi_probe(struct platform_device *pdev)
 	struct scmi_handle *handle;
 	const struct scmi_desc *desc;
 	struct scmi_info *info;
+	bool coex = IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX);
 	struct device *dev = &pdev->dev;
 	struct device_node *child, *np = dev->of_node;
 
@@ -2774,9 +2775,6 @@ static int scmi_probe(struct platform_device *pdev)
 			dev_warn(dev, "Failed to setup SCMI debugfs.\n");
 
 		if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) {
-			bool coex =
-			      IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX);
-
 			ret = scmi_debugfs_raw_mode_setup(info);
 			if (!coex) {
 				if (ret)
@@ -2807,6 +2805,8 @@ static int scmi_probe(struct platform_device *pdev)
 	ret = scmi_protocol_acquire(handle, SCMI_PROTOCOL_BASE);
 	if (ret) {
 		dev_err(dev, "unable to communicate with SCMI\n");
+		if (coex)
+			return 0;
 		goto notification_exit;
 	}
 
-- 
2.34.1
Re: [PATCH] firmware: arm_scmi: Fix Raw coexistence mode behaviour on failure path
Posted by Sudeep Holla 2 years, 6 months ago
On Thu, 23 Feb 2023 15:23:30 +0000, Cristian Marussi wrote:
> When SCMI Raw coexistence mode is enabled make the core stack probe
> successfully even when basic Base protocol exchanges with the platform
> server failed.
> This behaviour enables the system to boot with a broken regular SCMI stack
> but with a fully functional and accessible SCMI Raw debugfs interface that
> can be used to further debug the issue.
> 
> [...]

Applied to sudeep.holla/linux (for-next/scmi/fixes), thanks!

[1/1] firmware: arm_scmi: Fix Raw coexistence mode behaviour on failure path
      https://git.kernel.org/sudeep.holla/c/b2b76e977fc6
--
Regards,
Sudeep