Patch "spi: s3c64xx: Use DMA mode from fifo size" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: s3c64xx: Use DMA mode from fifo size

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-s3c64xx-use-dma-mode-from-fifo-size.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4b2314a1725f356859e31839661b3538ca4d49c1
Author: Jaewon Kim <jaewon02.kim@xxxxxxxxxxx>
Date:   Fri Mar 29 17:58:40 2024 +0900

    spi: s3c64xx: Use DMA mode from fifo size
    
    [ Upstream commit a3d3eab627bbbb0cb175910cf8d0f7022628a642 ]
    
    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@xxxxxxxxxxx>
    Reviewed-by: Sam Protsenko <semen.protsenko@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240329085840.65856-1-jaewon02.kim@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index e059fb9db1da1..652eadbefe24c 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -424,7 +424,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;
 }
@@ -783,10 +783,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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux