* bug in drivers/mtd/onenand/onenand_base.c?
@ 2007-03-22 9:36 Vitaly Wool
2007-03-22 10:34 ` Artem Bityutskiy
0 siblings, 1 reply; 5+ messages in thread
From: Vitaly Wool @ 2007-03-22 9:36 UTC (permalink / raw)
To: linux-mtd
Hi,
the piece of code below, though looking harmless, might cause side effects:
/**
* onenand_oob_64 - oob info for large (2KB) page
*/
static struct nand_ecclayout onenand_oob_64 = {
.eccbytes = 20,
.eccpos = {
8, 9, 10, 11, 12,
24, 25, 26, 27, 28,
40, 41, 42, 43, 44,
56, 57, 58, 59, 60,
},
.oobfree = {
{2, 3}, {14, 2}, {18, 3}, {30, 2},
{34, 3}, {46, 2}, {50, 3}, {62, 2}
}
};
The problem is, the entry of oobfree past the last valid
one should have length 0.
Here it's not the case: all the entries are occupied by
OOB chunks. Therefore, once we get into a loop like
for (free = this->ecclayout->oobfree; free->length; ++free) {
we might end up scanning past the real oobfree array.
Probably the best way out, as the same thing might happen for common NAND
as well, is to check index against MTD_MAX_OOBFREE_ENTRIES.
Comments?
Vitaly
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: bug in drivers/mtd/onenand/onenand_base.c?
2007-03-22 9:36 bug in drivers/mtd/onenand/onenand_base.c? Vitaly Wool
@ 2007-03-22 10:34 ` Artem Bityutskiy
2007-03-22 10:40 ` Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2007-03-22 10:34 UTC (permalink / raw)
To: Vitaly Wool; +Cc: linux-mtd
On Thu, 2007-03-22 at 12:36 +0300, Vitaly Wool wrote:
> The problem is, the entry of oobfree past the last valid
> one should have length 0.
>
> Here it's not the case: all the entries are occupied by
> OOB chunks. Therefore, once we get into a loop like
>
> for (free = this->ecclayout->oobfree; free->length; ++free) {
>
> we might end up scanning past the real oobfree array.
We have this fixed in OneNAND.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <46025ABF.3000100@nokia.com>]
* bug in drivers/mtd/onenand/onenand_base.c?
@ 2007-03-22 11:44 Kyungmin Park
0 siblings, 0 replies; 5+ messages in thread
From: Kyungmin Park @ 2007-03-22 11:44 UTC (permalink / raw)
To: vwool; +Cc: linux-mtd
Hi Vitaly Wool,
Sorry, I'm not office so I can't access my computer.
To help your work I send the URL related this problem.
This problem is reported previous time but not commit it.
Please check this mail. It would help your work.
http://linux.omap.com/pipermail/linux-omap-open-source/2007-March/009395.htm
l
I saw your mtd git tree related with yaffs. I tested the yaffs on onenand
before. But as you know it failed.
Now with your patch how many bytes are needed in yaffs if ecc provided?
Maybe we need to modify onenand read & write function to support read/write
with oob simultaneously.
Currently it only supports separated read or oob function only, instead of
both.
If the yaffs requires less or equal with 20 bytes, it will work with
OneNAND. Of course, if the page is 1KB, it can't. Since it has only 10 bytes
OOB.
I hope yaffs can run with OneNAND.
Thank you,
Kyungmin Park
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-03-22 11:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-22 9:36 bug in drivers/mtd/onenand/onenand_base.c? Vitaly Wool
2007-03-22 10:34 ` Artem Bityutskiy
2007-03-22 10:40 ` Adrian Hunter
[not found] <46025ABF.3000100@nokia.com>
2007-03-22 10:40 ` Vitaly Wool
-- strict thread matches above, loose matches on Subject: below --
2007-03-22 11:44 Kyungmin Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox