Skip to content

Commit

Permalink
fpga: stratix10-soc: make FPGA task un-interruptible
Browse files Browse the repository at this point in the history
When CTRL+C occurs during the process of FPGA reconfiguration, the FPGA
reconfiguration process stops and the user can't perform a new FPGA
reconfiguration properly.

Set FPGA task to be not interruptible so that the user can properly
perform FPGA reconfiguration after CTRL+C event.

Signed-off-by: Richard Gong <[email protected]>
Reviewed-by: Tom Rix <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
  • Loading branch information
rgongatintel authored and mfischer committed Aug 20, 2020
1 parent 9123e3a commit 7fbc2bc
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions drivers/fpga/stratix10-soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,13 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
if (ret < 0)
goto init_done;

ret = wait_for_completion_interruptible_timeout(
ret = wait_for_completion_timeout(
&priv->status_return_completion, S10_RECONFIG_TIMEOUT);
if (!ret) {
dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n");
ret = -ETIMEDOUT;
goto init_done;
}
if (ret < 0) {
dev_err(dev, "error (%d) waiting for RECONFIG_REQUEST\n", ret);
goto init_done;
}

ret = 0;
if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) {
Expand Down Expand Up @@ -318,7 +314,7 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf,
*/
wait_status = 1; /* not timed out */
if (!priv->status)
wait_status = wait_for_completion_interruptible_timeout(
wait_status = wait_for_completion_timeout(
&priv->status_return_completion,
S10_BUFFER_TIMEOUT);

Expand All @@ -340,13 +336,6 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf,
ret = -ETIMEDOUT;
break;
}
if (wait_status < 0) {
ret = wait_status;
dev_err(dev,
"error (%d) waiting for svc layer buffers\n",
ret);
break;
}
}

if (!s10_free_buffers(mgr))
Expand All @@ -372,20 +361,14 @@ static int s10_ops_write_complete(struct fpga_manager *mgr,
if (ret < 0)
break;

ret = wait_for_completion_interruptible_timeout(
ret = wait_for_completion_timeout(
&priv->status_return_completion, timeout);
if (!ret) {
dev_err(dev,
"timeout waiting for RECONFIG_COMPLETED\n");
ret = -ETIMEDOUT;
break;
}
if (ret < 0) {
dev_err(dev,
"error (%d) waiting for RECONFIG_COMPLETED\n",
ret);
break;
}
/* Not error or timeout, so ret is # of jiffies until timeout */
timeout = ret;
ret = 0;
Expand Down

0 comments on commit 7fbc2bc

Please sign in to comment.