Patch "spi: Fix error code checking in spi_mem_exec_op()" 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: Fix error code checking in spi_mem_exec_op()

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-fix-error-code-checking-in-spi_mem_exec_op.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 63946392b8b5ac42d0ca0f1a86956b29da0dbb8b
Author: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
Date:   Wed Mar 13 12:45:30 2024 -0700

    spi: Fix error code checking in spi_mem_exec_op()
    
    [ Upstream commit 29895ce18311ddd702973ddb3a6c687db663e0fb ]
    
    After commit cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with
    -EOPNOTSUPP"), our SPI NOR flashes would stop probing with the following
    visible in the kernel log:
    
    [    2.196300] brcmstb_qspi f0440920.qspi: using bspi-mspi mode
    [    2.210295] spi-nor: probe of spi1.0 failed with error -95
    
    It turns out that the check in spi_mem_exec_op() was changed to check
    for -ENOTSUPP (old error code) or -EOPNOTSUPP (new error code), but this
    means that for drivers that were converted, the second condition is now
    true, and we stop falling through like we used to. Fix the error to
    check for neither error being neither -ENOTSUPP *nor* -EOPNOTSUPP.
    
    Fixes: cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP")
    Reviewed-by: Michael Walle <mwalle@xxxxxxxxxx>
    Reviewed-by: Pratyush Yadav <pratyush@xxxxxxxxxx>
    Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
    Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Reviewed-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx>
    Link: https://msgid.link/r/20240313194530.3150446-1-florian.fainelli@xxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index c9d6d42a88f55..17b8baf749e6a 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -382,7 +382,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
 		 * read path) and expect the core to use the regular SPI
 		 * interface in other cases.
 		 */
-		if (!ret || ret != -ENOTSUPP || ret != -EOPNOTSUPP) {
+		if (!ret || (ret != -ENOTSUPP && ret != -EOPNOTSUPP)) {
 			spi_mem_add_op_stats(ctlr->pcpu_statistics, op, ret);
 			spi_mem_add_op_stats(mem->spi->pcpu_statistics, op, ret);
 




[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