MLC Support in JFFS2
Amul Kumar Saha
amul.saha at samsung.com
Wed Mar 31 05:53:07 EDT 2010
Hi David,
We have come up with an alternate solution to support MLC devices on JFFS2.
>>
>> Currenlty , Is there a way to use JFFS2 with MLC Memories ( NOP == 1 )?
>>
>> If not , Felt that any one of the following patch can be of use
>>
>> 1. http://lists.infradead.org/pipermail/linux-mtd/2007-December/020047.html
>> - Which removes the Clean Marker.
>
> There was a reason for the cleanmarker -- it saved us from using
> partly-erased blocks for data. Do you have some other way to guarantee
> that this won't happen?
>
> (Sorry, I think we may have had this discussion before, but I've
> forgotten the conclusion, if there was one. It was academic at the time,
> since we didn't have any solution for the paired-page insanity anyway. I
> was mostly just burying my head in the sand and hoping this stupid 'MLC'
> crap would go away.)
New approach:-
We will have something known as the TOKEN_BLOCK.
TOKEN_BLOCK: A block used to store all the ready_to_use blocks related info.
ready_to_use blocks: These are blocks which are erased and ready to use,
but don't have a usual CLEANMARKER on them. To save NOP for
the 1st page of each block.
How it works:
1. Ask GC to provide a block, and use it as TOKEN_BLOCK on need basis.
2. In the provided block, we store all ready_to_use block info.
3. On remount; this info needs to be retreived.
So, we shall make use of MAGIC_NUMBER signifying TOKEN_BLOCK,
to identify the block containing the info.
Scan has to be modified, to identify the TOKEN_BLOCK and act accordingly.
Handling TOKEN_BLOCK
1. Make request for a block to be used as TOKEN_BLOCK.
2. List all the ready_to_use block info on the TOKEN_BLOCK contiguously.
3. Write the TOKEN_BLOCK's MAGIC_NUMBER in the OOB Area alongwith the
ready_to_use info, in the Main Area.
4. On next update, ask GC to provide a fresh block.
5. Update this block accordingly as TOKEN_BLOCK.
6. Discard the previous TOKEN_BLOCK, and put it on dirty_list.
Let me know, about the feasibility of this design from your perspective.
This is just a base plan, and obvisouly there are a lot of things that have to be looked
into, before getting into the real imlpementation.
Regards,
Amul Kumar Saha
More information about the linux-mtd
mailing list