partitions and erase regions

Kári Davíðsson kd at flaga.is
Tue Apr 24 06:29:48 EDT 2001


> -----Original Message-----
> From: David Woodhouse [mailto:dwmw2 at infradead.org]
> Sent: 23. apríl 2001 14:11
> To: Kári Davíðsson
> Cc: mtd at infradead.org; nico at cam.org
> Subject: Re: partitions and erase regions 
> 
> How about the following rules/behaviour for MTD partitions:
> 
>  1. For a partition to be writable, there must be a number 
> usable as 'major'
> 	erasesize (mtd->erasesize), such that a naïve user of 
> MTD can get 
> 	erases at offsets such that offset % erasesize == 0 to work.
>  2. If a partition covers regions of the master which have differing 
> 	erasesizes, the information about the exact erase regions should
> 	be made available in the slave.

It sounds reasonable to me. Although I have a problem with the "major"
erazesize in
general. The erase regions are in the flash for a reason, i.e. the chip
is not
of one "major" erase size but of many erase sizes, although most of it
(untill now, who knows what AMD, Intel and others might do in the future
8-))
is of one erase size. I think it should be a long term goal to remove
the
member "mtd->erasize". It might be irresponsible of me to say that since
it seems
that a lot of the code using mtd structure depend heavily on that
member.
It might also complicate the code a lot to always go through the erase
region
structures for every erase/[un]lock and slow down e.g. filesystems that
live on
the device. Modulo division is simple and fast no one can deny that 8-)
But on the other hand it also complicates the code to have two ways of
getting to a 
sector, i.e. mtd->erasesize and erase regions.....

> 
> So... given a master device with 'major' erasesize 64K, which 
> is actually 
> 8*8K, 15*64K, this would be the result of some example partitions...
> 
>  Partition range   Erase size(s)      Writable?
> 
>  000000 - 020000  64K (8*8K, 1*16K)	Yes
>  020000 - 100000  64K			Yes
> 
>  000000 - 008000  8K			Yes
>  008000 - 100000  -			No (no usable 'major' 
> erasesize) 
> 
>  000000 - 010000  8K			Yes
>  010000 - 100000  64K			Yes
> 
>  008000 - 010000  8K			Yes
> 
> Kári, if this is acceptable for your purposes (and I think it 
> is), then we 
> should just implement this behaviour and not have any 
> conditional code at 
> all.

Yes, I will try to get to it this week.


K.D.


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list