[PATCH 0/7] mtd: Change meaning of -EUCLEAN return code on reads

Mike Dunn mikedunn at newsguy.com
Wed Apr 25 11:56:11 EDT 2012


On 04/25/2012 04:23 AM, Ivan Djelic wrote:
> 
> Thanks for this new version.
> The whole series of patches looks OK to me, except for one small glitch:
> 'mtd->bitflip_threshold' can be customized by the driver, but in that case it is not
> propagated to the slave partition devices (the same way 'ecc_strength' is propagated).
> Something like this is missing:
> 
> diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
> index d6321f6..d518e4d 100644
> --- a/drivers/mtd/mtdpart.c
> +++ b/drivers/mtd/mtdpart.c
> @@ -517,6 +517,8 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
>  
>         slave->mtd.ecclayout = master->ecclayout;
>         slave->mtd.ecc_strength = master->ecc_strength;
> +       slave->mtd.bitflip_threshold = master->bitflip_threshold;
> +
>         if (master->_block_isbad) {
>                 uint64_t offs = 0;
> 


Yes, you're right.  Without this it breaks if the driver sets bitflip_threshold.


> Apart from that, I was able to run a few tests on a BeagleBoard revC3 with simulated
> bitflips, dropping my own error concealment code in favor of your patch. I did the
> following checks:
>  - when errors_corrected < bitflip_threshold, check that mtd_read() returns 0
>  - when errors_corrected >= bitflip_threshold, check that mtd_read() returns -EUCLEAN
>  - check if driver customization of bitflip_threshold works


I guess I should have performed this test too :)


>  - check if per-partition customization of bitflip_threshold through sysfs works
> Everything worked as expected.


Thanks once again Ivan.  I'll follow up with a new version of the patch set in a
day or too.

Mike



More information about the linux-mtd mailing list