[prev in list] [next in list] [prev in thread] [next in thread] 

List:       yaffs
Subject:    [Yaffs] unintended hw ECC correction when yaffs_check_chunk_erased() is invoked when all oob data as
From:       "Pham, Phong" <phamp () ddc-web ! com>
Date:       2019-02-08 0:13:40
Message-ID: C2EC5BA46D13CD44B5915A8FEEB4C44EE55D1C3A () DDCEXCH ! ddc-ny ! com
[Download RAW message or body]

Hi,

In yaffs_rd_chunk_tags_nand() invoked by yaffs_check_chunk_erased(), there is an \
implicit raw read of data and user spare area (oob data excluding ECC data).  \
However, in yaffs_tags_marshall_read() [with valid tags input], a yaffs_mtd_read() is \
invoked with ops.mode = MTD_OPS_AUTO_OOB unconditionally.  (ops.mode should be \
conditional between MTD_OPS_RAW and MTD_OPS_AUTO_OOB).  The reason I said an \
"implicit raw read" is because for NAND Flash controller that has ECC implemented in \
hw, a typical nand_ecc_ctrl.read_page() implementation will have its page size data \
corrected by ECC.  However, in the scenario when yaffs_check_chunk_erased() is \
invoked, a yaffs_check_ff() is performed afterward which checks for all data in the \
page is 1.  Unfortunately, the initial condition of a given page + spare area \
(including ECC data) is all 1's leads to Flash controller (hw) correcting data in \
page (with invalid ECCs) and thus yield some data bits in the page not be 1's.

I feel the proper implementation should be nand_ecc_ctrl.read_page_raw() should be \
invoked (instead of nand_ecc_ctrl.read_page()) and in order to achieve that result, \
ops.mode needs to be MTD_OPS_RAW.

Phong.

Notice: This e-mail and any files transmitted with it may contain Data Device \
Corporation's and its subsidiaries privileged and proprietary information. It is \
intended solely for the use of the individual or entity to whom it is addressed. If \
you are not the named recipient of this transmission, any disclosure, copying, \
distribution or reliance on the contents of this message is prohibited. If you \
received this e-mail in error, please destroy it and any attached files and notify me \
immediately.

Click Here<http://www.ddc-web.com/Profile/EmailPrivacy.aspx> to view our privacy \
statement.


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
	{font-family:SimSun}
@font-face
	{font-family:SimSun}
@font-face
	{font-family:Calibri}
@font-face
	{}
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline}
span.EmailStyle17
	{font-family:"Calibri","sans-serif";
	color:windowtext}
.MsoChpDefault
	{}
@page WordSection1
	{margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
	{}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">In yaffs_rd_chunk_tags_nand() invoked by \
yaffs_check_chunk_erased(), there is an implicit raw read of data and user spare area \
(oob data excluding ECC data).&nbsp; However, in yaffs_tags_marshall_read() [with \
valid tags input], a yaffs_mtd_read()  is invoked with ops.mode = MTD_OPS_AUTO_OOB \
unconditionally.&nbsp; (ops.mode should be conditional between MTD_OPS_RAW and \
MTD_OPS_AUTO_OOB).&nbsp; The reason I said an &#8220;implicit raw read&#8221; is \
because for NAND Flash controller that has ECC implemented in hw, a typical  \
nand_ecc_ctrl.read_page() implementation will have its page size data corrected by \
ECC. &nbsp;However, in the scenario when yaffs_check_chunk_erased() is invoked, a \
yaffs_check_ff() is performed afterward which checks for all data in the page is \
1.&nbsp; Unfortunately,  the initial condition of a given page &#43; spare area \
(including ECC data) is all 1&#8217;s leads to Flash controller (hw) correcting data \
in page (with invalid ECCs) and thus yield some data bits in the page not be \
1&#8217;s.</p> <p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I feel the proper implementation should be \
nand_ecc_ctrl.read_page_raw() should be invoked (instead of \
nand_ecc_ctrl.read_page()) and in order to achieve that result, ops.mode needs to be \
MTD_OPS_RAW.</p> <p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Phong.</p>
</div>
<h5><font color="gray">
<p>Notice: This e-mail and any files transmitted with it may contain Data Device \
Corporation's and its subsidiaries privileged and proprietary information. It is \
intended solely for the use of the individual or entity to whom it is addressed. If \
you are not  the named recipient of this transmission, any disclosure, copying, \
distribution or reliance on the contents of this message is prohibited. If you \
received this e-mail in error, please destroy it and any attached files and notify me \
immediately.</p> <p><a href="http://www.ddc-web.com/Profile/EmailPrivacy.aspx">Click \
Here</a> to view our privacy statement.</p> <h5></h5>
</font></h5>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
yaffs mailing list
yaffs@stoneboat.aleph1.co.uk
http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic