Skip to content

Commit 1ca2761

Browse files
miquelraynalbroonie
authored andcommitted
spi: atmel: Do not cancel a transfer upon any signal
The intended move from wait_for_completion_*() to wait_for_completion_interruptible_*() was to allow (very) long spi memory transfers to be stopped upon user request instead of freezing the machine forever as the timeout value could now be significantly bigger. However, depending on the user logic, applications can receive many signals for their own "internal" purpose and have nothing to do with the requested kernel operations, hence interrupting spi transfers upon any signal is probably not a wise choice. Instead, let's switch to wait_for_completion_killable_*() to only catch the "important" signals. This was likely the intended behavior anyway. Fixes: e0205d6 ("spi: atmel: Prevent false timeouts on long transfers") Cc: [email protected] Reported-by: Ronald Wahl <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b85ea95 commit 1ca2761

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-atmel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,8 +1336,8 @@ static int atmel_spi_one_transfer(struct spi_controller *host,
13361336
}
13371337

13381338
dma_timeout = msecs_to_jiffies(spi_controller_xfer_timeout(host, xfer));
1339-
ret_timeout = wait_for_completion_interruptible_timeout(&as->xfer_completion,
1340-
dma_timeout);
1339+
ret_timeout = wait_for_completion_killable_timeout(&as->xfer_completion,
1340+
dma_timeout);
13411341
if (ret_timeout <= 0) {
13421342
dev_err(&spi->dev, "spi transfer %s\n",
13431343
!ret_timeout ? "timeout" : "canceled");

0 commit comments

Comments
 (0)