[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac9d6afe-fd09-4311-d90c-d9caddd1b79b@samsung.com>
Date: Fri, 29 Mar 2024 18:09:00 +0900
From: Jaewon Kim <jaewon02.kim@...sung.com>
To: Andi Shyti <andi.shyti@...nel.org>, Mark Brown <broonie@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, Alim Akhtar
<alim.akhtar@...sung.com>, Sam Protsenko <semen.protsenko@...aro.org>
Cc: linux-spi@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: s3c64xx: Use DMA mode from fifo size
On 3/29/24 17:58, Jaewon Kim wrote:
> If the SPI data size is smaller than FIFO, it operates in PIO mode,
> and if it is larger than FIFO size, it oerates in DMA mode.
>
> If the SPI data size is equal to fifo, it operates in PIO mode and it is
> separated to 2 transfers. To prevent it, it must operate in DMA mode
> from the case where the data size and the fifo size are the same.
>
> Fixes: 1ee806718d5e ("spi: s3c64xx: support interrupt based pio mode")
> Signed-off-by: Jaewon Kim <jaewon02.kim@...sung.com>
> Reviewed-by: Sam Protsenko <semen.protsenko@...aro.org>
> ---
> drivers/spi/spi-s3c64xx.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 9fcbe040cb2f..f726d8670428 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -430,7 +430,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host,
> struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host);
>
> if (sdd->rx_dma.ch && sdd->tx_dma.ch)
> - return xfer->len > sdd->fifo_depth;
> + return xfer->len >= sdd->fifo_depth;
>
> return false;
> }
> @@ -826,10 +826,9 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
> return status;
> }
>
> - if (!is_polling(sdd) && (xfer->len > fifo_len) &&
> + if (!is_polling(sdd) && xfer->len >= fifo_len &&
> sdd->rx_dma.ch && sdd->tx_dma.ch) {
> use_dma = 1;
> -
> } else if (xfer->len >= fifo_len) {
> tx_buf = xfer->tx_buf;
> rx_buf = xfer->rx_buf;
Sorry, I didn't add v2 by mistake.
This is v1 mail thread.
-
https://lore.kernel.org/linux-arm-kernel/CAPLW+4k4qh4ZYBufZoGbUZN0yxSE2X8bOdkEQVw1Zg9YUVpbug@mail.gmail.com/T/
Thanks
Jaewon Kim
Powered by blists - more mailing lists