Skip to content

Commit d8283ac

Browse files
Marek VasutSudeep Holla
authored andcommitted
firmware: arm_scmi: Implement arm,no-completion-irq property
Implement new property arm,no-completion-irq, 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 to mbox/shmem based implementations. With this property set, such implementations which do not generate interrupts can be interacted with, until they are fixed to generate interrupts properly. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Message-Id: <20260117010241.186685-2-marek.vasut+renesas@mailbox.org> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
1 parent 0c5453b commit d8283ac

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/firmware/arm_scmi/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ struct scmi_transport_ops {
235235
* to have an execution latency lesser-equal to the threshold
236236
* should be considered for atomic mode operation: such
237237
* decision is finally left up to the SCMI drivers.
238+
* @no_completion_irq: Flag to indicate that this transport has no completion
239+
* interrupt and has to be polled. This is similar to the
240+
* force_polling below, except this is set via DT property.
238241
* @force_polling: Flag to force this whole transport to use SCMI core polling
239242
* mechanism instead of completion interrupts even if available.
240243
* @sync_cmds_completed_on_ret: Flag to indicate that the transport assures
@@ -254,6 +257,7 @@ struct scmi_desc {
254257
int max_msg;
255258
int max_msg_size;
256259
unsigned int atomic_threshold;
260+
bool no_completion_irq;
257261
const bool force_polling;
258262
const bool sync_cmds_completed_on_ret;
259263
const bool atomic_enabled;

drivers/firmware/arm_scmi/driver.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node,
27352735
cinfo->is_p2a = !tx;
27362736
cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms;
27372737
cinfo->max_msg_size = info->desc->max_msg_size;
2738+
cinfo->no_completion_irq = info->desc->no_completion_irq;
27382739

27392740
/* Create a unique name for this transport device */
27402741
snprintf(name, 32, "__scmi_transport_device_%s_%02X",
@@ -3150,6 +3151,9 @@ static const struct scmi_desc *scmi_transport_setup(struct device *dev)
31503151
if (ret && ret != -EINVAL)
31513152
dev_err(dev, "Malformed arm,max-msg DT property.\n");
31523153

3154+
trans->desc.no_completion_irq = of_property_read_bool(dev->of_node,
3155+
"arm,no-completion-irq");
3156+
31533157
dev_info(dev,
31543158
"SCMI max-rx-timeout: %dms / max-msg-size: %dbytes / max-msg: %d\n",
31553159
trans->desc.max_rx_timeout_ms, trans->desc.max_msg_size,

0 commit comments

Comments
 (0)