Skip to content

Commit

Permalink
HSD #14017114324: fpga: stratix10-soc: wait for COMMAND_FIRMWARE_VERS…
Browse files Browse the repository at this point in the history
…ION to complete

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]>
  • Loading branch information
wenpingt committed Sep 22, 2022
1 parent 7ee59f5 commit 6a618e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/fpga/stratix10-soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,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;
Expand Down

0 comments on commit 6a618e1

Please sign in to comment.