* ECC errors on padded images
@ 2004-12-04 13:33 Jarkko Lavinen
2004-12-04 17:34 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Lavinen @ 2004-12-04 13:33 UTC (permalink / raw)
To: linux-mtd
I recently encountered ECC errors with padded JFFS2 images (mkfs.jffs2
-p) on Nand flash.
The padded pages were written into flash with a driver which uses
noninverted ECC code. Pages with all bytes either 00 or FF will
produce 00s as ECC bytes.
When JFFS2 scans such padded image, it fails to check the zero ECC
bytes of seemingly unused pages and will use them. Then the already
once written page is written again and later an ECC error is produced
upon read -- because ECC bytes remain zero.
We have now three options:
1. We couuld blame JFFS2, because it fails to check ECC bytes of
seemingly unused pages.
But should JFFS2 care if somebody produces an image that JFFS2
would never produce by itself?
JFFS2 itself won't pad erase blocks and won't write unused blank
pages. Even if writing a long node would result writing an all FF
page, JFFS2 would know in next mount from node header the page is
being used and not available for writing.
2. We could blame Mkfs.jffs2, because it is the one who produced
padded erase block. Without padding there would be no error.
3. We could blame the Ecc logic and insist that writing a blank, all
FF page will result ECC code of FFs and it would allow writing
first a blank page and then real data page.
Conceptually an unused, erased page is not the same as used,
written blank page.
Jarkko Lavinen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ECC errors on padded images
2004-12-04 13:33 ECC errors on padded images Jarkko Lavinen
@ 2004-12-04 17:34 ` Thomas Gleixner
2004-12-09 10:38 ` Artem B. Bityuckiy
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2004-12-04 17:34 UTC (permalink / raw)
To: Jarkko Lavinen; +Cc: linux-mtd
On Sat, 2004-12-04 at 15:33 +0200, Jarkko Lavinen wrote:
> I recently encountered ECC errors with padded JFFS2 images (mkfs.jffs2
> -p) on Nand flash.
>
> The padded pages were written into flash with a driver which uses
> noninverted ECC code. Pages with all bytes either 00 or FF will
> produce 00s as ECC bytes.
>
> When JFFS2 scans such padded image, it fails to check the zero ECC
> bytes of seemingly unused pages and will use them. Then the already
> once written page is written again and later an ECC error is produced
> upon read -- because ECC bytes remain zero.
>
> We have now three options:
>
> 1. We couuld blame JFFS2, because it fails to check ECC bytes of
> seemingly unused pages.
>
> But should JFFS2 care if somebody produces an image that JFFS2
> would never produce by itself?
>
> JFFS2 itself won't pad erase blocks and won't write unused blank
> pages. Even if writing a long node would result writing an all FF
> page, JFFS2 would know in next mount from node header the page is
> being used and not available for writing.
>
>
> 2. We could blame Mkfs.jffs2, because it is the one who produced
> padded erase block. Without padding there would be no error.
>
>
> 3. We could blame the Ecc logic and insist that writing a blank, all
> FF page will result ECC code of FFs and it would allow writing
> first a blank page and then real data page.
>
> Conceptually an unused, erased page is not the same as used,
> written blank page.
4. We could blame you, that you did not read the mail archive and found
the thread discussing this problem and for not using the -p=YOURPAGESIZE
option :)
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ECC errors on padded images
2004-12-04 17:34 ` Thomas Gleixner
@ 2004-12-09 10:38 ` Artem B. Bityuckiy
0 siblings, 0 replies; 3+ messages in thread
From: Artem B. Bityuckiy @ 2004-12-09 10:38 UTC (permalink / raw)
To: tglx; +Cc: linux-mtd, Jarkko Lavinen
Thomas Gleixner wrote:
> On Sat, 2004-12-04 at 15:33 +0200, Jarkko Lavinen wrote:
>
>>I recently encountered ECC errors with padded JFFS2 images (mkfs.jffs2
>>-p) on Nand flash.
>>
>>The padded pages were written into flash with a driver which uses
>>noninverted ECC code. Pages with all bytes either 00 or FF will
>>produce 00s as ECC bytes.
>>
>>When JFFS2 scans such padded image, it fails to check the zero ECC
>>bytes of seemingly unused pages and will use them. Then the already
>>once written page is written again and later an ECC error is produced
>>upon read -- because ECC bytes remain zero.
>>
>>We have now three options:
>>
>>1. We couuld blame JFFS2, because it fails to check ECC bytes of
>> seemingly unused pages.
>>
>> But should JFFS2 care if somebody produces an image that JFFS2
>> would never produce by itself?
>>
>> JFFS2 itself won't pad erase blocks and won't write unused blank
>> pages. Even if writing a long node would result writing an all FF
>> page, JFFS2 would know in next mount from node header the page is
>> being used and not available for writing.
>>
>>
>>2. We could blame Mkfs.jffs2, because it is the one who produced
>> padded erase block. Without padding there would be no error.
>>
>>
>>3. We could blame the Ecc logic and insist that writing a blank, all
>> FF page will result ECC code of FFs and it would allow writing
>> first a blank page and then real data page.
>>
>> Conceptually an unused, erased page is not the same as used,
>> written blank page.
>
>
> 4. We could blame you, that you did not read the mail archive and found
> the thread discussing this problem and for not using the -p=YOURPAGESIZE
> option :)
>
> tglx
>
Anyway, mkfs.jffs2 should print this in help, IMHO. I was confused by
this either.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-12-09 10:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-04 13:33 ECC errors on padded images Jarkko Lavinen
2004-12-04 17:34 ` Thomas Gleixner
2004-12-09 10:38 ` Artem B. Bityuckiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox