Patch "spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one()" has been added to the 5.4-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: synquacer: Fix timeout handling in synquacer_spi_transfer_one()

to the 5.4-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-synquacer-fix-timeout-handling-in-synquacer_spi_.patch
and it can be found in the queue-5.4 subdirectory.

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



commit d9a7d7cb19cbf9aef6116f9b44b6cc1f8194122c
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Wed Feb 15 14:01:28 2023 +0100

    spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one()
    
    [ Upstream commit e6a0b671880207566e1ece983bf989dde60bc1d7 ]
    
    wait_for_completion_timeout() never returns a <0 value. It returns either
    on timeout or a positive value (at least 1, or number of jiffies left
    till timeout)
    
    So, fix the error handling path and return -ETIMEDOUT should a timeout
    occur.
    
    Fixes: b0823ee35cf9 ("spi: Add spi driver for Socionext SynQuacer platform")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Acked-by: Jassi Brar <jaswinder.singh@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/c2040bf3cfa201fd8890cfab14fa5a701ffeca14.1676466072.git.christophe.jaillet@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index 1e10af6e10a90..5d6e4a59ce29b 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -472,10 +472,9 @@ static int synquacer_spi_transfer_one(struct spi_master *master,
 		read_fifo(sspi);
 	}
 
-	if (status < 0) {
-		dev_err(sspi->dev, "failed to transfer. status: 0x%x\n",
-			status);
-		return status;
+	if (status == 0) {
+		dev_err(sspi->dev, "failed to transfer. Timeout.\n");
+		return -ETIMEDOUT;
 	}
 
 	return 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