public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>,
	Kamal Dasu <kdasu.kdev@gmail.com>,
	Richard Weinberger <richard@nod.at>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	MTD Maling List <linux-mtd@lists.infradead.org>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: ECC errors after UBI writes with brcmnand (Northstar with v6.1 controller)
Date: Tue, 22 Mar 2022 18:53:19 +0100	[thread overview]
Message-ID: <e3bc0832-efef-9e92-3b17-df8cc731b533@gmail.com> (raw)
In-Reply-To: <d8a2fc04-b05a-bec9-cd56-ef7d73d904a9@gmail.com>

On 18.03.2022 19:02, Rafał Miłecki wrote:
> My problem is that ubifs complains about ECC errors. I spent some time
> debugging it and it seems that:
> 1. Initially all blocks written by bootloader can be read fine
> 2. Few blocks written by ubifs -> ubi -> brcmnand can't be read back
> 
> ubi0 error: ubi_io_write: Read back 90 FAILED from "ubi" at offset 0x61800 of length 2048: -74
> ubi0 error: ubi_io_write: Read back 92 FAILED from "ubi" at offset 0x81800 of length 2048: -74
> ubi0 error: ubi_io_write: Read back 97 FAILED from "ubi" at offset 0xa1800 of length 2048: -74
> ubi0 error: ubi_io_write: Read back 756 FAILED from "ubi" at offset 0xee4800 of length 2048: -74
> ubi0 error: ubi_io_write: Read back 840 FAILED from "ubi" at offset 0xee5000 of length 2048: -74
> ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 68 bytes from PEB 119:21944, read only 68 bytes, retry (addr:0xee55b8)
> ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 68 bytes from PEB 119:21944, read only 68 bytes, retry (addr:0xee55b8)
> ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 68 bytes from PEB 119:21944, read only 68 bytes, retry (addr:0xee55b8)
> ubi0 error: ubi_io_read: error -74 (ECC error) while reading 68 bytes from PEB 119:21944, read 68 bytes

I did a bit of extra debugging and I'll try to provide some extra
information though nothing exciting.


FWIW: OpenWrt 15.05 (correct: year 2015) used a port of NAND driver from
the Broadcom's SDK. I was wondering if it may behave any different.

First I booted that ancient OpenWrt 15.05 with kernel 3.18 on Netgear
R6250 (BCM4708) and dumped ECC layout. Sadly nothing unexpected here:
that driver used the same ECC layout and upstream brcmnand.

OOB ECC layout:
offset: 2 length: 14
offset: 18 length: 14
offset: 34 length: 14
offset: 50 length: 14

OOB free bytes:
offset: 1 length: 1
offset: 16 length: 2
offset: 32 length: 2
offset: 48 length: 2

Then I verified that the ancient / downstream / ported NAND driver
suffers from the same ECC errors as reported in this e-mail thread.

Dead end :(


I tested kernels 4.1, 4.14, 4.19, 5.4 and 5.10 with UBI & upstream
brcmnand driver. They all suffer from ECC errors.


Finally I realized something a bit more interesting. I've a following
custom init.d script:

# cat /etc/init.d/S39network
#!/bin/sh
machine="$(cat /proc/device-tree/compatible | tr '\0' '\t' | cut -f 1)"
interfaces="/usr/local/etc/network/interfaces.$machine"
[ -f "$interfaces" ] && cp "$interfaces" /etc/network/interfaces

(it copies device specific network config from /usr/ to /etc/network/)

With that init.d script executed on boot I get 9 ECC errors like:
ubi_io_read: error -74 (ECC error) while reading 68 bytes from

Without it I get 0 errors while booting. Also copying right file from
/usr/ to /etc/network/ manually - after init completion - doesn't cause
ECC error.

Does it mean UBI uses NAND differently during first boot, when there
aren't plently of empty (erased) blocks? Does it pack data in existing
blocks more aggressively?


No matter if I have my init.d script or not I can always see ECC errors:
1. One ECC error while reading rootfs for the first time
2. 5 ECC errors after executing "reboot"

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-03-22 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 18:02 ECC errors after UBI writes with brcmnand (Northstar with v6.1 controller) Rafał Miłecki
2022-03-22 17:53 ` Rafał Miłecki [this message]
2022-03-23 15:33   ` Rafał Miłecki
2022-03-23 15:48     ` Miquel Raynal
2022-03-24 16:49 ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3bc0832-efef-9e92-3b17-df8cc731b533@gmail.com \
    --to=zajec5@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox