From: Robin Gong Date: Wed, 10 Oct 2018 10:32:48 +0000 (+0000) Subject: spi: imx: use PIO mode if size is small X-Git-Tag: v4.20-rc1~185^2~1^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=133eb8e38b02c6c63a039523fca12737009a6686;p=thirdparty%2Fkernel%2Flinux.git spi: imx: use PIO mode if size is small Use PIO mode instead if size is smaller than fifo size, since dma may be less efficient. Signed-off-by: Robin Gong Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 037abbb852a4d..dd1ce12aa386a 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -224,6 +224,9 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, if (spi_imx->slave_mode) return false; + if (transfer->len < spi_imx->devtype_data->fifo_size) + return false; + spi_imx->dynamic_burst = 0; return true;