Patch "mtd: rawnand: Constrain even more when continuous reads are enabled" 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

    mtd: rawnand: Constrain even more when continuous reads are enabled

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:
     mtd-rawnand-constrain-even-more-when-continuous-read.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 1039d579c482a97baaf0c7e6c1462be5f2764ace
Author: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Date:   Thu Mar 7 12:53:14 2024 +0100

    mtd: rawnand: Constrain even more when continuous reads are enabled
    
    [ Upstream commit 78ffbefba8d7822b232585570b293de5bc397da6 ]
    
    As a matter of fact, continuous reads require additional handling at the
    operation level in order for them to work properly. The core helpers do
    have this additional logic now, but any time a controller implements its
    own page helper, this extra logic is "lost". This means we need another
    level of per-controller driver checks to ensure they can leverage
    continuous reads. This is for now unsupported, so in order to ensure
    continuous reads are enabled only when fully using the core page
    helpers, we need to add more initial checks.
    
    Also, as performance is not relevant during raw accesses, we also
    prevent these from enabling the feature.
    
    This should solve the issue seen with controllers such as the STM32 FMC2
    when in sequencer mode. In this case, the continuous read feature would
    be enabled but not leveraged, and most importantly not disabled, leading
    to further operations to fail.
    
    Reported-by: Christophe Kerello <christophe.kerello@xxxxxxxxxxx>
    Fixes: 003fe4b9545b ("mtd: rawnand: Support for sequential cache reads")
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Tested-by: Christophe Kerello <christophe.kerello@xxxxxxxxxxx>
    Link: https://lore.kernel.org/linux-mtd/20240307115315.1942678-1-miquel.raynal@xxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 4d5a663e4e059..2479fa98f9912 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -3594,7 +3594,8 @@ static int nand_do_read_ops(struct nand_chip *chip, loff_t from,
 	oob = ops->oobbuf;
 	oob_required = oob ? 1 : 0;
 
-	rawnand_enable_cont_reads(chip, page, readlen, col);
+	if (likely(ops->mode != MTD_OPS_RAW))
+		rawnand_enable_cont_reads(chip, page, readlen, col);
 
 	while (1) {
 		struct mtd_ecc_stats ecc_stats = mtd->ecc_stats;
@@ -5212,6 +5213,15 @@ static void rawnand_late_check_supported_ops(struct nand_chip *chip)
 	if (!nand_has_exec_op(chip))
 		return;
 
+	/*
+	 * For now, continuous reads can only be used with the core page helpers.
+	 * This can be extended later.
+	 */
+	if (!(chip->ecc.read_page == nand_read_page_hwecc ||
+	      chip->ecc.read_page == nand_read_page_syndrome ||
+	      chip->ecc.read_page == nand_read_page_swecc))
+		return;
+
 	rawnand_check_cont_read_support(chip);
 }
 




[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