public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: torturetest: rewrite the erase-write-verify process into one block unit.
@ 2013-02-05  2:20 Huang Shijie
  2013-02-05  2:20 ` [PATCH 2/2] mtd: torturetest: add the support for random data pattern Huang Shijie
  0 siblings, 1 reply; 15+ messages in thread
From: Huang Shijie @ 2013-02-05  2:20 UTC (permalink / raw)
  To: dwmw2; +Cc: Huang Shijie, linux-mtd, linux-kernel, dedekind1

Rewrite the torture cycle, do the erase-write-verify process in
one block unit, not in several blocks unit.

This patch makes preparations for adding the rand data pattern support.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/tests/mtd_torturetest.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index c4cde1e..516cf66 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -313,21 +313,18 @@ static int __init tort_init(void)
 		int i;
 		void *patt;
 
-		/* Erase all eraseblocks */
 		for (i = eb; i < eb + ebcnt; i++) {
 			if (bad_ebs[i - eb])
 				continue;
+
+			/* Erase all eraseblocks */
 			err = erase_eraseblock(i);
 			if (err)
 				goto out;
 			cond_resched();
-		}
 
-		/* Check if the eraseblocks contain only 0xFF bytes */
-		if (check) {
-			for (i = eb; i < eb + ebcnt; i++) {
-				if (bad_ebs[i - eb])
-					continue;
+			/* Check if the eraseblocks contain only 0xFF bytes */
+			if (check) {
 				err = check_eraseblock(i, patt_FF);
 				if (err) {
 					pr_info("verify failed"
@@ -336,12 +333,8 @@ static int __init tort_init(void)
 				}
 				cond_resched();
 			}
-		}
 
-		/* Write the pattern */
-		for (i = eb; i < eb + ebcnt; i++) {
-			if (bad_ebs[i - eb])
-				continue;
+			/* Write the pattern */
 			if ((eb + erase_cycles) & 1)
 				patt = patt_5A5;
 			else
@@ -350,17 +343,9 @@ static int __init tort_init(void)
 			if (err)
 				goto out;
 			cond_resched();
-		}
 
-		/* Verify what we wrote */
-		if (check) {
-			for (i = eb; i < eb + ebcnt; i++) {
-				if (bad_ebs[i - eb])
-					continue;
-				if ((eb + erase_cycles) & 1)
-					patt = patt_5A5;
-				else
-					patt = patt_A5A;
+			/* Verify what we wrote */
+			if (check) {
 				err = check_eraseblock(i, patt);
 				if (err) {
 					pr_info("verify failed for %s"
-- 
1.7.0.4

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

end of thread, other threads:[~2013-03-04  2:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05  2:20 [PATCH 1/2] mtd: torturetest: rewrite the erase-write-verify process into one block unit Huang Shijie
2013-02-05  2:20 ` [PATCH 2/2] mtd: torturetest: add the support for random data pattern Huang Shijie
2013-02-05  8:05   ` Ricard Wanderlof
2013-02-05  8:21     ` [PATCH v2] " Huang Shijie
2013-02-05  9:48       ` Ricard Wanderlof
2013-02-05 10:01         ` Huang Shijie
2013-02-13 10:37       ` Artem Bityutskiy
2013-02-16  4:00         ` Huang Shijie
2013-03-02 14:44           ` Artem Bityutskiy
2013-03-04  2:29             ` Huang Shijie
2013-02-05  8:21     ` [PATCH 2/2] " Huang Shijie
2013-02-05  8:30     ` [PATCH V3] " Huang Shijie
2013-02-05  9:06       ` [PATCH v4] " Huang Shijie
2013-02-13 11:26         ` Ezequiel Garcia
2013-02-16  4:01           ` Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox