firmware: arm_scmi: Add configurable polling mode for transports
authorCristian Marussi <cristian.marussi@arm.com>
Mon, 20 Dec 2021 19:56:36 +0000 (19:56 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 21 Dec 2021 10:55:11 +0000 (10:55 +0000)
commita690b7e6e774b7c43fed37d5bd3b6e037f3b3db9
tree0c9640505b930a6903cbc2aa5e785dafb66d2aff
parentf872af09094c042ac46e64d030f223b63ead5967
firmware: arm_scmi: Add configurable polling mode for transports

SCMI communications along TX channels can optionally be provided of a
completion interrupt; when such interrupt is not available, command
transactions should rely on polling, where the SCMI core takes care to
repeatedly evaluate the transport-specific .poll_done() function, if
available, to determine if and when a request was fully completed or
timed out.

Such mechanism is already present and working on a single transfer base:
SCMI protocols can indeed enable hdr.poll_completion on specific commands
ahead of each transfer and cause that transaction to be handled with
polling.

Introduce a couple of flags to be able to enforce such polling behaviour
globally at will:

 - scmi_desc.force_polling: to statically switch the whole transport to
   polling mode.

 - scmi_chan_info.no_completion_irq: to switch a single channel dynamically
   to polling mode if, at runtime, is determined that no completion
   interrupt was available for such channel.

Link: https://lore.kernel.org/r/20211220195646.44498-2-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/common.h
drivers/firmware/arm_scmi/driver.c