Skip to contentSkip to conversation

fix small nand_base errors

PATCH In review Vitaly Wool 2 participants 3 messages Jul 10, 2006 – Sep 14, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix small nand_base errors

Hi Thomas,

please find the patch that fixes small nand_base errors inlined.
Brief explanation: for nand_write_oob_syndrome, you should first set the position to eccsize, as OOB starts past the eccsize, not eccsize + chunk. For nand_fill_oob I guess that's just a typo, otherwise it just doesn't make sense (and OTOH makes this routine write to 0-th OOB byte thus actually marking it as bad).

Best regards,
Vitaly

drivers/mtd/nand/nand_base.c +2 -2
index 62b8613..faabca2 100644
@@ -1203,7 +1203,7 @@ static int nand_write_oob_syndrome(struc
 		pos = steps * (eccsize + chunk);
 		steps = 0;
 	} else
-		pos = eccsize + chunk;
+		pos = eccsize;
 
 	chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
 	for (i = 0; i < steps; i++) {
@@ -1566,7 +1566,7 @@ static uint8_t *nand_fill_oob(struct nan
 				bytes = min_t(size_t, len, free->length);
 				boffs = free->offset;
 			}
-			memcpy(chip->oob_poi + woffs, oob, bytes);
+			memcpy(chip->oob_poi + boffs, oob, bytes);
 			oob += bytes;
 		}
 		return oob;
#1 lore raw

Thomas,

Quoted 6 lines · Vitaly Wool

Hi Thomas,

please find the patch that fixes small nand_base errors inlined.
Brief explanation: for nand_write_oob_syndrome, you should first set the position to eccsize, as OOB starts past the eccsize, not eccsize + chunk. For nand_fill_oob I guess that's just a typo, otherwise it just doesn't make sense (and OTOH makes this routine write to 0-th OOB byte thus actually marking it as bad).

Can't see this patch applied, which makes NAND base fail for me.

Vitaly

#2 lore raw
Quoted 13 lines

Thomas,

Quoted 10 lines · Vitaly Wool

Hi Thomas,

please find the patch that fixes small nand_base errors inlined. Brief explanation: for nand_write_oob_syndrome, you should first set the position to eccsize, as OOB starts past the eccsize, not eccsize + chunk.
For nand_fill_oob I guess that's just a typo, otherwise it just doesn't make sense (and OTOH makes this routine write to 0-th OOB byte thus actually marking it as bad).

Quoted 1 line

Can't see this patch applied, which makes NAND base fail for me.

Blame dwmw2. It's in my git tree since 2 month

http://git.infradead.org/?p=users/gleixner/mtd-nand-2.6.git;a=commit;h=8b0036eefd7a96f23244b969417684c8627f5ad6

tglx