Commit e30d91d4 authored by Cristian Marussi's avatar Cristian Marussi Committed by Sudeep Holla
Browse files

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: default avatarCristian Marussi <cristian.marussi@arm.com>
[sudeep.holla: moved reinit_completion instead of adding another one]
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent f1748b1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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))