ARM: omap2: mtd split nand_scan in ident and tail
Subsystems (2)
PATCH 1/1 ARM: omap2: mtd split nand_scan in ident and tail
nand_scan calls nand_scan_ident and nand_scan_tail, setting values like oobvail according to ecc.layout. If we change the layout afterwards values are wrong.
--- drivers/mtd/nand/omap2.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/mtd/nand/omap2.c +8 -2
@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)/* DIP switches on some boards change between 8 and 16 bit * bus widths for flash. Try the other width if the first try fails. */ -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { info->nand.options ^=NAND_BUSWIDTH_16 ; -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { err = -ENXIO ; goto out_release_mem_region; }
@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.ecc.layout = &omap_oobinfo; } +/* second phase scan */ +if (nand_scan_tail (&info->mtd)) { + err = -ENXIO ; + goto out_release_mem_region; + } +#ifdef CONFIG_MTD_PARTITIONS err =parse_mtd_partitions (&info->mtd, part_probes, &info->parts,0 );if (err >0 )
Signature · 1 line
1.7.0.4
Am Donnerstag, den 14.04.2011, 11:15 +0200 schrieb Jan Weitzel:
Quoted 27 lines
nand_scancallsnand_scan_identandnand_scan_tail, setting values like oobvail according to ecc.layout. If we change the layout afterwards values are wrong.Signed-off-by Jan Weitzel <[email protected]>--- drivers/mtd/nand/omap2.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)drivers/mtd/nand/omap2.c +2
-2@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)/* DIP switches on some boards change between 8 and 16 bit * bus widths for flash. Try the other width if the first try fails. */ -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { info->nand.options ^=NAND_BUSWIDTH_16 ; -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { err = -ENXIO ; goto out_release_mem_region; }@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.ecc.layout = &omap_oobinfo; }
drivers/mtd/nand/omap2.c static int __devinit omap_nand_probe(struct platform_device *pdev) · line 1112
Quoted 10 lines
drivers/mtd/nand/omap2.c +6
-0+/* second phase scan */ +if (nand_scan_tail (&info->mtd)) { + err = -ENXIO ; + goto out_release_mem_region; + } +#ifdef CONFIG_MTD_PARTITIONS err =parse_mtd_partitions (&info->mtd, part_probes, &info->parts,0 );if (err >0 )
So no comments? Is any rework needed? Without this patch I am not able to mount partions with OMAP_ECC_HAMMING_CODE_HW_ROMCODE. Regards, Jan
Quoted 29 lines · Jan Weitzel
Am Donnerstag, den 14.04.2011, 11:15 +0200 schrieb Jan Weitzel:
Quoted 28 lines
nand_scancallsnand_scan_identandnand_scan_tail, setting values like oobvail according to ecc.layout. If we change the layout afterwards values are wrong.Signed-off-by Jan Weitzel <[email protected]>--- drivers/mtd/nand/omap2.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)drivers/mtd/nand/omap2.c +2
-2@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)/* DIP switches on some boards change between 8 and 16 bit * bus widths for flash. Try the other width if the first try fails. */ -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { info->nand.options ^=NAND_BUSWIDTH_16 ; -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { err = -ENXIO ; goto out_release_mem_region; }@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.ecc.layout = &omap_oobinfo; }
Quoted 12 lines
drivers/mtd/nand/omap2.c static int __devinit omap_nand_probe(struct platform_device *pdev) · line 1112
Quoted 9 lines
drivers/mtd/nand/omap2.c +6
-0+/* second phase scan */ +if (nand_scan_tail (&info->mtd)) { + err = -ENXIO ; + goto out_release_mem_region; + } +#ifdef CONFIG_MTD_PARTITIONS err =parse_mtd_partitions (&info->mtd, part_probes, &info->parts,0 );if (err >0 )So no comments? Is any rework needed? Without this patch I am not able to mount partions with
OMAP_ECC_HAMMING_CODE_HW_ROMCODE.
Sorry, I missed this patch. Could you please update the commit message and make it more verbose and state clearly:
1. which problem you solve
2. how you solve it
3. why is this the right solution
Thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
PATCH v2 1/1 ARM: omap2: mtd split nand_scan in ident and tail
nand_scan calls nand_scan_tail and here we got a ecc.layout and calculate oobavail for this layout. After calling nand_scan, we change the layout pointer if OMAP_ECC_HAMMING_CODE_HW_ROMCODE is set. This results in not calcluated oobavail. Mountig as jffs2 is not possible.
To fix that nand_scan has to split up in nand_scan_ident and nand_scan_tail setting ecc.layout between these calls. So nand_scan_tail calculates oobvail for the used layout. This is also done in serveral other platforms.
v2:
update commit message
--- drivers/mtd/nand/omap2.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/mtd/nand/omap2.c +8 -2
@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)/* DIP switches on some boards change between 8 and 16 bit * bus widths for flash. Try the other width if the first try fails. */ -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { info->nand.options ^=NAND_BUSWIDTH_16 ; -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { err = -ENXIO ; goto out_release_mem_region; }
@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.ecc.layout = &omap_oobinfo; } +/* second phase scan */ +if (nand_scan_tail (&info->mtd)) { + err = -ENXIO ; + goto out_release_mem_region; + } +#ifdef CONFIG_MTD_PARTITIONS err =parse_mtd_partitions (&info->mtd, part_probes, &info->parts,0 );if (err >0 )
Signature · 1 line
1.7.0.4
Quoted 11 lines · Jan Weitzel
nand_scancallsnand_scan_tailand here we got a ecc.layout and calculate oobavail for this layout. After callingnand_scan, we change the layout pointer ifOMAP_ECC_HAMMING_CODE_HW_ROMCODEis set. This results in not calcluated oobavail. Mountig as jffs2 is not possible.To fix that
nand_scanhas to split up innand_scan_identandnand_scan_tailsetting ecc.layout between these calls. Sonand_scan_tailcalculates oobvail for the used layout. This is also done in serveral other platforms.v2:
update commit message
Move above two lines to below (as there are not part of commit log):
Quoted 3 lines
Signed-off-by Jan Weitzel <[email protected]>---
here.
Feel free to add:
Regards,
Vimal
PATCH v3 1/1 ARM: omap2: mtd split nand_scan in ident and tail
nand_scan calls nand_scan_tail and here we got a ecc.layout and calculate oobavail for this layout. After calling nand_scan, we change the layout pointer if OMAP_ECC_HAMMING_CODE_HW_ROMCODE is set. This results in not calcluated oobavail. Mountig as jffs2 is not possible.
To fix that nand_scan has to split up in nand_scan_ident and nand_scan_tail setting ecc.layout between these calls. So nand_scan_tail calculates oobvail for the used layout. This is also done in serveral other platforms.
---
v2:
update commit message
v3:
Add Reviewed-by
drivers/mtd/nand/omap2.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/mtd/nand/omap2.c +8 -2
@@ -1073,9 +1073,9 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)/* DIP switches on some boards change between 8 and 16 bit * bus widths for flash. Try the other width if the first try fails. */ -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { info->nand.options ^=NAND_BUSWIDTH_16 ; -if (nand_scan (&info->mtd,1 )) { +if (nand_scan_ident (&info->mtd,1 ,NULL )) { err = -ENXIO ; goto out_release_mem_region; }
@@ -1101,6 +1101,12 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.ecc.layout = &omap_oobinfo; } +/* second phase scan */ +if (nand_scan_tail (&info->mtd)) { + err = -ENXIO ; + goto out_release_mem_region; + } +#ifdef CONFIG_MTD_PARTITIONS err =parse_mtd_partitions (&info->mtd, part_probes, &info->parts,0 );if (err >0 )
Signature · 1 line
1.7.0.4
PATCH v3 1/1 ARM: omap2: mtd split nand_scan in ident and tail
Quoted 11 lines · Jan Weitzel
nand_scancallsnand_scan_tailand here we got a ecc.layout and calculate oobavail for this layout. After callingnand_scan, we change the layout pointer ifOMAP_ECC_HAMMING_CODE_HW_ROMCODEis set. This results in not calcluated oobavail. Mountig as jffs2 is not possible.To fix that
nand_scanhas to split up innand_scan_identandnand_scan_tailsetting ecc.layout between these calls. Sonand_scan_tailcalculates oobvail for the used layout. This is also done in serveral other platforms.Signed-off-by Jan Weitzel <[email protected]>Reviewed-by Vimal Singh <[email protected]>
Jan,
thanks for the patch, pushed to l2-mtd-2.6.git. And apologies that I missed.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)