From: Akinobu Mita <akinobu.mita@gmail.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] MTD: Add nand_ecc test module
Date: Tue, 13 Oct 2009 18:58:36 +0900 [thread overview]
Message-ID: <20091013095836.GA3166@localhost.localdomain> (raw)
In-Reply-To: <1255268381.16942.74.camel@localhost>
On Sun, Oct 11, 2009 at 04:39:41PM +0300, Artem Bityutskiy wrote:
> On Fri, 2009-10-09 at 18:54 +0900, Akinobu Mita wrote:
> > This module tests NAND ECC functions.
> >
> > The test is simple.
> >
> > 1. Create a 256 or 512 bytes block of data filled with random bytes (data)
> > 2. Duplicate the data block and inject single bit error (error_data)
> > 3. Try to correct error_data
> > 4. Compare data and error_data
>
> So you want to test the built-in 256/512 software ECC calculation
> and correction functions?
Yes.
> > If the test fails, this creates create these files in debugfs:
> >
> > /sys/kernel/debug/nand-ecc-test-crashers/
> >
> > <testname>
> > <testname>-error
> >
> > <testname> contains data
> > <testname>-error contains error_data
>
> Why you need these files? This looks like overkill. Please, remove
> them.
OK. I'll remove them and just do hexdump() if the test fails.
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Cc: linux-mtd@lists.infradead.org
> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> > ---
> > drivers/mtd/nand/nand_ecc.c | 25 ++++-
> > drivers/mtd/tests/Makefile | 1 +
> > drivers/mtd/tests/nand_ecc-test.c | 200 +++++++++++++++++++++++++++++++++++++
> > include/linux/mtd/nand_ecc.h | 6 +
> > 4 files changed, 227 insertions(+), 5 deletions(-)
> > create mode 100644 drivers/mtd/tests/nand_ecc-test.c
>
> Could you please split this on 2 patches - one is changing the generic
> code, one is the test itself.
OK.
...
> > +static void unregister_ecc_test_crasher(struct ecc_test_crasher *crasher)
> > +{
> > + list_del(&crasher->list);
> > +
> > + remove_ecc_test_blob(crasher->error_data);
> > + remove_ecc_test_blob(crasher->data);
> > + kfree(crasher);
> > +}
> > +
> > +#if defined(CONFIG_MTD_NAND) || defined(CONFIG_MTD_NAND_MODULE)
>
> This should not be needed. MTD tests are always compiled as modules,
> so you should not have copilation errors. And if MTD NAND support is
> not present, modprobe will just fail.
nand_calculate_ecc and nand_correct_data needs CONFIG_MTD_NAND=y|m,
otherwise it will get link error:
ERROR: "__nand_correct_data" [drivers/mtd/tests/nand_ecc-test.ko] undefined!
ERROR: "__nand_calculate_ecc" [drivers/mtd/tests/nand_ecc-test.ko] undefined!
next prev parent reply other threads:[~2009-10-13 9:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 9:54 [PATCH] MTD: Add nand_ecc test module Akinobu Mita
2009-10-11 13:39 ` Artem Bityutskiy
2009-10-13 9:58 ` Akinobu Mita [this message]
2009-10-14 15:41 ` Artem Bityutskiy
2009-10-15 5:05 ` vimal singh
2009-10-15 6:36 ` Artem Bityutskiy
2009-10-15 6:42 ` vimal singh
2009-10-15 6:50 ` Artem Bityutskiy
2009-10-15 8:53 ` vimal singh
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=20091013095836.GA3166@localhost.localdomain \
--to=akinobu.mita@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.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;
as well as URLs for NNTP newsgroup(s).