[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6fe6ae4-7ef2-ed61-3bb4-dd00f92524f8@nod.at>
Date: Fri, 25 Nov 2016 14:37:22 +0100
From: Richard Weinberger <richard@....at>
To: Brian Norris <computersforpeace@...il.com>,
Zach Brown <zach.brown@...com>
Cc: dwmw2@...radead.org, boris.brezillon@...e-electrons.com,
dedekind1@...il.com, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH v5 2/5] mtd: ubi: use 'max_bad_blocks' to compute
bad_peb_limit if available
Zach, Brian,
sorry for the late review.
On 22.11.2016 19:42, Brian Norris wrote:
> On Mon, Nov 21, 2016 at 01:51:36PM -0600, Zach Brown wrote:
>> From: Jeff Westfahl <jeff.westfahl@...com>
>>
>> Use the MTD function 'max_bad_blocks' to compute the UBI bad_peb_limit,
>> if the function is implemented for an MTD and doesn't return an error.
>
> I'm not exactly a UBI expert here, but it seems reasonable that we
> should adjust the Kconfig documentation for MTD_UBI_BEB_LIMIT to further
> emphasize that it's a default, if the value can't be determined by other
> means.
>
>> Signed-off-by: Jeff Westfahl <jeff.westfahl@...com>
>> Signed-off-by: Zach Brown <zach.brown@...com>
>> Acked-by: Boris Brezillon <boris.brezillon@...e-electron.com>
>> ---
>> drivers/mtd/ubi/build.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
>> index 85d54f3..e9940a9 100644
>> --- a/drivers/mtd/ubi/build.c
>> +++ b/drivers/mtd/ubi/build.c
>> @@ -584,6 +584,10 @@ static int get_bad_peb_limit(const struct ubi_device *ubi, int max_beb_per1024)
>> int limit, device_pebs;
>> uint64_t device_size;
>>
>> + limit = mtd_max_bad_blocks(ubi->mtd, 0, ubi->mtd->size);
>> + if (limit > 0)
>> + return limit;
>
> Are you sure you want to even override the user-provided
> max_beb_per1024 value taken from the mtd= line? I'd think if someone
> went as far as to specify this in the kernel command line, they don't
> expect it to get overridden. Just my two cents.
I agree. With this patch applied the limit can be set via Kconfig, cmdline and automatically.
IMHO the automatic value via mtd_max_bad_blocks and over-writeable via cmdline and Kconfig.
...and this needs to be documented. :-)
I'd go so far and suggest dropping the Kconfig option.
Thanks,
//richard
Powered by blists - more mailing lists