[U-Boot] [PATCH 1/3] mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN
Stefan Roese
sr at denx.de
Mon Aug 19 10:55:24 CEST 2013
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?
Thanks,
Stefan
More information about the U-Boot
mailing list