From: Marek Vasut <marek.vasut+renesas@mailbox.org>
To: arm-scmi@vger.kernel.org
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>,
Conor Dooley <conor+dt@kernel.org>,
Cristian Marussi <cristian.marussi@arm.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Rob Herring <robh@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-renesas-soc@vger.kernel.org
Subject: [PATCH 2/2] firmware: arm_scmi: Implement arm,poll-transport property
Date: Thu, 23 Oct 2025 14:35:58 +0200 [thread overview]
Message-ID: <20251023123644.8730-2-marek.vasut+renesas@mailbox.org> (raw)
In-Reply-To: <20251023123644.8730-1-marek.vasut+renesas@mailbox.org>
Implement new property arm,poll-transport, which sets all SCMI operation into
poll mode. This is meant to work around uncooperative SCP implementations,
which do not generate completion interrupts. This applies primarily on mbox
based implementations, but does also cover SMC and VirtIO ones.
With this property set, such implementations which do not generate interrupts
can be interacted with, until they are fixed to generate interrupts properly.
The SMC transport is modified such, that it ignores interrupts described in
DT in case this property is set. This is an edge case, where the SMC transport
may use this property to ignore broken interrupts too.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: arm-scmi@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
---
drivers/firmware/arm_scmi/common.h | 4 ++++
drivers/firmware/arm_scmi/driver.c | 4 ++++
drivers/firmware/arm_scmi/transports/smc.c | 20 +++++++++++---------
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 7c35c95fddbaf..7c9617d080a02 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -235,6 +235,9 @@ struct scmi_transport_ops {
* to have an execution latency lesser-equal to the threshold
* should be considered for atomic mode operation: such
* decision is finally left up to the SCMI drivers.
+ * @no_completion_irq: Flag to indicate that this transport has no completion
+ * interrupt and has to be polled. This is similar to the
+ * force_polling below, except this is set via DT property.
* @force_polling: Flag to force this whole transport to use SCMI core polling
* mechanism instead of completion interrupts even if available.
* @sync_cmds_completed_on_ret: Flag to indicate that the transport assures
@@ -254,6 +257,7 @@ struct scmi_desc {
int max_msg;
int max_msg_size;
unsigned int atomic_threshold;
+ bool no_completion_irq;
const bool force_polling;
const bool sync_cmds_completed_on_ret;
const bool atomic_enabled;
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 5caa9191a8d1a..1079c84608a2c 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -2677,6 +2677,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node,
cinfo->is_p2a = !tx;
cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms;
cinfo->max_msg_size = info->desc->max_msg_size;
+ cinfo->no_completion_irq = info->desc->no_completion_irq;
/* Create a unique name for this transport device */
snprintf(name, 32, "__scmi_transport_device_%s_%02X",
@@ -3092,6 +3093,9 @@ static const struct scmi_desc *scmi_transport_setup(struct device *dev)
if (ret && ret != -EINVAL)
dev_err(dev, "Malformed arm,max-msg DT property.\n");
+ trans->desc.no_completion_irq = of_property_read_bool(dev->of_node,
+ "arm,poll-transport");
+
dev_info(dev,
"SCMI max-rx-timeout: %dms / max-msg-size: %dbytes / max-msg: %d\n",
trans->desc.max_rx_timeout_ms, trans->desc.max_msg_size,
diff --git a/drivers/firmware/arm_scmi/transports/smc.c b/drivers/firmware/arm_scmi/transports/smc.c
index 21abb571e4f2f..85bfab650f100 100644
--- a/drivers/firmware/arm_scmi/transports/smc.c
+++ b/drivers/firmware/arm_scmi/transports/smc.c
@@ -177,16 +177,18 @@ static int smc_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
* completion of a message is signaled by an interrupt rather than by
* the return of the SMC call.
*/
- scmi_info->irq = of_irq_get_byname(cdev->of_node, "a2p");
- if (scmi_info->irq > 0) {
- ret = request_irq(scmi_info->irq, smc_msg_done_isr,
- IRQF_NO_SUSPEND, dev_name(dev), scmi_info);
- if (ret) {
- dev_err(dev, "failed to setup SCMI smc irq\n");
- return ret;
+ if (!cinfo->no_completion_irq) {
+ scmi_info->irq = of_irq_get_byname(cdev->of_node, "a2p");
+ if (scmi_info->irq > 0) {
+ ret = request_irq(scmi_info->irq, smc_msg_done_isr,
+ IRQF_NO_SUSPEND, dev_name(dev), scmi_info);
+ if (ret) {
+ dev_err(dev, "failed to setup SCMI smc irq\n");
+ return ret;
+ }
+ } else {
+ cinfo->no_completion_irq = true;
}
- } else {
- cinfo->no_completion_irq = true;
}
scmi_info->func_id = func_id;
--
2.51.0
next prev parent reply other threads:[~2025-10-23 12:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 12:35 [PATCH 1/2] dt-bindings: firmware: arm,scmi: Document arm,poll-transport property Marek Vasut
2025-10-23 12:35 ` Marek Vasut [this message]
2025-10-23 13:07 ` Geert Uytterhoeven
2025-10-23 13:19 ` Marek Vasut
2025-10-23 13:16 ` Sudeep Holla
2025-10-23 13:42 ` Marek Vasut
2025-10-23 14:30 ` Cristian Marussi
2025-10-23 14:36 ` Marek Vasut
2025-10-23 14:36 ` Sudeep Holla
2025-10-23 14:47 ` Marek Vasut
2025-10-23 13:42 ` Sudeep Holla
2025-10-23 13:57 ` Marek Vasut
2025-10-23 13:45 ` Cristian Marussi
2025-10-23 14:00 ` Marek Vasut
2025-10-30 0:52 ` Marek Vasut
2025-11-13 11:03 ` Cristian Marussi
2025-11-13 11:34 ` Marek Vasut
2025-11-14 7:21 ` Wolfram Sang
2025-12-02 14:52 ` Sudeep Holla
2025-12-02 16:36 ` Marek Vasut
2025-12-02 18:55 ` Sudeep Holla
2025-12-02 19:25 ` Marek Vasut
2025-12-03 11:41 ` Sudeep Holla
2025-12-03 22:53 ` Marek Vasut
2025-12-04 12:33 ` Sudeep Holla
2025-12-04 18:59 ` Marek Vasut
2025-12-05 9:54 ` Sudeep Holla
2025-12-07 9:16 ` Marek Vasut
2025-12-08 16:30 ` Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251023123644.8730-2-marek.vasut+renesas@mailbox.org \
--to=marek.vasut+renesas@mailbox.org \
--cc=arm-scmi@vger.kernel.org \
--cc=conor+dt@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).