[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+GyqebQnWQ3fj4Lrb4-hvzRpphuqw+jh4B9En1j2NDTNFumvQ@mail.gmail.com>
Date: Mon, 30 Jun 2025 16:38:31 +0200
From: Zixun LI <admin@...iphile.com>
To: Tudor Ambarus <tudor.ambarus@...aro.org>, Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>, Claudiu Beznea <claudiu.beznea@...on.dev>,
linux-mtd@...ts.infradead.org,
"SoC support'" <linux-arm-kernel@...ts.infradead.org>, linux-kernel@...r.kernel.org
Subject: mtd: rawnand: atmel: ECC error after update to kernel 6.6
Hi,
After updating our SAM9G25 device from kernel 3.16 to 6.6, we have
encountered UBIFS failures with ECC errors:
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
126976 bytes from PEB 8:4096, read only 126976 bytes, retry
On the old system (kernel 3.16), nandtest passed successfully:
nandtest -p 1 -l 0x40000 /dev/mtd2
ECC corrections: 1
ECC failures : 0
Bad blocks : 0
BBT blocks : 0
00020000: checking...
Finished pass 1 successfully
But on the new system (kernel 6.6), nandtest reports many errors:
nandtest -p 1 -l 0x40000 /dev/mtd2
ECC corrections: 1667
ECC failures : 1205
Bad blocks : 1
BBT blocks : 0
00000000: reading (1 of 4)...
218 bit(s) ECC corrected at 00000000
After some diagnostics, I used devmem2 to compare SMC and PMECC
registers between the two kernels. All values match except for the
PMECC_CLK register, which is 2 in kernel 3.16 [1] and 0 in kernel 6.6
[2]. It appears the clock setting is missing since the kernel 4.14
refactor.
According to the SAM9G25 datasheet this field must be programmed with 2.
Manually setting PMECC_CLK to 2 (devmem2 0xffffe010 w 2) resolves the
nandtest issue.
Is the clock setting moved to elsewhere after the refactor ?
Best regards,
Zixun LI
[1] https://github.com/torvalds/linux/blob/19583ca584d6f574384e17fe7613dfaeadcdc4a6/drivers/mtd/nand/atmel_nand.c#L1058
[2] https://github.com/torvalds/linux/blob/ffc253263a1375a65fa6c9f62a893e9767fbebfa/drivers/mtd/nand/raw/atmel/pmecc.c#L772
Powered by blists - more mailing lists