[RFC PATCH 02/10] firmware: arm_scmi: Add missing xfer reinit_completion
From: Cristian Marussi
Date: Sun Jun 06 2021 - 18:13:26 EST
Reusing timed out xfers in a loop can lead to issue if completion was not
properly reinitialized.
Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
drivers/firmware/arm_scmi/driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index bee33f9c2032..759ae4a23e74 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -448,6 +448,7 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
xfer->hdr.poll_completion);
xfer->hdr.status = SCMI_SUCCESS;
+ reinit_completion(&xfer->done);
ret = info->desc->ops->send_message(cinfo, xfer);
if (ret < 0) {
dev_dbg(dev, "Failed to send message %d\n", ret);
--
2.17.1