U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero
@ 2026-06-24  4:12 Ronan Dalton
  2026-07-23  3:56 ` Ronan Dalton
  2026-07-24  9:44 ` Miquel Raynal via U-Boot
  0 siblings, 2 replies; 3+ messages in thread
From: Ronan Dalton @ 2026-06-24  4:12 UTC (permalink / raw)
  To: u-boot
  Cc: Ronan Dalton, Dario Binacchi, Michael Trimarchi, Miquel Raynal,
	Chris Packham, Aryan Srivastava

Currently there is no fallback condition for when a NAND chip connected
reports an ECC requirement of zero and no value is specified in the DTS.
When this happens, pxa_ecc_init attempts to find a match, but fails with
the following error message:

  ECC strength 0 at page size N is not supported

Linux already has a fallback case for this scenario.

Make u-boot match the Linux behavior by triggering the fallback when the
ECC strength requirement reported by the chip is zero. Changing && to ||
is sufficient to make the behavior equivalent.

Signed-off-by: Ronan Dalton <ronan.dalton@alliedtelesis.co.nz>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
---
 drivers/mtd/nand/raw/pxa3xx_nand.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c
index 7324dc72e0a..4a2c1c4bad2 100644
--- a/drivers/mtd/nand/raw/pxa3xx_nand.c
+++ b/drivers/mtd/nand/raw/pxa3xx_nand.c
@@ -1625,8 +1625,10 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
 		ecc_step = chip->ecc_step_ds;
 	}
 
-	/* Set default ECC strength requirements on non-ONFI devices */
-	if (ecc_strength < 1 && ecc_step < 1) {
+	/* Set default ECC strength requirements on non-ONFI devices or devices
+	 * that report a requirement of zero.
+	 */
+	if (ecc_strength < 1 || ecc_step < 1) {
 		ecc_strength = 1;
 		ecc_step = 512;
 	}
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero
  2026-06-24  4:12 [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero Ronan Dalton
@ 2026-07-23  3:56 ` Ronan Dalton
  2026-07-24  9:44 ` Miquel Raynal via U-Boot
  1 sibling, 0 replies; 3+ messages in thread
From: Ronan Dalton @ 2026-07-23  3:56 UTC (permalink / raw)
  To: u-boot@lists.u-boot-project.org
  Cc: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com,
	Aryan Srivastava, miquel.raynal@bootlin.com, Chris Packham

Hello,

I just wanted to follow up on this patch since I haven't had any
replies yet.

Thanks,
Ronan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero
  2026-06-24  4:12 [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero Ronan Dalton
  2026-07-23  3:56 ` Ronan Dalton
@ 2026-07-24  9:44 ` Miquel Raynal via U-Boot
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal via U-Boot @ 2026-07-24  9:44 UTC (permalink / raw)
  To: Ronan Dalton
  Cc: u-boot, Dario Binacchi, Michael Trimarchi, Chris Packham,
	Aryan Srivastava

Hi Ronan,

> Currently there is no fallback condition for when a NAND chip connected
> reports an ECC requirement of zero and no value is specified in the DTS.
> When this happens, pxa_ecc_init attempts to find a match, but fails with
> the following error message:
>
>   ECC strength 0 at page size N is not supported
>
> Linux already has a fallback case for this scenario.
>
> Make u-boot match the Linux behavior by triggering the fallback when the
> ECC strength requirement reported by the chip is zero. Changing && to ||
> is sufficient to make the behavior equivalent.
>
> Signed-off-by: Ronan Dalton <ronan.dalton@alliedtelesis.co.nz>
> Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Cc: Michael Trimarchi <michael@amarulasolutions.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Cc: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-24 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  4:12 [PATCH] mtd: nand: pxa3xx: Fallback to 1-bit ECC when chip requirement is zero Ronan Dalton
2026-07-23  3:56 ` Ronan Dalton
2026-07-24  9:44 ` Miquel Raynal via U-Boot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox