提交 96da9606 编写于 作者: V Vitaly Wool 提交者: Linus Torvalds

[PATCH] MTD NAND: OOB buffer offset fixups

In the case of data-pad-ecc-pad-data...  layout the oob start position has
to be sizeof(data) in nand_write_oob_syndrom().

In nand_fill_oob() we need to copy to buf + buffer offset instead of buf +
write offset.
Signed-off-by: NVitaly Wool <vwool@ru.mvista.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 20acaa18
...@@ -1204,7 +1204,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd, ...@@ -1204,7 +1204,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
pos = steps * (eccsize + chunk); pos = steps * (eccsize + chunk);
steps = 0; steps = 0;
} else } else
pos = eccsize + chunk; pos = eccsize;
chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
for (i = 0; i < steps; i++) { for (i = 0; i < steps; i++) {
...@@ -1567,7 +1567,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, ...@@ -1567,7 +1567,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
bytes = min_t(size_t, len, free->length); bytes = min_t(size_t, len, free->length);
boffs = free->offset; boffs = free->offset;
} }
memcpy(chip->oob_poi + woffs, oob, bytes); memcpy(chip->oob_poi + boffs, oob, bytes);
oob += bytes; oob += bytes;
} }
return oob; return oob;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册