All of lore.kernel.org
 help / color / mirror / Atom feed
* Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data !
@ 2009-09-16  7:09 Murali N
  2009-09-16  7:23 ` Artem Bityutskiy
  2009-09-16  9:36 ` Artem Bityutskiy
  0 siblings, 2 replies; 5+ messages in thread
From: Murali N @ 2009-09-16  7:09 UTC (permalink / raw)
  To: linux-mtd

Hi All,
i have a doubt on how the OOB data is being managed in MTD driver.
Recently i have enabled mtd-tests to test my driver for mtd
compliance.After i ran "mtd_oobtest" i was messed up with test and
come up with few questions:

1) Is these tests are well validated? can i trust these tests 100%
compliant to MTD API specification?
2) In "mtd_oobtest" ( drivers/mtd/tests/ ), there was a "test 4 of 5"
in this there was a few checks for writing/reading end off OOB data.
            - In these tests what is the significance of using
"ooboffs" in OOB_AUTO mode?
3) Is MTD driver ask the below NAND driver to read/write the oob data
integral of oobavail size in OOB_AUTO mode? How MTD driver behaves if
it is not!!!
4) Finally, can anyone please explain bit more about OOB_PLACE mode?
also the significance of ooboffs field usage?

I appreciate your help, thanks

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

* Re: Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data !
  2009-09-16  7:09 Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data ! Murali N
@ 2009-09-16  7:23 ` Artem Bityutskiy
  2009-09-16  9:36 ` Artem Bityutskiy
  1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2009-09-16  7:23 UTC (permalink / raw)
  To: Murali N; +Cc: linux-mtd

On Wed, 2009-09-16 at 12:39 +0530, Murali N wrote:
> Hi All,
> i have a doubt on how the OOB data is being managed in MTD driver.
> Recently i have enabled mtd-tests to test my driver for mtd
> compliance.After i ran "mtd_oobtest" i was messed up with test and
> come up with few questions:
> 
> 1) Is these tests are well validated? can i trust these tests 100%
> compliant to MTD API specification?

Not necessarily. We wrote these tests to test our OneNAND, and they
may contain bugs.

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

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

* Re: Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data !
  2009-09-16  7:09 Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data ! Murali N
  2009-09-16  7:23 ` Artem Bityutskiy
@ 2009-09-16  9:36 ` Artem Bityutskiy
  2009-09-16 10:20   ` Murali N
  1 sibling, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2009-09-16  9:36 UTC (permalink / raw)
  To: Murali N; +Cc: linux-mtd

On Wed, 2009-09-16 at 12:39 +0530, Murali N wrote:
> Hi All,
> i have a doubt on how the OOB data is being managed in MTD driver.
> Recently i have enabled mtd-tests to test my driver for mtd
> compliance.After i ran "mtd_oobtest" i was messed up with test and
> come up with few questions:
> 
> 1) Is these tests are well validated? can i trust these tests 100%
> compliant to MTD API specification?
> 2) In "mtd_oobtest" ( drivers/mtd/tests/ ), there was a "test 4 of 5"
> in this there was a few checks for writing/reading end off OOB data.
>             - In these tests what is the significance of using
> "ooboffs" in OOB_AUTO mode?
> 3) Is MTD driver ask the below NAND driver to read/write the oob data
> integral of oobavail size in OOB_AUTO mode? How MTD driver behaves if
> it is not!!!
> 4) Finally, can anyone please explain bit more about OOB_PLACE mode?
> also the significance of ooboffs field usage?

I do not understand your questions, and I do not quite remember these
modes already, but the below code probably explains things well:

/*
 * oob operation modes
 *
 * MTD_OOB_PLACE:       oob data are placed at the given offset
 * MTD_OOB_AUTO:        oob data are automatically placed at the free
areas
 *                      which are defined by the ecclayout
 * MTD_OOB_RAW:         mode to read raw data+oob in one chunk. The oob
data
 *                      is inserted into the data. Thats a raw image of
the
 *                      flash contents.
 */
typedef enum {
        MTD_OOB_PLACE,
        MTD_OOB_AUTO,
        MTD_OOB_RAW,
} mtd_oob_mode_t;

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

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

* Re: Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data !
  2009-09-16  9:36 ` Artem Bityutskiy
@ 2009-09-16 10:20   ` Murali N
  2009-09-16 10:50     ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Murali N @ 2009-09-16 10:20 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

Hi Artem, can you please explain me a bit more about OOB_PLACE mode?.
Also in mtd tests i have seen there is ooboffs field being used in
OOB_AUTO mode.My doubt here was why AUTO mode cares about ooboffs
field.ECC layout structure is defined clearly in the AUTO mode? am i
correct? then what is the significance of ooboffs field?

i am not caring the ooboffs when the AUTO mode is selected in my
driver? i was bit confused where it is mentioned in the MTD
specification? can you please point to me if you have any info!!!

thanks

On Wed, Sep 16, 2009 at 3:06 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Wed, 2009-09-16 at 12:39 +0530, Murali N wrote:
>> Hi All,
>> i have a doubt on how the OOB data is being managed in MTD driver.
>> Recently i have enabled mtd-tests to test my driver for mtd
>> compliance.After i ran "mtd_oobtest" i was messed up with test and
>> come up with few questions:
>>
>> 1) Is these tests are well validated? can i trust these tests 100%
>> compliant to MTD API specification?
>> 2) In "mtd_oobtest" ( drivers/mtd/tests/ ), there was a "test 4 of 5"
>> in this there was a few checks for writing/reading end off OOB data.
>>             - In these tests what is the significance of using
>> "ooboffs" in OOB_AUTO mode?
>> 3) Is MTD driver ask the below NAND driver to read/write the oob data
>> integral of oobavail size in OOB_AUTO mode? How MTD driver behaves if
>> it is not!!!
>> 4) Finally, can anyone please explain bit more about OOB_PLACE mode?
>> also the significance of ooboffs field usage?
>
> I do not understand your questions, and I do not quite remember these
> modes already, but the below code probably explains things well:
>
> /*
>  * oob operation modes
>  *
>  * MTD_OOB_PLACE:       oob data are placed at the given offset
>  * MTD_OOB_AUTO:        oob data are automatically placed at the free
> areas
>  *                      which are defined by the ecclayout
>  * MTD_OOB_RAW:         mode to read raw data+oob in one chunk. The oob
> data
>  *                      is inserted into the data. Thats a raw image of
> the
>  *                      flash contents.
>  */
> typedef enum {
>        MTD_OOB_PLACE,
>        MTD_OOB_AUTO,
>        MTD_OOB_RAW,
> } mtd_oob_mode_t;
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
>



-- 
Regards,
Murali N

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

* Re: Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data !
  2009-09-16 10:20   ` Murali N
@ 2009-09-16 10:50     ` Artem Bityutskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2009-09-16 10:50 UTC (permalink / raw)
  To: Murali N; +Cc: linux-mtd

On Wed, 2009-09-16 at 15:50 +0530, Murali N wrote:
> Hi Artem, can you please explain me a bit more about OOB_PLACE mode?.
> Also in mtd tests i have seen there is ooboffs field being used in
> OOB_AUTO mode.My doubt here was why AUTO mode cares about ooboffs
> field.ECC layout structure is defined clearly in the AUTO mode? am i
> correct? then what is the significance of ooboffs field?
> 
> i am not caring the ooboffs when the AUTO mode is selected in my
> driver? i was bit confused where it is mentioned in the MTD
> specification? can you please point to me if you have any info!!!

I do not remember all the glory details, but in short, OOB_PLACE is
used when you want to put your date to a specific _physical_ offset
withing the OOB. Very simple and straightforward. But I consider this
as legacy and I think no one should ever use this, and this should
be forbidden. I might be wrong, though.

OOB_AUTO is the sanest thing. Your OOB area may contain N small unused
regions of different length. E.g., see OneNAND's onenand_oob_64.
Different flashes have different layout. And OOB_AUTO is about
abstracting this, so all these small regions look like a contiguous
buffer to the applications. Size of this buffer is
mtd->ecclayout->oobavail bytes. You may write data do different offsets
of this buffer, and they will be automatically placed to corresponding
_physical_ offsets within the OOB. So applications do not care about
the OOB fragmentation, and always work with this _logical_ OOB_AUTO
buffer.

In OOB_AUTO case you cannot access the ECC bytes, because they are
hidden from you.

In OOB_PLACE you can, and I think it is a bad idea because it is not
applications' business to deal with ECCs. This should be hidden.

That's all I remember at this point. Nowadays we do not use OOB much.
E.g., UBI/UBIFS does not use it. Using OOB is bad, because modern
flashes may utilize _whole_ OOB for ECCs.

HTH.

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

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

end of thread, other threads:[~2009-09-16 10:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16  7:09 Doubt regarding mtd test ( mtd_oobtest ) interpretation of oob data ! Murali N
2009-09-16  7:23 ` Artem Bityutskiy
2009-09-16  9:36 ` Artem Bityutskiy
2009-09-16 10:20   ` Murali N
2009-09-16 10:50     ` 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.