mtd, cfi, ubi: add missing writebufsize initialization
PATCH v2 1/1 mtd, cfi, ubi: add missing writebufsize initialization
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
---
@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(+)
drivers/mtd/cfi_mtd.c +1 -0
@@ -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;
Signature · 1 line
1.8.3.1
PATCH v2 1/1 mtd, cfi, ubi: add missing writebufsize initialization
drivers/mtd/cfi_mtd.c int cfi_mtd_init(void) · line 229
Quoted 9 lines · Heiko Schocher
drivers/mtd/cfi_mtd.c +1
-0@@ -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
PATCH v2 1/1 mtd, cfi, ubi: add missing writebufsize initialization
Quoted 1 line · Andrew Ruder
I'm just not sure it really matters.
That being said:
Cheers :),
Andy