* [PATCH v3 1/1] mtd: mtdram: Add parameter for setting writebuf size
@ 2016-03-02 15:26 Alexander Stein
2016-03-07 21:07 ` Brian Norris
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2016-03-02 15:26 UTC (permalink / raw)
To: David Woodhouse, Brian Norris; +Cc: Alexander Stein, linux-mtd
ubifs uses the write buffer size in recovery algorithm. When inspecting
an unclean ubifs recovery fails with writebuf size 64 in mtdram while
recovery on actual mtd device with writebuf size of 1024 succeeds.
So add a parameter for setting this property.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
---
Changes in v3:
* Removed Kconfig option
Changes in v2:
* Added Reviewed-by: Richard Weinberger <richard@nod.at>
* Removed outdated comment about CFI NOR flash write buffer sizes
drivers/mtd/devices/mtdram.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index 627a9bc..cbd8547 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -19,6 +19,7 @@
static unsigned long total_size = CONFIG_MTDRAM_TOTAL_SIZE;
static unsigned long erase_size = CONFIG_MTDRAM_ERASE_SIZE;
+static unsigned long writebuf_size = 64;
#define MTDRAM_TOTAL_SIZE (total_size * 1024)
#define MTDRAM_ERASE_SIZE (erase_size * 1024)
@@ -27,6 +28,8 @@ module_param(total_size, ulong, 0);
MODULE_PARM_DESC(total_size, "Total device size in KiB");
module_param(erase_size, ulong, 0);
MODULE_PARM_DESC(erase_size, "Device erase block size in KiB");
+module_param(writebuf_size, ulong, 0);
+MODULE_PARM_DESC(writebuf_size, "Device write buf size in Bytes (Default: 64)");
#endif
// We could store these in the mtd structure, but we only support 1 device..
@@ -123,7 +126,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
mtd->flags = MTD_CAP_RAM;
mtd->size = size;
mtd->writesize = 1;
- mtd->writebufsize = 64; /* Mimic CFI NOR flashes */
+ mtd->writebufsize = writebuf_size;
mtd->erasesize = MTDRAM_ERASE_SIZE;
mtd->priv = mapped_address;
--
2.4.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 1/1] mtd: mtdram: Add parameter for setting writebuf size
2016-03-02 15:26 [PATCH v3 1/1] mtd: mtdram: Add parameter for setting writebuf size Alexander Stein
@ 2016-03-07 21:07 ` Brian Norris
0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2016-03-07 21:07 UTC (permalink / raw)
To: Alexander Stein; +Cc: David Woodhouse, linux-mtd
On Wed, Mar 02, 2016 at 04:26:59PM +0100, Alexander Stein wrote:
> ubifs uses the write buffer size in recovery algorithm. When inspecting
> an unclean ubifs recovery fails with writebuf size 64 in mtdram while
> recovery on actual mtd device with writebuf size of 1024 succeeds.
> So add a parameter for setting this property.
>
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> Reviewed-by: Richard Weinberger <richard@nod.at>
Applied to l2-mtd.git
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-07 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02 15:26 [PATCH v3 1/1] mtd: mtdram: Add parameter for setting writebuf size Alexander Stein
2016-03-07 21:07 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).