[PATCH v2] MTD: modify mtd api to return bitflip info on read operations

Peter Horton phorton at bitbox.co.uk
Wed Dec 7 04:42:37 EST 2011


On 06/12/2011 21:52, Robert Jarzmik wrote:
> Mike Dunn<mikedunn at newsguy.com>  writes:
>> On 12/05/2011 09:09 AM, Peter Horton wrote:
>>> Surely the check for "do we need to scrub ?" should be done lower down
>>> otherwise all users of the mtd NAND interface (UBI / JFFS2 etc) are going to
>>> have to re-implement those sysfs files and the corresponding checks.
>> Well, anything higher up that wants to avail itself of this api change will need
>> some rework regardless.  Currently the only info passed up from the driver is
>> that at least one bitflip occurred somewhere during the read.  The plan is to
>> eventually make some changes to UBI so that the decision to scrub is made more
>> intelligently.
>
> I'd like to second Mike's proposition here.
>
> Policy should not be put into drivers code whenever possible. The question "do
> we need to scrub" is to be answered in upper layers IMHO. Moreover, upper layer
> would then have the choice to trigger scrubbing on their own policy. This policy
> could rely on the information provided by the driver :
>   - how much bitflips the ECC can fix
>

It's not policy, it's a property of the NAND device.



More information about the linux-mtd mailing list