Hi Bastien, On 7/23/2026 1:09 PM, Bastien Curutchet wrote: > Hi Love, > > On 7/22/26 2:32 PM, Kumar, Love wrote: >> Hi Bastien, >> >> On 7/17/2026 8:21 PM, Bastien Curutchet wrote: >>> Hi Love >>> >>> On 7/13/26 3:52 PM, Kumar, Love wrote: >>>> Hi Bastien, >>>> >>>> On 7/13/2026 3:18 PM, Bastien Curutchet wrote: >>>>> Hi Love, >>>>> >>>>> On 7/11/26 8:36 AM, Kumar, Love wrote: >>>>>> Hi Michal, >>>>>> >>>>>> On 7/9/2026 11:23 AM, Michal Simek wrote: >>>>>>> Hi Love, >>>>>>> >>>>>>> On 7/2/26 15:08, Bastien Curutchet wrote: >>>>>>>> This driver is deeply broken in many ways. Miquèl has cleaned it up by: >>>>>>>> - flagging the most hideous parts (where Micron on-die ECC support is >>>>>>>> hardcoded) >>>>>>>> - enabling DT support, eg. for reading the ECC configuration >>>>>>>> - fixing software ECC support >>>>>>>> - aligning the software ECC OOB layout to the rest of the world and >>>>>>>> allow a working interoperability in Linux. >>>>>>>> >>>>>>>> I then added a patch to fix writes when soft ECC is on. >>>>>>>> >>>>>>>> Signed-off-by: Miquel Raynal (DAVE.eu) <[email protected]> >>>>>>>> Signed-off-by: Bastien Curutchet (DAVE.eu) >>>>>>>> <[email protected]> >>>>>>>> --- >>>>>>>> Changes in v3: >>>>>>>> - Add patch 6 to fix write issues in soft ECC. >>>>>>>> - Link to v2: >>>>>>>> https://lore.kernel.org/r/[email protected] >>>>>>>> >>>>>>>> Changes in v2: >>>>>>>> - Fix the sponsor: s/DAVE/DAVE.eu/, no other change. >>>>>>>> - Link to v1: >>>>>>>> https://lore.kernel.org/r/[email protected] >>>>>>>> >>>>>>>> --- >>>>>>>> Bastien Curutchet (DAVE.eu) (1): >>>>>>>> mtd: rawnand: nand_base: Don't overwrite >>>>>>>> read/write_page_raw() for soft ECC >>>>>>>> >>>>>>>> Miquel Raynal (DAVE.eu) (5): >>>>>>>> mtd: rawnand: zynq: Align the layout structures with the >>>>>>>> driver namespace >>>>>>>> mtd: rawnand: zynq: Add comments about very bad practices >>>>>>>> mtd: rawnand: zynq: Make sure an of node is attached >>>>>>>> mtd: rawnand: zynq: Do not fail the probe for no reason >>>>>>>> mtd: rawnand: zynq: Fix Software ECC engine support >>>>>>>> >>>>>>>> drivers/mtd/nand/raw/nand_base.c | 6 +- >>>>>>>> drivers/mtd/nand/raw/zynq_nand.c | 115 >>>>>>>> ++++++++++----------------------------- >>>>>>>> 2 files changed, 32 insertions(+), 89 deletions(-) >>>>>>>> --- >>>>>>>> base-commit: 4433253ecf2041f9362a763bb6cb79960921ac7e >>>>>>>> change-id: 20260522-dave-upstream-nand-fixes-60a5336517a2 >>>>>>>> >>>>>>>> Best regards, >>>>>>> >>>>>>> Please test this series. >>>>>> >>>>>> We are again seeing the NAND write issue with zynq-zc770-xm011 board. >>>>>> >>>>>> Below is the log snippet: >>>>>> >>>>>> Zynq> nand write 0x80000 0x0 0x126f80 >>>>>> nand write 0x80000 0x0 0x126f80 >>>>>> NAND write: device 0 offset 0x0, size 0x126f80 >>>>>> NAND write to offset 0 failed -5 >>>>>> >>>>> The exact same command works in my setup: >>>>> >>>>> ``` >>>>> Zynq> nand write 0x80000 0x0 0x126f80 >>>>> >>>>> NAND write: device 0 offset 0x0, size 0x126f80 >>>>> 1208192 bytes written: OK >>>>> ``` >>>>> >>>>> Can you please share your device-tree / defconfig ? I'd like to dig into >>>>> this a bit. >>>>> >>>>> I'd also be interested in seeing the output of 'mtd list' and 'nand info' >>>>> on your side. >>>> >>>> I have used the xilinx_zynq_virt_defconfig with zynq-zc770-xm011 DT. >>>> Below are the log snippets for 'nand info' and 'mtd list' commands: >>>> Zynq> nand info >>>> Device 0: nand0, sector size 128 KiB >>>> Page size 2048 b >>>> OOB size 64 b >>>> Erase size 131072 b >>>> ecc strength 0 bits >>>> ecc step size 2048 b >>>> subpagesize 2048 b >>>> options 0x40000000 >>>> bbt options 0x00028000 >>>> Zynq> mtd list >>>> List of MTD devices: >>>> * nand0 >>>> - type: NAND flash >>>> - block size: 0x20000 bytes >>>> - min I/O: 0x800 bytes >>>> - OOB size: 64 bytes >>>> - OOB available: 38 bytes >>>> - 0x000000000000-0x000008000000 : "nand0" >>>> - 0x000000000000-0x000001000000 : "nand-fsbl-uboot" >>>> - 0x000001000000-0x000003000000 : "nand-linux" >>>> - 0x000003000000-0x000003200000 : "nand-rootfs" >>>> Zynq> >>>> >>> >>> Thank for these information. >>> >>> Have you explicitly enabled the soft ECC ? I don't find the nand-ecc-mode >>> property in the upstream zynq-zc770-xm011 DT. >>> >> >> Yes, tested it by explicitly enabling it with `nand-ecc-mode = "soft";` in >> zynq-zc770-xm011 DT, observed the same behavior - NAND write fails. Same >> issue was observed without enabling ecc mode as well. >> >> ``` >> Zynq> nand write 0x80000 0x0 0x80000 >> >> NAND write: device 0 offset 0x0, size 0x80000 >> NAND write to offset 0 failed -5 >> 0 bytes written: ERROR >> Zynq> >> ``` >> >> Am I missing any other configurations? >> > I don't see any other configuration you'd be missing. > > I had this error once with ECC-soft enabled but that was because I had > forgotten to do a prior erase >
I do the erase before writing and getting the same nand write issue. Regards, Love Kumar
