diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2021-12-20 22:56:41 +0300 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2021-12-21 13:59:37 +0300 |
commit | 69255e746890274e887ba36a403019380cde0b48 (patch) | |
tree | 5abc6897bcfcd248af38afbde355032e0b22f0b6 /drivers/firmware/arm_scmi/common.h | |
parent | bf322084fec30b92423911db0169a3610008fc15 (diff) | |
download | linux-69255e746890274e887ba36a403019380cde0b48.tar.xz |
firmware: arm_scmi: Add support for atomic transports
An SCMI transport can be configured as .atomic_enabled in order to signal
to the SCMI core that all its TX path is executed in atomic context and
that, when requested, polling mode should be used while waiting for command
responses.
When a specific platform configuration had properly configured such a
transport as .atomic_enabled, the SCMI core will also take care not to
sleep in the corresponding RX path while waiting for a response if that
specific command transaction was requested as atomic using polling mode.
Asynchronous commands should not be used in an atomic context and so a
warning is emitted if polling was requested for an asynchronous command.
Add also a method to check, from the SCMI drivers, if the underlying SCMI
transport is currently configured to support atomic transactions: this will
be used by upper layers to determine if atomic requests can be supported at
all on this SCMI instance.
Link: https://lore.kernel.org/r/20211220195646.44498-7-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/common.h')
-rw-r--r-- | drivers/firmware/arm_scmi/common.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 24b1d1ac5f12..01d42c2069d4 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -416,6 +416,9 @@ struct scmi_device *scmi_child_dev_find(struct device *parent, * Used by core internally only when polling is * selected as a waiting for reply method: i.e. * if a completion irq was found use that anyway. + * @atomic_enabled: Flag to indicate that this transport, which is assured not + * to sleep anywhere on the TX path, can be used in atomic mode + * when requested. */ struct scmi_desc { int (*transport_init)(void); @@ -426,6 +429,7 @@ struct scmi_desc { int max_msg_size; const bool force_polling; const bool sync_cmds_completed_on_ret; + const bool atomic_enabled; }; #ifdef CONFIG_ARM_SCMI_TRANSPORT_MAILBOX |