[PATCH] UBIFS: add tolerance to use variable writesize

Dahlhoff Achim (CM-AI/PJ-CF32) Achim.Dahlhoff at de.bosch.com
Mon Jul 1 04:32:17 EDT 2013


Hello.

No, I do not want to touch the max_write_size or writebufsize. The max_write_size is the size which can be transferred in one piece to the chip and does not modify the UBIfs data structures. The min size is relevant and can cause images to become incompatible with a specific NOR chip. If the NOR driver should accidentally choose a writesize which is too small, this will not cause any compatibility issues or data loss. It will only reduce write performance.

Without the tolerance patch, you cannot mount one UBSfs image on different NOR devices with different writesize values of 1 or 32.


Achim.


-----Original Message-----
From: Artem Bityutskiy [mailto:dedekind1 at gmail.com] 
Sent: Monday, July 01, 2013 9:55 AM
To: Dirk Behme
Cc: linux-mtd at lists.infradead.org; Behme Dirk (CM-AI/PJ-CF32); Dahlhoff Achim (CM-AI/PJ-CF32)
Subject: Re: [PATCH] UBIFS: add tolerance to use variable writesize

On Wed, 2013-05-15 at 18:21 +0200, Dirk Behme wrote:
> From: Achim Dahlhoff <Achim.Dahlhoff at de.bosch.com>
> 
> UBIfs adapts it‘s structures according to the minimum writeSize reported
> by the MTD device. For NOR flash devices, this is normally 1. For NOR
> devices with internal hardware-ECC it might be more, such as the S-Die
> flash chips of Micron which can use an internal ECC if the chip is
> accessed in 32 byte chunks.
> 
> The UBIfs mount process checks and compares the writeSize set in the
> image and the writeSize reported from the /dev/mtd . UBIfs will fail
> to mount if the values differ. It should, though, not be a problem to
> mount an image which was created with a writeSize larger than that of
> the MTD, if it is larger by an integer factor.
> 
> This commit changes the check in a way so it will allow the image
> writeSize to be larger than that of the MTD by an integer factor.
> It will allow to create images and deploy them on different devices
> using different writeSizes. writeSize found using values of 1, 8 and 32.
> 
> Signed-off-by: Achim Dahlhoff <Achim.Dahlhoff at de.bosch.com>

Hi Dirk,

first of all, sorry for long delay.

In UBIFS we have 2 flash parameters which are relevant to this
discussion:

1. min_io_size - minimum size of the I/O buffer, comes from
mtd->writesize
2. max_write_size - optimzl size of the I/O buffer, comes from
mtd->writebufsize

Take a look at io.c.

So it looks like what you actually want to do is to make sure you have
the right max_write_size, in which case UBIFS will do most of its writes
in max_wirte_size units. E.g., make it to be 32.

This can be done by teaching your flash driver to export correct
'mtd->writebufsize'. My guess is that you do not do this, and it
defaults to 'mtd->writesize'.

-- 
Best Regards,
Artem Bityutskiy



More information about the linux-mtd mailing list