From: Teh Wen Ping <[email protected]>

commit b575e6b93a77c42ea31af0787347d5b3cc67fff4 from
https://github.com/altera-opensource/linux-socfpga.git

With the introduction of stratix10_svc_done(), all SMC call has to be
completed before calling stratix10_svc_done(). The driver is missing a
wait_for_completion_timeout() after requesting for
COMMAND_FIRMWARE_VERSION. This cause SVC driver to stop its thread before
COMMAND_FIRMWARE_VERSION is complete. Thus, the driver will receive
invalid firmware version.

Signed-off-by: Teh Wen Ping <[email protected]>
Signed-off-by: Wenlin Kang <[email protected]>
---
 drivers/fpga/stratix10-soc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
index 225a1211ba62..ca253ee400cb 100644
--- a/drivers/fpga/stratix10-soc.c
+++ b/drivers/fpga/stratix10-soc.c
@@ -496,6 +496,18 @@ static int s10_probe(struct platform_device *pdev)
                goto probe_err;
        }
 
+       ret = wait_for_completion_timeout(
+               &priv->status_return_completion, S10_RECONFIG_TIMEOUT);
+       if (!ret) {
+               dev_err(dev, "timeout waiting for firmware version\n");
+               stratix10_svc_done(priv->chan);
+               fpga_mgr_free(mgr);
+               ret = -ETIMEDOUT;
+               goto probe_err;
+       }
+
+       ret = 0;
+
        stratix10_svc_done(priv->chan);
        platform_set_drvdata(pdev, mgr);
        return ret;
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12285): 
https://lists.yoctoproject.org/g/linux-yocto/message/12285
Mute This Topic: https://lists.yoctoproject.org/mt/97769992/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to