lkml.org 
[lkml]   [2012]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 2/5] ubi: Limit amount of reserved eraseblocks for bad PEB handling
    2012/7/4 Shmulik Ladkani <shmulik.ladkani@gmail.com>:
    > diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c
    > index f6a7d7a..e9dcb83 100644
    > --- a/drivers/mtd/ubi/misc.c
    > +++ b/drivers/mtd/ubi/misc.c
    > @@ -98,10 +98,18 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id)
    > */
    > void ubi_calculate_reserved(struct ubi_device *ubi)
    > {
    > - ubi->beb_rsvd_level = ubi->good_peb_count/100;
    > - ubi->beb_rsvd_level *= CONFIG_MTD_UBI_BEB_RESERVE;
    > - if (ubi->beb_rsvd_level < MIN_RESEVED_PEBS)
    > - ubi->beb_rsvd_level = MIN_RESEVED_PEBS;
    > + /*
    > + * Calculate the actual number of PEBs currently needed to be reserved
    > + * for future bad eraseblock handling.
    > + */
    > + ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count;
    > + if (ubi->beb_rsvd_level < 0) {
    > + ubi->beb_rsvd_level = 0;
    > + ubi_warn("number of bad PEBs (%d) is above the expected limit "
    > + "(%d), not reserving any PEBs for bad PEB handling, "
    > + "will use available PEBs (if any)",
    > + ubi->bad_peb_count, ubi->bad_peb_limit);
    > + }
    > }
    is it ok for beb_rsvd_level to be in the range [0..x[ instead of [2..x[ ?


    \
     
     \ /
      Last update: 2012-07-09 13:02    [W:2.147 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site