Fix mtdblock / mtdpart / mtdconcat
PATCH 1/1 Fix mtdblock / mtdpart / mtdconcat
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
There is probably a better fix, but that's for someone else to find.
drivers/mtd/mtdpart.c +8 -8
@@ -55,12 +55,12 @@ len =0 ; else if (from + len > mtd->size) len = mtd->size - from; -if (part->master->read_ecc ==NULL ) +// if (part->master->read_ecc == NULL) return part->master->read (part->master, from + part->offset, len, retlen, buf); -else -return part->master->read_ecc (part->master, from + part->offset, - len, retlen, buf,NULL , &mtd->oobinfo); +// else +// return part->master->read_ecc (part->master, from + part->offset, +// len, retlen, buf, NULL, &mtd->oobinfo); } static int part_point (struct mtd_info *mtd, loff_t from, size_t len,
@@ -134,12 +134,12 @@ len =0 ; else if (to + len > mtd->size) len = mtd->size - to; -if (part->master->write_ecc ==NULL ) +// if (part->master->write_ecc == NULL) return part->master->write (part->master, to + part->offset, len, retlen, buf); -else -return part->master->write_ecc (part->master, to + part->offset, - len, retlen, buf,NULL , &mtd->oobinfo); +// else +// return part->master->write_ecc (part->master, to + part->offset, +// len, retlen, buf, NULL, &mtd->oobinfo); }
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 2 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
Please define "doesn't work".
Signature · 1 line
dwmw2
Quoted 5 lines · David Woodhouse
Quoted 2 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
Please define "doesn't work".
Remember those errors I reported to you last night? That "doesn't work".
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 8 lines · Russell King
Quoted 5 lines · David Woodhouse
Quoted 2 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
Please define "doesn't work".
Remember those errors I reported to you last night? That "doesn't work".
/me reads the scrollback.... oh, I see.
You'd do better to disable it in mtdconcat not mtdpart.
Signature · 1 line
dwmw2
Quoted 6 lines · David Woodhouse
Quoted 5 lines · Russell King
Quoted 4 lines · David Woodhouse
Quoted 2 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Please define "doesn't work".
Remember those errors I reported to you last night? That "doesn't work".
/me reads the scrollback.... oh, I see.
You'd do better to disable it in mtdconcat not mtdpart.
As I said in the original mail, its a quick and dirty hack. I have little interest in finding a better solution at present - I have more pressing things that need my attention at present.
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 4 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
There is probably a better fix, but that's for someone else to find.
I had to run 'indent' on mtdconcat.c before I could stand to even look for it, so I haven't attached the patch here -- but could you try v1.6 from CVS, which should refrain from pretending to have ecc/oob access functions of none of the subdevices have them, and hence fix the problem you observed.
Signature · 1 line
dwmw2
Quoted 11 lines · David Woodhouse
Quoted 4 lines · Russell King
Dirtily disable ECC support; it doesn't work when mtdpart is layered on top of mtdconcat on top of CFI flash.
There is probably a better fix, but that's for someone else to find.
I had to run 'indent' on
mtdconcat.cbefore I could stand to even look for it, so I haven't attached the patch here -- but could you try v1.6 from CVS, which should refrain from pretending to have ecc/oob access functions of none of the subdevices have them, and hence fix the problem you observed.
While looking over the changes between 1.5 and 1.6, I spotted this. You may want to fix this change:
- concat->mtd.eccsize != subdev[i]->eccsize) {
+ concat->mtd.eccsize != subdev[i]->eccsize ||
+ !concat->mtd.read_ecc != !concat->mtd.read_ecc ||
+ !concat->mtd.write_ecc != !concat->mtd.write_ecc ||
+ !concat->mtd.read_oob != !concat->mtd.read_oob ||
+ !concat->mtd.write_oob != !concat->mtd.write_oob) {Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Review
Quoted 9 lines · Russell King
While looking over the changes between 1.5 and 1.6, I spotted this. You may want to fix this change:
(quoted diff) +5
-1- concat->mtd.eccsize != subdev[i]->eccsize) { + concat->mtd.eccsize != subdev[i]->eccsize || + !concat->mtd.read_ecc != !concat->mtd.read_ecc || + !concat->mtd.write_ecc != !concat->mtd.write_ecc || + !concat->mtd.read_oob != !concat->mtd.read_oob || + !concat->mtd.write_oob != !concat->mtd.write_oob) {
Oops. Fixed in CVS.
Signature · 1 line
dwmw2
Review
Quoted 13 lines · Russell King
Quoted 3 lines
could you try v1.6 from CVS, which should refrain from pretending to have ecc/oob access functions of none of the subdevices have them, and hence fix the problem you observed.
While looking over the changes between 1.5 and 1.6, I spotted this. You may want to fix this change:
(quoted diff) +5
-1- concat->mtd.eccsize != subdev[i]->eccsize) { + concat->mtd.eccsize != subdev[i]->eccsize || + !concat->mtd.read_ecc != !concat->mtd.read_ecc || + !concat->mtd.write_ecc != !concat->mtd.write_ecc || + !concat->mtd.read_oob != !concat->mtd.read_oob || + !concat->mtd.write_oob != !concat->mtd.write_oob) {
Hmmm. That'll optimise well :)
But it shouldn't bite you -- aside from that does it actually fix the problem you'd observed?
Signature · 1 line
dwmw2