OSDN Git Service

spi: Deal with slaves that return from transfer_one() unfinished
authorLubomir Rintel <lkundrak@v3.sk>
Tue, 13 Nov 2018 10:22:24 +0000 (11:22 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 13 Nov 2018 18:01:23 +0000 (10:01 -0800)
commit810923f3bf06c11022b7bb370dd3130a956a222e
tree103a361a9aefe049a5c3c8bbdadf2d6dbe6407eb
parentaa66478aa538f839a96c836bba0bbc12ef2666f0
spi: Deal with slaves that return from transfer_one() unfinished

Some drivers, such as spi-pxa2xx return from the transfer_one callback
immediately, idicating that the transfer will be finished asynchronously.

Normally, spi_transfer_one_message() synchronously waits for the
transfer to finish with wait_for_completion_timeout(). For slaves, we
don't want the transaction to time out as it can complete in a long time
in future. Use wait_for_completion_interruptible() instead.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c