All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: adapt writebufsize calculation for concat
@ 2011-01-24 16:45 Holger Brunck
  2011-01-29 16:22 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Brunck @ 2011-01-24 16:45 UTC (permalink / raw)
  To: linux-mtd; +Cc: Holger Brunck

If different chips with different writebufsize are concatenated,
the writebufsize from the concat device has to be taken from
the device with the largest writebuffer. This writebufsize
is used later on in the UBI layer for the min I/O size.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 drivers/mtd/mtdconcat.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index b84dadb..951883d 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -733,6 +733,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[],	/* subdevices to c
 	struct mtd_concat *concat;
 	uint32_t max_erasesize, curr_erasesize;
 	int num_erase_region;
+	int max_writebufsize = 0;
 
 	printk(KERN_NOTICE "Concatenating MTD devices:\n");
 	for (i = 0; i < num_devs; i++)
@@ -759,7 +760,12 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[],	/* subdevices to c
 	concat->mtd.size = subdev[0]->size;
 	concat->mtd.erasesize = subdev[0]->erasesize;
 	concat->mtd.writesize = subdev[0]->writesize;
-	concat->mtd.writebufsize = subdev[0]->writebufsize;
+
+	for (i = 0; i < num_devs; i++)
+		if (max_writebufsize < subdev[i]->writebufsize)
+			max_writebufsize = subdev[i]->writebufsize;
+	concat->mtd.writebufsize = max_writebufsize;
+
 	concat->mtd.subpage_sft = subdev[0]->subpage_sft;
 	concat->mtd.oobsize = subdev[0]->oobsize;
 	concat->mtd.oobavail = subdev[0]->oobavail;
-- 
1.7.0.5

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

* Re: [PATCH] mtd: adapt writebufsize calculation for concat
  2011-01-24 16:45 [PATCH] mtd: adapt writebufsize calculation for concat Holger Brunck
@ 2011-01-29 16:22 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2011-01-29 16:22 UTC (permalink / raw)
  To: Holger Brunck; +Cc: linux-mtd

On Mon, 2011-01-24 at 17:45 +0100, Holger Brunck wrote:
> If different chips with different writebufsize are concatenated,
> the writebufsize from the concat device has to be taken from
> the device with the largest writebuffer. This writebufsize
> is used later on in the UBI layer for the min I/O size.
> 
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2011-01-29 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 16:45 [PATCH] mtd: adapt writebufsize calculation for concat Holger Brunck
2011-01-29 16:22 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.