Skip to contentSkip to conversation

MTD: Add nand_ecc test module

PATCH In review Akinobu Mita 3 participants 6 messages Oct 21, 2009 – Oct 22, 2009 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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

Cc David Woodhouse <[email protected]>
Cc Artem Bityutskiy <[email protected]>
Cc vimal singh <[email protected]>
---
 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
index 919d066..8371b60 100644
@@ -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
#1 lore raw
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 correct error_data
4. Compare data and error_data

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 (Артём Битюцкий)
#2 lore raw
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 correct error_data
4. Compare data and error_data

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 (Артём Битюцкий)

#3 lore raw
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 (Артём Битюцкий)
#4 lore raw
In reply to 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 correct error_data
4. Compare data and error_data

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?

#5 lore raw
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 correct error_data
4. Compare data and error_data

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' ?

Quoted 8 lines

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?

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 (Артём Битюцкий)