Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1676014e authored by Alexander Stein's avatar Alexander Stein Committed by Mark Brown
Browse files

spi: atmel: Fix scheduling while atomic bug



atmel_spi_lock does a spin_lock_irqsave, so we need to renable the
interrupts when we want to schedule.

Signed-off-by: default avatarAlexander Stein <alexanders83@web.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent c9eaa447
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1115,8 +1115,11 @@ static int atmel_spi_one_transfer(struct spi_master *master,
			atmel_spi_next_xfer_pio(master, xfer);
		}

		/* interrupts are disabled, so free the lock for schedule */
		atmel_spi_unlock(as);
		ret = wait_for_completion_timeout(&as->xfer_completion,
							SPI_DMA_TIMEOUT);
		atmel_spi_lock(as);
		if (WARN_ON(ret == 0)) {
			dev_err(&spi->dev,
				"spi trasfer timeout, err %d\n", ret);