public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization
@ 2014-10-31 10:29 Heiko Schocher
  2014-11-05 19:20 ` Andrew Ruder
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2014-10-31 10:29 UTC (permalink / raw)
  To: u-boot

ff94bc40af3481d47546595ba73c136de6af6929 "mtd, ubi, ubifs: resync with Linux-3.14"
introduced the writebufsize field in struct mtd_info, which
is not initialized in the cfi_flash driver, which leads in
not working ubi on cfi flashes. Fix it

Signed-off-by: Heiko Schocher <hs@denx.de>
Reported-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Acked-by: Stefan Roese <sr@denx.de>

---
@Andrew: could you test this patch, if it solves your issue?

Changes in v2:
add comment from Stefan Roese
  - align the "=" with the others lines above
add Acked-by from Stefan Roese

 drivers/mtd/cfi_mtd.c | 1 +
 1 file changed, 1 insertion(+)

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;
 
 		mtd->_erase		= cfi_mtd_erase;
 		mtd->_read		= cfi_mtd_read;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization
  2014-10-31 10:29 [U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization Heiko Schocher
@ 2014-11-05 19:20 ` Andrew Ruder
  2014-11-05 20:05   ` Andrew Ruder
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Ruder @ 2014-11-05 19:20 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization
  2014-11-05 19:20 ` Andrew Ruder
@ 2014-11-05 20:05   ` Andrew Ruder
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Ruder @ 2014-11-05 20:05 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 05, 2014 at 01:20:00PM -0600, Andrew Ruder wrote:
> I'm just not sure it really matters.

That being said:

Acked-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>

Cheers :),
Andy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-05 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 10:29 [U-Boot] [PATCH v2] mtd, cfi, ubi: add missing writebufsize initialization Heiko Schocher
2014-11-05 19:20 ` Andrew Ruder
2014-11-05 20:05   ` Andrew Ruder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox