Commit 4a43faf5 authored by Sascha Hauer's avatar Sascha Hauer Committed by David Woodhouse

mtd: mxc_nand: move ecc strengh setup before nand_scan_tail

Since commit 6a918bad, the mxc_nand driver
fails with:

Driver must set ecc.strength when using hardware ECC

This is because nand_scan_tail checks for correct ecc strength
settings, so we must set them up before nand_scan_tail.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Cc: stable@vger.kernel.org [3.4+]
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 2e24e32e
...@@ -1465,12 +1465,6 @@ static int __init mxcnd_probe(struct platform_device *pdev) ...@@ -1465,12 +1465,6 @@ static int __init mxcnd_probe(struct platform_device *pdev)
else if (mtd->writesize == 4096) else if (mtd->writesize == 4096)
this->ecc.layout = host->devtype_data->ecclayout_4k; this->ecc.layout = host->devtype_data->ecclayout_4k;
/* second phase scan */
if (nand_scan_tail(mtd)) {
err = -ENXIO;
goto escan;
}
if (this->ecc.mode == NAND_ECC_HW) { if (this->ecc.mode == NAND_ECC_HW) {
if (nfc_is_v1()) if (nfc_is_v1())
this->ecc.strength = 1; this->ecc.strength = 1;
...@@ -1478,6 +1472,12 @@ static int __init mxcnd_probe(struct platform_device *pdev) ...@@ -1478,6 +1472,12 @@ static int __init mxcnd_probe(struct platform_device *pdev)
this->ecc.strength = (host->eccsize == 4) ? 4 : 8; this->ecc.strength = (host->eccsize == 4) ? 4 : 8;
} }
/* second phase scan */
if (nand_scan_tail(mtd)) {
err = -ENXIO;
goto escan;
}
/* Register the partitions */ /* Register the partitions */
mtd_device_parse_register(mtd, part_probes, mtd_device_parse_register(mtd, part_probes,
&(struct mtd_part_parser_data){ &(struct mtd_part_parser_data){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment