[openwrt/openwrt] kernel: mtk_bmt: skip bitflip check if threshold isn't set

LEDE Commits lede-commits at lists.infradead.org
Tue Oct 11 01:25:23 PDT 2022


nbd pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/329b1543f3902885488c85ce3c679b0028992b47

commit 329b1543f3902885488c85ce3c679b0028992b47
Author: Chuanhong Guo <gch981213 at gmail.com>
AuthorDate: Thu Apr 7 09:56:02 2022 +0800

    kernel: mtk_bmt: skip bitflip check if threshold isn't set
    
    kernel spi-nand driver leaves this field empty and let mtd set it later.
    
    Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
    (cherry-picked from commit 6fa50e26e7c1221085d8e71cde7e9148c540c752)
---
 target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
index f1df4a11f1..bcff7d6ac8 100644
--- a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
+++ b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c
@@ -146,7 +146,7 @@ mtk_bmt_read(struct mtd_info *mtd, loff_t from,
 			goto out;
 		}
 
-		if (cur_ret >= mtd->bitflip_threshold)
+		if (mtd->bitflip_threshold && cur_ret >= mtd->bitflip_threshold)
 			mtk_bmt_remap_block(block, cur_block, mtd->erasesize);
 
 		ops->retlen += cur_ops.retlen;




More information about the lede-commits mailing list