From: Scott Wood Date: Mon, 19 Aug 2013 11:22:33 -0500 Subject: [U-Boot] [PATCH 1/3] mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN In-Reply-To: <5211DD7C.1020601@denx.de> References: <1375784029-9310-1-git-send-email-paul.burton@imgtec.com> <1375784029-9310-2-git-send-email-paul.burton@imgtec.com> <5211DD7C.1020601@denx.de> Message-ID: <1376929353.31636.314.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2013-08-19 at 10:55 +0200, Stefan Roese wrote: > On 06.08.2013 12:13, Paul Burton wrote: > > Linux modified the MTD driver interface in commit edbc4540 (with the > > same name as this commit). The effect is that calls to mtd_read will not > > return -EUCLEAN if the number of ECC-corrected bit errors is below a > > certain threshold, which defaults to the strength of the ECC. This > > allows -EUCLEAN to stop indicating "some bits were corrected" and begin > > indicating "a large number of bits were corrected, the data held in this > > region of flash may be lost soon". UBI makes use of this and when > > -EUCLEAN is returned from mtd_read it will move data to another block of > > flash. Without adopting this interface change UBI on U-boot attempts to > > move data between blocks every time a single bit is corrected using the > > ECC, which is a very common occurance on some devices. For some devices > > it can be so common that UBI gets stuck constantly moving data around > > because each block it attempts to use has a single bit error. This > > patch adopts the interface change as in Linux commit edbc4540 in order > > to avoid such situations. > > > > Given that none of the drivers under drivers/mtd return -EUCLEAN, this > > should only affect those using software ECC. I have tested that it works > > on a board which is currently out of tree, but which I hope to be able > > to begin upstreaming soon. > > Paul, a quick question to clarify this. This patch fixes a regression in > the current mtd->_read implementation (used by UBI) that was introduced > by the MTD sync to v3.7.1? Is this correct? > > And what error exactly did occur on your system?