mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 14:40:12 -04:00
firmware: arm_scmi: Make polling mode optional
Add a check for the presence of .poll_done transport operation so that transports that do not need to support polling mode have no need to provide a dummy .poll_done callback either and polling mode can be disabled in the SCMI core for that tranport. Link: https://lore.kernel.org/r/20210803131024.40280-8-cristian.marussi@arm.com Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
committed by
Sudeep Holla
parent
e9b21c9618
commit
2930abcffd
@@ -751,6 +751,12 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
|
||||
struct device *dev = info->dev;
|
||||
struct scmi_chan_info *cinfo;
|
||||
|
||||
if (xfer->hdr.poll_completion && !info->desc->ops->poll_done) {
|
||||
dev_warn_once(dev,
|
||||
"Polling mode is not supported by transport.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise protocol id now from protocol handle to avoid it being
|
||||
* overridden by mistake (or malice) by the protocol code mangling with
|
||||
@@ -787,7 +793,6 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
|
||||
ktime_t stop = ktime_add_ns(ktime_get(), SCMI_MAX_POLL_TO_NS);
|
||||
|
||||
spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop));
|
||||
|
||||
if (ktime_before(ktime_get(), stop)) {
|
||||
unsigned long flags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user