spi: s3c64xx: Disable IRQ mode when using DMA
authorJaewon Kim <jaewon02.kim@samsung.com>
Wed, 10 May 2023 11:39:42 +0000 (20:39 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 11 May 2023 01:30:43 +0000 (10:30 +0900)
Fixing the problem of enabling DMA mode and IRQ mode at the same time.
In this case, a value of more than 6bits is written to RDY_LVL, it can
cause an invasion of other registers, potentially leading to SPI
transfer failure.

Fixes: 1ee806718d5e ("spi: s3c64xx: support interrupt based pio mode")
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230510113942.89994-1-jaewon02.kim@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org
drivers/spi/spi-s3c64xx.c

index f79732ff3a2733b289d123b20a3ee7e0792b2051..e30562f96a4c8af87e76a9c8d6b51f068814b802 100644 (file)
@@ -782,7 +782,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 
        do {
                /* transfer size is greater than 32, change to IRQ mode */
-               if (xfer->len > S3C64XX_SPI_POLLING_SIZE)
+               if (!use_dma && xfer->len > S3C64XX_SPI_POLLING_SIZE)
                        use_irq = true;
 
                if (use_irq) {