Skip to content

Commit 7fbc2bc

Browse files
rgongatintelmfischer
authored andcommitted
fpga: stratix10-soc: make FPGA task un-interruptible
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 <richard.gong@intel.com> Reviewed-by: Tom Rix <trix@redhat.com> Signed-off-by: Moritz Fischer <mdf@kernel.org>
1 parent 9123e3a commit 7fbc2bc

1 file changed

Lines changed: 3 additions & 20 deletions

File tree

‎drivers/fpga/stratix10-soc.c‎

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,13 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
196196
if (ret < 0)
197197
goto init_done;
198198

199-
ret = wait_for_completion_interruptible_timeout(
199+
ret = wait_for_completion_timeout(
200200
&priv->status_return_completion, S10_RECONFIG_TIMEOUT);
201201
if (!ret) {
202202
dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n");
203203
ret = -ETIMEDOUT;
204204
goto init_done;
205205
}
206-
if (ret < 0) {
207-
dev_err(dev, "error (%d) waiting for RECONFIG_REQUEST\n", ret);
208-
goto init_done;
209-
}
210206

211207
ret = 0;
212208
if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) {
@@ -318,7 +314,7 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf,
318314
*/
319315
wait_status = 1; /* not timed out */
320316
if (!priv->status)
321-
wait_status = wait_for_completion_interruptible_timeout(
317+
wait_status = wait_for_completion_timeout(
322318
&priv->status_return_completion,
323319
S10_BUFFER_TIMEOUT);
324320

@@ -340,13 +336,6 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf,
340336
ret = -ETIMEDOUT;
341337
break;
342338
}
343-
if (wait_status < 0) {
344-
ret = wait_status;
345-
dev_err(dev,
346-
"error (%d) waiting for svc layer buffers\n",
347-
ret);
348-
break;
349-
}
350339
}
351340

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

375-
ret = wait_for_completion_interruptible_timeout(
364+
ret = wait_for_completion_timeout(
376365
&priv->status_return_completion, timeout);
377366
if (!ret) {
378367
dev_err(dev,
379368
"timeout waiting for RECONFIG_COMPLETED\n");
380369
ret = -ETIMEDOUT;
381370
break;
382371
}
383-
if (ret < 0) {
384-
dev_err(dev,
385-
"error (%d) waiting for RECONFIG_COMPLETED\n",
386-
ret);
387-
break;
388-
}
389372
/* Not error or timeout, so ret is # of jiffies until timeout */
390373
timeout = ret;
391374
ret = 0;

0 commit comments

Comments
 (0)