Skip to contentSkip to conversation

mtd: rawnand: mxs_nand: Fix use_minimum_ecc for spl driver

PATCH Superseded Ye Li 3 participants 3 messages Mar 29, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/1 mtd: rawnand: mxs_nand: Fix use_minimum_ecc for spl driver

Because mxs_nand_spl driver does not support DM, to use the minimum ECC layout, it needs to handle the CONFIG_NAND_MXS_USE_MINIMUM_ECC.

---
 drivers/mtd/nand/raw/mxs_nand.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/mxs_nand.c +4 -0
index ee5d7fd..28e189a 100644
@@ -1380,6 +1380,10 @@ int mxs_nand_init_spl(struct nand_chip *nand)
 	else
 		nand_info->max_ecc_strength_supported = 40;
 
+#ifdef CONFIG_NAND_MXS_USE_MINIMUM_ECC
+	nand_info->use_minimum_ecc = true;
+#endif
+
 	err = mxs_nand_alloc_buffers(nand_info);
 	if (err)
 		return err;
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Ye Li

Because mxs_nand_spl driver does not support DM, to use the minimum ECC layout, it needs to handle the CONFIG_NAND_MXS_USE_MINIMUM_ECC.

Yes, spl also need the CONFIG_NAND_MXS_USE_MINIMUM_ECC flag.

Quoted 24 lines
---
 drivers/mtd/nand/raw/mxs_nand.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/mxs_nand.c +4 -0
index ee5d7fd..28e189a 100644
@@ -1380,6 +1380,10 @@ int mxs_nand_init_spl(struct nand_chip *nand)
 	else
 		nand_info->max_ecc_strength_supported = 40;
 
+#ifdef CONFIG_NAND_MXS_USE_MINIMUM_ECC
+	nand_info->use_minimum_ecc = true;
+#endif
+
 	err = mxs_nand_alloc_buffers(nand_info);
 	if (err)
 		return err;
Signature · 1 line
2.7.4
reviewer
#2 lore raw
In reply to Ye Li

Hi Ye Li,

Quoted 14 lines · Ye Li

Because mxs_nand_spl driver does not support DM, to use the minimum ECC layout, it needs to handle the CONFIG_NAND_MXS_USE_MINIMUM_ECC.

---
 drivers/mtd/nand/raw/mxs_nand.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/mxs_nand.c +0 -0
index ee5d7fd..28e189a 100644

drivers/mtd/nand/raw/mxs_nand.c int mxs_nand_init_spl(struct nand_chip *nand) · line 1385

Quoted 6 lines
drivers/mtd/nand/raw/mxs_nand.c +3 -0
@@ -1380,6 +1380,10 @@ int mxs_nand_init_spl(struct nand_chip *nand)
        else
                nand_info->max_ecc_strength_supported = 40;
 
+#ifdef CONFIG_NAND_MXS_USE_MINIMUM_ECC
+       nand_info->use_minimum_ecc = true;
+#endif

Please use if (IS_ENABLED(CONFIG_NAND_MXS_USE_MINIMUM_ECC)) as suggested by checkpatch:

WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible
#17: FILE: drivers/mtd/nand/raw/mxs_nand.c:1383:
+#ifdef CONFIG_NAND_MXS_USE_MINIMUM_ECC

Thanks