What is subpage_sft??

Vinit Agnihotri vinit.agnihotri at gmail.com
Tue Jul 3 02:35:22 EDT 2007


I am little bit confused with following UBI code.

My initial understandings are as follows, please correct me if I am wrong.
1. A flash device has "n" no. of eraseblocks.
2. A eraseblock contains "m" no. of pages.
3. A page contains "l" no. of  subpages.
4. Subpage support is dependent on underlying NAND, so every NAND cant
have subpage access.
5. Concept of subpages only exists in NAND flash not NOR.

UBI code:
 ubi->min_io_size = ubi->mtd->writesize;
 ubi->hdrs_min_io_size =ubi->mtd->writesize >> ubi->mtd->subpage_sft;
 ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
 ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);


6. min_io_size: is minimal i/o that can be performed on flash.
7. writesize: is indeed a page size.
8. If subpages are not supported then hdrs_min_io_size == writesize
9. So if writesize is 2048 bytes & if subpage_sft is 0, then ec & vid
headers will be of 1 NAND page. So here in this case: min_io_size ==
writesize == hdrs_min_io_size.
10. Now if subpages are supported, then min_io_size !=
hdrs_min_io_size. Now if we can write in alignment of hdrs_min_io_size
which is less that min_io_size , then what is significance of
min_io_size.
i.e.
If writesize = 2048
  subpage_sft = 2
  min_io_size = writesize = 2048
  hdrs_min_io_size = writesize >> subpage_sft = 512
  hdrs_min_io_size < min_io_size

Now if we can write hdrs_min_io_size of data to flash then what is
notion of min_io_size???


Thanks & Regards
Vinit.




On 7/3/07, Vinit Agnihotri <vinit.agnihotri at gmail.com> wrote:
> Thanks a lot Artem & Kyungmin, for immediate replies.
> I guess it answers all my questions.
>
> Thanks once again.
>
> Regards,
> Vinit.
>
>
> On 7/3/07, Artem Bityutskiy <dedekind at infradead.org> wrote:
> > On Tue, 2007-07-03 at 14:34 +0900, Kyungmin Park wrote:
> > > It is used at UBI.
> >
> > Yeah, it is very beneficial for UBI because it wastes twice as less NAND
> > flash space if there is sub-page access.
> >
> > --
> > Best regards,
> > Artem Bityutskiy (Битюцкий Артём)
> >
> >
>
>
> --
> I feel free now
>


-- 
I feel free now


More information about the linux-mtd mailing list