Skip to content

Commit

Permalink
firmware: arm_scmi: Add delayed response status check
Browse files Browse the repository at this point in the history
[ Upstream commit f1748b1 ]

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: 58ecdf0 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
freefall75 authored and gregkh committed Jul 20, 2021
1 parent 3b28d08 commit e1ff512
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/firmware/arm_scmi/driver.c
Expand Up @@ -517,8 +517,12 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
xfer->async_done = &async_response;

ret = do_xfer(ph, xfer);
if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
ret = -ETIMEDOUT;
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;
Expand Down

0 comments on commit e1ff512

Please sign in to comment.