Patch "spi: cadence-quadspi: Abort read if dummy cycles required are too many" 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: cadence-quadspi: Abort read if dummy cycles required are too many

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-cadence-quadspi-abort-read-if-dummy-cycles-requi.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 3c38fb570f2cf3c145c71fa2000e2aa2497e6276
Author: Pratyush Yadav <p.yadav@xxxxxx>
Date:   Wed Dec 23 00:14:20 2020 +0530

    spi: cadence-quadspi: Abort read if dummy cycles required are too many
    
    [ Upstream commit ceeda328edeeeeac7579e9dbf0610785a3b83d39 ]
    
    The controller can only support up to 31 dummy cycles. If the command
    requires more it falls back to using 31. This command is likely to fail
    because the correct number of cycles are not waited upon. Rather than
    silently issuing an incorrect command, fail loudly so the caller can get
    a chance to find out the command can't be supported by the controller.
    
    Fixes: 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")
    Signed-off-by: Pratyush Yadav <p.yadav@xxxxxx>
    Link: https://lore.kernel.org/r/20201222184425.7028-3-p.yadav@xxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index ba7d40c2922f7..826b01f346246 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -461,7 +461,7 @@ static int cqspi_read_setup(struct cqspi_flash_pdata *f_pdata,
 	/* Setup dummy clock cycles */
 	dummy_clk = op->dummy.nbytes * 8;
 	if (dummy_clk > CQSPI_DUMMY_CLKS_MAX)
-		dummy_clk = CQSPI_DUMMY_CLKS_MAX;
+		return -EOPNOTSUPP;
 
 	if (dummy_clk)
 		reg |= (dummy_clk & CQSPI_REG_RD_INSTR_DUMMY_MASK)



[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