Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76f5314d authored by Cristian Marussi's avatar Cristian Marussi Committed by Greg Kroah-Hartman
Browse files

firmware: arm_scmi: Add delayed response status check

commit f1748b1ee1fa0fd1a074504045b530b62f949188 upstream.

A successfully received delayed response could anyway report a failure at
the protocol layer in the message status field.

Add a check also for this error condition.

Link: https://lore.kernel.org/r/20210608103056.3388-1-cristian.marussi@arm.com


Fixes: 58ecdf03 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b38f70b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -515,8 +515,12 @@ int scmi_do_xfer_with_response(const struct scmi_handle *handle,
	xfer->async_done = &async_response;

	ret = scmi_do_xfer(handle, xfer);
	if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
	if (!ret) {
		if (!wait_for_completion_timeout(xfer->async_done, timeout))
			ret = -ETIMEDOUT;
		else if (xfer->hdr.status)
			ret = scmi_to_linux_errno(xfer->hdr.status);
	}

	xfer->async_done = NULL;
	return ret;