[PATCH] MTD: drivers return bitlip info to mtd on read

Mike Dunn mikedunn at newsguy.com
Tue Dec 27 15:26:12 EST 2011


On 12/27/2011 12:33 AM, Artem Bityutskiy wrote:
> On Mon, 2011-12-26 at 11:38 -0800, Mike Dunn wrote:
>> This patch changes the meaning of the value returned by the read() and
>> read_oob() mtd driver methods.  Previously, absent a hard error, these functions
>> returned either -EUCLEAN (one or more bitflips were corrected) or 0 (no
>> bitflips).  Drivers now return, absent a hard error, the maximum number of
>> bitflips that were corrected on any one page.  
>>
>> This change is made possible by the fact that all calls to the driver methods
>> now go through mtd wrapper functions.  The values returned by those wrapper
>> functions have not changed, nor have their meaning.  Only the values returned to
>> the mtd wrappers by the driver have changed.
>>
>> Tested with nandsim and onenand_sim.  The two drivers that were modified were
>> compile-tested only.
>>
>> Signed-off-by: Mike Dunn <mikedunn at newsguy.com>
> Hi, I am not sure using the return code is a good way for this.


OK.  It was a little kludgey, but had the advantage of touching very few drivers
and leaving the existing function prototypes unchanged.


> But please, proceed with working on your issues - this patch is not
> going to hit 3.2 anyway - I think it is the 3.3 material. Linus promised
> 3.2 release this week, then we have the merge window, and then it is
> time for further patches in this area.
>
> I will do the other changes which I described in my cover letter. I
> will also make a patch which adds a bitflips parameter to read/read_oob
> and then you will implement 
>
> But please, just make something which works for you for now and go on
> with other DoC issues you have. Meantime I'll prepare the MTD basis
> for you.
>
> I think I'll first do the 3 items I described in my series. Then I'll
> add "bitflips" parameter to read/read_oob() functions, but won't
> implement or ever check it. After this you'll add your code.
>
> How does this sound to you?


Sure, you're the boss.  I appreciate your attention on this.  If you like, I'd
be happy to submit a patch that adds the max_bitflips argument to  read() and
read_oob() after you finish the cleanup and consolidation made possible by the
wrappers.  I've already done this work.  Your choice; let me know.

Thanks again,
Mike




More information about the linux-mtd mailing list