Patch "spi: stm32: properly handle 0 byte transfer" has been added to the 5.11-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: stm32: properly handle 0 byte transfer

to the 5.11-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-stm32-properly-handle-0-byte-transfer.patch
and it can be found in the queue-5.11 subdirectory.

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



commit ae5fafd7811bca57add7f6c407cd255e2d1f2ff9
Author: Alain Volmat <alain.volmat@xxxxxxxxxxx>
Date:   Fri Feb 5 19:59:25 2021 +0100

    spi: stm32: properly handle 0 byte transfer
    
    [ Upstream commit 2269f5a8b1a7b38651d62676b98182828f29d11a ]
    
    On 0 byte transfer request, return straight from the
    xfer function after finalizing the transfer.
    
    Fixes: dcbe0d84dfa5 ("spi: add driver for STM32 SPI controller")
    Signed-off-by: Alain Volmat <alain.volmat@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/1612551572-495-2-git-send-email-alain.volmat@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 6017209c6d2f7..6eeb39669a866 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -1677,6 +1677,10 @@ static int stm32_spi_transfer_one(struct spi_master *master,
 	struct stm32_spi *spi = spi_master_get_devdata(master);
 	int ret;
 
+	/* Don't do anything on 0 bytes transfers */
+	if (transfer->len == 0)
+		return 0;
+
 	spi->tx_buf = transfer->tx_buf;
 	spi->rx_buf = transfer->rx_buf;
 	spi->tx_len = spi->tx_buf ? transfer->len : 0;



[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