Subject: Re: [PATCH 1/1] Fix ECC Correction bug for SMC ordering for NDFC driver.

From: Stefan Roese <[email-masked]>
Date: Fri, 21 Aug 2009 10:02:15 +0200

On Friday 21 August 2009 02:19:17 Feng Kan wrote:
> Fix ECC Correction bug where the byte offset location were double
> fliped causing correction routine to toggle the wrong byte location
> in the ECC segment. The ndfc_calculate_ecc routine change the order
> of getting the ECC code.
>         /* The NDFC uses Smart Media (SMC) bytes order */
>         ecc_code[0] = p[2];
>         ecc_code[1] = p[1];
>         ecc_code[2] = p[3];
> But in the Correction algorithm when calculating the byte offset
> location, the b1 is used as the upper part of the address. Which
> again reverse the order making the final byte offset address
> location incorrect.
> 	byte_addr = (addressbits[b1] << 4) + addressbits[b0];
> The order is change to read it in straight and let the correction
> function to revert it to SMC order.
>
> Signed-off-by: Feng Kan <[email-masked]>
> Acked-by: Victor Gallardo <[email-masked]>
> Acked-by: Prodyut Hazarika <[email-masked]>

Acked-by: Stefan Roese <[email-masked]>

Would be great if we could get this fix into 2.6.31.

Cheers,
Stefan