[PATCH 2/4] mtd: nand: Account the blocks used by the BBT in the ecc_stats

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Mon May 12 19:27:53 PDT 2014


On 21 Mar 08:57 AM, Ezequiel Garcia wrote:
> Strictly speaking we should be updating the ecc_stats in the master
> MTD object, with the blocks used by the bad block table.
> 
> This is already being done for bad and reserved blocks detected doing
> the BBT search, but not for the blocks used by the BBT itself. This commit
> adds the latter.
> 
> It should be noted that the ecc_stats structure is kept only for userspace
> information, accesible through an ioctl. However, since the master MTD object
> is not tied to any /dev/mtd{N} device node in the filesystem, there's currently
> no way to retrieve this information.
> 
> This ecc_stats is used for the MTD partitions typically allocated and
> registered by mtd_device_parse_register(). These have a device node, but scan
> for bad blocks and updates the ecc_stats in a different code path.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
> --
> For the reasons exposed above, it's not clear we should remove the ecc_stats
> update in the master MTD altogether or simply take account of the BBT blocks
> for consistency. I've chosen the latter, for it seemed a safer changer.
> 
> I'm open to discussion, though.

Brian,

Can you comment a bit on this one? Should I keep this change in v2?
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list