[U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization

Andrew Ruder andrew.ruder at elecsyscorp.com
Wed Nov 5 20:20:00 CET 2014


On Fri, Oct 31, 2014 at 11:29:45AM +0100, Heiko Schocher wrote:
> diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
> index ac805ff..709a486 100644
> --- a/drivers/mtd/cfi_mtd.c
> +++ b/drivers/mtd/cfi_mtd.c
> @@ -226,6 +226,7 @@ int cfi_mtd_init(void)
>  		mtd->flags		= MTD_CAP_NORFLASH;
>  		mtd->size		= fi->size;
>  		mtd->writesize		= 1;
> +		mtd->writebufsize	= mtd->writesize;

Sorry I didn't see this patch up front!

My only nit-pick is that this is effectively ignoring the write buffer
present on many (most? all?) NOR flashes since this field is supposed to
be the maximum write buffer size, not the minimum write buffer size
(judging by its user ubifs and associated comments).  As such, this
really should be fi->buffer_size IMO, not mtd->writesize (i.e. 1).  But, the
only user of this field seems to be ubifs (not even ubi) for writes so
I'm just not sure it really matters.

Cheers,
Andy






More information about the U-Boot mailing list