nand_ecc error in byte order?

Charles Manning manningc2 at actrix.gen.nz
Mon Apr 21 03:58:36 EDT 2003


I've been dabbling with ECCs a bit today and discovered something that looks 
to me like an error in nand_ecc.c.

I think I recall someone mentioning this before, but could not find an email 
to this effect.

The code implements the parity generation/correction algorithms used for 
SmartMedia. However, unless I got it wrong, the byte ordering of the ecc_code 
array is not the same as used in SmartMedia.

In SmartMedia (according to specs and code from Samsung), the byte ordering 
is:

byte 0: low byte of line parity.
byte1: high byte of line parity
byte2:column parity

nand_ecc.c seems to me to generate:
byte 0: high byte of line parity.
byte1: low byte of line parity
byte2:column parity

Clearly this is not a problem if the same ECC generator gets used all the 
time. However, it will be a problem if they are mixed.

Assuming I'm not seeing ghosts, and this is a real problem, do we fix the 
problem (to be consistent with SmartMedia) or retain the status quo (to not 
break legacy mtd)?

-- Charles



More information about the linux-mtd mailing list