MTD: Add nand_ecc test module
PATCH 3/3 MTD: Add nand_ecc test module
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
--- drivers/mtd/tests/Makefile | 1 + drivers/mtd/tests/nand_ecc-test.c | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/tests/nand_ecc-test.c
drivers/mtd/tests/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o obj-$(CONFIG_MTD_NAND_TESTS) += mtd_oobtest.o obj-$(CONFIG_MTD_NAND_TESTS) += mtd_pagetest.o obj-$(CONFIG_MTD_NAND_TESTS) += mtd_subpagetest.o +obj-$(CONFIG_MTD_NAND_TESTS) += nand_ecc-test.o
drivers/mtd/tests/nand_ecc-test.c new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
1.5.4.3
Quoted 14 lines · Akinobu Mita
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 correcterror_data
4. Compare data anderror_dataSigned-off-by Akinobu Mita <[email protected]>Cc David Woodhouse <[email protected]>Cc Artem Bityutskiy <[email protected]>Cc vimal singh <[email protected]>
Quoted 5 lines
--- drivers/mtd/tests/Makefile | 1 + drivers/mtd/tests/nand_ecc-test.c | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/tests/nand_ecc-test.c
How about a consistent name for the test? All current tests have 'mtd_' prefix. How about make the file to be 'mtd_ecctest.c' ?
Also, since you anyway need to use these "#defines", I think there is not need to use this splitting. I apologize for leading you that way at the beginning.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Quoted 21 lines · Artem Bityutskiy
Quoted 14 lines · Akinobu Mita
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 correcterror_data
4. Compare data anderror_dataSigned-off-by Akinobu Mita <[email protected]>Cc David Woodhouse <[email protected]>Cc Artem Bityutskiy <[email protected]>Cc vimal singh <[email protected]>Quoted 5 lines
---
drivers/mtd/tests/Makefile | 1 +drivers/mtd/tests/nand_ecc-test.c| 87 +++++++++++++++++++++++++++++++++++++2 files changed, 88 insertions(+), 0 deletions(-)create mode 100644
drivers/mtd/tests/nand_ecc-test.c
Quoted 2 lines
How about a consistent name for the test? All current tests have '
mtd_' prefix. How about make the file to be 'mtd_ecctest.c' ?
Or 'mtd_nandecctest.c'..? Since, anyways, this test is only for nand.
Signature · 2 lines
Regards, Vimal Singh
Quoted 10 lines
Also, since you anyway need to use these "#defines", I think there is not need to use this splitting. I apologize for leading you that way at the beginning.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
Quoted 4 lines · vimal singh
Quoted 2 lines
How about a consistent name for the test? All current tests have '
mtd_' prefix. How about make the file to be 'mtd_ecctest.c' ?Or '
mtd_nandecctest.c'..? Since, anyways, this test is only for nand.
Fair enough.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Quoted 21 lines · Artem Bityutskiy
Quoted 14 lines · Akinobu Mita
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 correcterror_data
4. Compare data anderror_dataSigned-off-by Akinobu Mita <[email protected]>Cc David Woodhouse <[email protected]>Cc Artem Bityutskiy <[email protected]>Cc vimal singh <[email protected]>Quoted 5 lines
--- drivers/mtd/tests/Makefile | 1 + drivers/mtd/tests/nand_ecc-test.c | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/tests/nand_ecc-test.c
Quoted 2 lines
How about a consistent name for the test? All current tests have '
mtd_' prefix. How about make the file to be 'mtd_ecctest.c' ?
OK. I'll rename to mtd_nandecctest.c as vimal said.
Quoted 3 lines
Also, since you anyway need to use these "#defines", I think there is not need to use this splitting. I apologize for leading you that way at the beginning.
Does it mean we don't need MTD_NAND_TESTS and the new mtd_nandecctest should exist in MTD_TESTS with that #ifdef checks as I originally did?
Quoted 25 lines · ext Akinobu Mita
Quoted 21 lines · Artem Bityutskiy
Quoted 14 lines · Akinobu Mita
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 correcterror_data
4. Compare data anderror_dataSigned-off-by Akinobu Mita <[email protected]>Cc David Woodhouse <[email protected]>Cc Artem Bityutskiy <[email protected]>Cc vimal singh <[email protected]>Quoted 5 lines
--- drivers/mtd/tests/Makefile | 1 + drivers/mtd/tests/nand_ecc-test.c | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/tests/nand_ecc-test.cQuoted 2 lines
How about a consistent name for the test? All current tests have '
mtd_' prefix. How about make the file to be 'mtd_ecctest.c' ?
Quoted 8 lines
OK. I'll rename to
mtd_nandecctest.cas vimal said.Quoted 3 lines
Also, since you anyway need to use these "#defines", I think there is not need to use this splitting. I apologize for leading you that way at the beginning.
Does it mean we don't need
MTD_NAND_TESTSand the newmtd_nandecctestshould exist inMTD_TESTSwith that #ifdef checks as I originally did?
Right. The idea was to avoid the ifdefs by cheap price, but now it seems that was bad idea.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)