public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: <dwmw2@infradead.org>
Cc: Huang Shijie <b32955@freescale.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	dedekind1@gmail.com
Subject: [PATCH 1/2] mtd: torturetest: rewrite the erase-write-verify process into one block unit.
Date: Tue, 5 Feb 2013 10:20:19 +0800	[thread overview]
Message-ID: <1360030820-21491-1-git-send-email-b32955@freescale.com> (raw)

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

             reply	other threads:[~2013-02-05  3:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05  2:20 Huang Shijie [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360030820-21491-1-git-send-email-b32955@freescale.com \
    --to=b32955@freescale.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox