aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorCristian Marussi2021-06-06 23:12:24 +0100
committerSudeep Holla2021-06-08 16:04:54 +0100
commite30d91d4ffda0b30839bb5e7d2a123654de95045 (patch)
tree7322fb3e6fdc3cff7383d3c35eb2994baae3a048 /drivers/firmware
parentf1748b1ee1fa0fd1a074504045b530b62f949188 (diff)
firmware: arm_scmi: Move reinit_completion from scmi_xfer_get to do_xfer
Re-using timed out xfers in a loop can lead to issue if completion was not properly reinitialized. Move reinit_completion from scmi_xfer_get to do_xfer to avoid the issue. Link: https://lore.kernel.org/r/20210606221232.33768-3-cristian.marussi@arm.com Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> [sudeep.holla: moved reinit_completion instead of adding another one] Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/arm_scmi/driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 74986bf96656..80010d3f5975 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -241,7 +241,6 @@ static struct scmi_xfer *scmi_xfer_get(const struct scmi_handle *handle,
xfer = &minfo->xfer_block[xfer_id];
xfer->hdr.seq = xfer_id;
- reinit_completion(&xfer->done);
xfer->transfer_id = atomic_inc_return(&transfer_last_id);
return xfer;
@@ -438,6 +437,7 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
* the scmi_xfer structure.
*/
xfer->hdr.protocol_id = pi->proto->id;
+ reinit_completion(&xfer->done);
cinfo = idr_find(&info->tx_idr, xfer->hdr.protocol_id);
if (unlikely(!cinfo))