Mean Time Between Failure - UBI clarifications

Ricard Wanderlof ricard.wanderlof at
Mon Feb 28 10:32:53 EST 2011

On Mon, 28 Feb 2011, Navaneethan P wrote:

> Thank you for your response.
> On Thu, Feb 24, 2011 at 7:34 PM, Ricard Wanderlof
> <ricard.wanderlof at> wrote:
>> mtd supplies statistics counters that might help. For each mtd partition
>> there is one counter which is increased every time a read operation requires
>> ECC to correct a bit (i.e. a correctable single bit error), and one counter
>> for ECC failures (two-bit errors).
> I checked the mtd directory of sysfs and also the source code of mtd.
> However I could not find the mtd statistics counter from the available
> source mtd-2.6.28. Could you please guide me as to where the
> statistics counters are implemented inside mtd source.

They're in mtd->ecc_stats . See drivers/mtd/nand/nand_base.c for 
instance. drivers/mtd/mtdchar.c:mtd_ioctl (case ECCGETSTATS) retrievs the 
statistics to userspace for the ECCGETSTATS ioctl.

Ricard Wolf Wanderlöf                           ricardw(at)
Axis Communications AB, Lund, Sweden  
Phone +46 46 272 2016                           Fax +46 46 13 61 30

More information about the linux-mtd mailing list