<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/mtd/tests/oobtest.c, branch v4.10</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>mtd: kill the ecclayout-&gt;oobavail field</title>
<updated>2016-03-08T00:23:09+00:00</updated>
<author>
<name>Boris BREZILLON</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-03-07T09:46:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f5b8aa78ef086248145363bf1ffe5ca4348b6a98'/>
<id>f5b8aa78ef086248145363bf1ffe5ca4348b6a98</id>
<content type='text'>
ecclayout-&gt;oobavail is just redundant with the mtd-&gt;oobavail field.
Moreover, it prevents static const definition of ecc layouts since the
NAND framework is calculating this value based on the ecclayout-&gt;oobfree
field.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ecclayout-&gt;oobavail is just redundant with the mtd-&gt;oobavail field.
Moreover, it prevents static const definition of ecc layouts since the
NAND framework is calculating this value based on the ecclayout-&gt;oobfree
field.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mtd_oobtest: Fix the address offset with vary_offset case</title>
<updated>2015-08-27T23:30:01+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2015-07-08T11:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=718e38b4d96085b4dab08d3d32e5e033aa1ba6e9'/>
<id>718e38b4d96085b4dab08d3d32e5e033aa1ba6e9</id>
<content type='text'>
When vary_offset is set (e.g. test case 3), the offset is not always
zero so memcmpshow() will show the wrong offset in the print message.
To fix this we introduce a new function memcmpshowoffset() which takes
offset as a parameter and displays the right offset and use it in
the case where offset is non zero.

The old memcmpshow() functionality is preserved by converting it into
a macro with offset preset to 0.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When vary_offset is set (e.g. test case 3), the offset is not always
zero so memcmpshow() will show the wrong offset in the print message.
To fix this we introduce a new function memcmpshowoffset() which takes
offset as a parameter and displays the right offset and use it in
the case where offset is non zero.

The old memcmpshow() functionality is preserved by converting it into
a macro with offset preset to 0.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Make MTD tests cancelable</title>
<updated>2015-04-06T01:12:53+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2015-03-29T19:52:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a6a28e7922c07c116ba8f2aa3682c03ef8be678'/>
<id>2a6a28e7922c07c116ba8f2aa3682c03ef8be678</id>
<content type='text'>
I always go nuts when I start an MTD test on a slow device and have to
wait forever until it finishes. From the debug output I already know
what the issue is but I have to wait or reset the board hard. Resetting
is often not an option (remote access, you don't want lose the current
state, etc...).

The solution is easy, check for pending signals at key positions in the
code. Using that one can even stop a test by pressing CTRL-C as
insmod/modprobe have SIGINT pending.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I always go nuts when I start an MTD test on a slow device and have to
wait forever until it finishes. From the debug output I already know
what the issue is but I have to wait or reset the board hard. Resetting
is often not an option (remote access, you don't want lose the current
state, etc...).

The solution is easy, check for pending signals at key positions in the
code. Using that one can even stop a test by pressing CTRL-C as
insmod/modprobe have SIGINT pending.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mtd_oobtest: Fix bitflip_limit usage in test case 3</title>
<updated>2015-04-06T01:10:23+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2014-12-05T15:18:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2b51c808745ca93c020ba34a3cf256ad52adc63'/>
<id>d2b51c808745ca93c020ba34a3cf256ad52adc63</id>
<content type='text'>
In test case 3, we set vary_offset to write at different
offsets and lengths in the OOB available area. We need to
do the bitflip_limit check while checking for 0xff outside the
OOB offset + length area that we didn't modify during write.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
[Brian: whitespace fixup]
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In test case 3, we set vary_offset to write at different
offsets and lengths in the OOB available area. We need to
do the bitflip_limit check while checking for 0xff outside the
OOB offset + length area that we didn't modify during write.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
[Brian: whitespace fixup]
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: tests: fix more potential integer overflows</title>
<updated>2015-03-11T22:21:47+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2015-02-28T10:02:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b9da8bae416efda5ad61c7c92edbb30de15ff7ee'/>
<id>b9da8bae416efda5ad61c7c92edbb30de15ff7ee</id>
<content type='text'>
Caught by Coverity (CID #200625 and others)

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Caught by Coverity (CID #200625 and others)

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: oobtest: correct printf() format specifier for 'size_t'</title>
<updated>2014-11-20T09:26:51+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2014-11-20T09:26:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=806b6ef5676a1c6ea78592174aae15f59bb0a923'/>
<id>806b6ef5676a1c6ea78592174aae15f59bb0a923</id>
<content type='text'>
Fixes warning:

   drivers/mtd/tests/oobtest.c: In function 'memcmpshow':
   drivers/mtd/tests/oobtest.c:129: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Roger Quadros &lt;rogerq@ti.com&gt;
Cc: Sekhar Nori &lt;nsekhar@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes warning:

   drivers/mtd/tests/oobtest.c: In function 'memcmpshow':
   drivers/mtd/tests/oobtest.c:129: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Roger Quadros &lt;rogerq@ti.com&gt;
Cc: Sekhar Nori &lt;nsekhar@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mtd_oobtest: add bitflip_limit parameter</title>
<updated>2014-11-20T07:25:49+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2014-10-21T13:53:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=afc0ea1b8e1e27b2cb77e7023d917f3aa5971d17'/>
<id>afc0ea1b8e1e27b2cb77e7023d917f3aa5971d17</id>
<content type='text'>
It is common for NAND devices to have bitflip errors.
Add a bitflip_limit parameter to specify how many bitflips per
page we can tolerate without flagging an error.
By default zero bitflips are tolerated.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is common for NAND devices to have bitflip errors.
Add a bitflip_limit parameter to specify how many bitflips per
page we can tolerate without flagging an error.
By default zero bitflips are tolerated.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mtd_oobtest: Show the verification error location and data</title>
<updated>2014-11-20T07:25:06+00:00</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2014-10-21T13:53:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a66088bffd9a5251e96ca5d0d46456ab9196287'/>
<id>5a66088bffd9a5251e96ca5d0d46456ab9196287</id>
<content type='text'>
Add a function memcmpshow() that compares the 2 data buffers
and shows the address:offset and data bytes on comparison failure.
This function  does not break at a comparison failure but runs the
check for the whole data buffer.

Use memcmpshow() instead of memcmp() for all the verification paths.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function memcmpshow() that compares the 2 data buffers
and shows the address:offset and data bytes on comparison failure.
This function  does not break at a comparison failure but runs the
check for the whole data buffer.

Use memcmpshow() instead of memcmp() for all the verification paths.

Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: tests: fix integer overflow issues</title>
<updated>2014-08-19T18:53:08+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2014-07-22T02:07:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1001ff7a4f64f3f4264e69d3ed70ff428f627e01'/>
<id>1001ff7a4f64f3f4264e69d3ed70ff428f627e01</id>
<content type='text'>
These multiplications are done with 32-bit arithmetic, then converted to
64-bit. We should widen the integers first to prevent overflow. This
could be a problem for large (&gt;4GB) MTD's.

Detected by Coverity.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These multiplications are done with 32-bit arithmetic, then converted to
64-bit. We should widen the integers first to prevent overflow. This
could be a problem for large (&gt;4GB) MTD's.

Detected by Coverity.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mtd_oobtest: generate consistent data for verification</title>
<updated>2014-04-18T05:22:03+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2014-03-07T15:24:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be54f8f1c76890f4b6163715aed5a3d0a7309dc2'/>
<id>be54f8f1c76890f4b6163715aed5a3d0a7309dc2</id>
<content type='text'>
mtd_oobtest writes OOB, read it back and verify.  The verification is
not correctly done if oobsize is not multiple of 4.  Although the data
to be written and the data to be compared are generated by several
prandom_byte_state() calls starting with the same seed, these two are
generated with the different size and different number of calls.

Due to the implementation of prandom_byte_state() if the size on each
call is not multiple of 4, the resulting data is not always same.

This fixes it by just calling prandom_byte_state() once and using
correct range instead of calling it multiple times for each.

Reported-by: George Cherian &lt;george.cherian@ti.com&gt;
Reported-by: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Tested-by: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Cc: George Cherian &lt;george.cherian@ti.com&gt;
Cc: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mtd_oobtest writes OOB, read it back and verify.  The verification is
not correctly done if oobsize is not multiple of 4.  Although the data
to be written and the data to be compared are generated by several
prandom_byte_state() calls starting with the same seed, these two are
generated with the different size and different number of calls.

Due to the implementation of prandom_byte_state() if the size on each
call is not multiple of 4, the resulting data is not always same.

This fixes it by just calling prandom_byte_state() once and using
correct range instead of calling it multiple times for each.

Reported-by: George Cherian &lt;george.cherian@ti.com&gt;
Reported-by: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Tested-by: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Cc: George Cherian &lt;george.cherian@ti.com&gt;
Cc: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
