Patch "spi: spi-imx: fix off-by-one in mx51 CPU mode burst length" has been added to the 6.7-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: spi-imx: fix off-by-one in mx51 CPU mode burst length

to the 6.7-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-spi-imx-fix-off-by-one-in-mx51-cpu-mode-burst-le.patch
and it can be found in the queue-6.7 subdirectory.

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



commit 8c8b028b36f36e1adde58f7089a599f0dcbbe88d
Author: Adam Butcher <adam@xxxxxxxxxxxxxxx>
Date:   Mon Mar 18 17:50:52 2024 +0000

    spi: spi-imx: fix off-by-one in mx51 CPU mode burst length
    
    [ Upstream commit cf6d79a0f5769b5f4d9579ddaf88d2c30b03b873 ]
    
    c712c05e46c8 ("spi: imx: fix the burst length at DMA mode and CPU mode")
    corrects three cases of setting the ECSPI burst length but erroneously
    leaves the in-range CPU case one bit to big (in that field a value of
    0 means 1 bit).  The effect was that transmissions that should have been
    8-bit bytes appeared as 9-bit causing failed communication with SPI
    devices.
    
    Link: https://lore.kernel.org/all/20240201105451.507005-1-carlos.song@xxxxxxx/
    Link: https://lore.kernel.org/all/20240204091912.36488-1-carlos.song@xxxxxxx/
    Fixes: c712c05e46c8 ("spi: imx: fix the burst length at DMA mode and CPU mode")
    Signed-off-by: Adam Butcher <adam@xxxxxxxxxxxxxxx>
    Link: https://msgid.link/r/20240318175119.3334-1-adam@xxxxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index e2d3e3ec13789..0e479c5406217 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -668,8 +668,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
 				ctrl |= (MX51_ECSPI_CTRL_MAX_BURST * BITS_PER_BYTE - 1)
 						<< MX51_ECSPI_CTRL_BL_OFFSET;
 			else
-				ctrl |= spi_imx->count / DIV_ROUND_UP(spi_imx->bits_per_word,
-						BITS_PER_BYTE) * spi_imx->bits_per_word
+				ctrl |= (spi_imx->count / DIV_ROUND_UP(spi_imx->bits_per_word,
+						BITS_PER_BYTE) * spi_imx->bits_per_word - 1)
 						<< MX51_ECSPI_CTRL_BL_OFFSET;
 		}
 	}




[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