diff mbox

ARM: omap2: mtd split nand_scan in ident and tail

Message ID 1302772529-15641-1-git-send-email-j.weitzel@phytec.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Weitzel April 14, 2011, 9:15 a.m. UTC
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.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 drivers/mtd/nand/omap2.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Comments

Jan Weitzel April 15, 2011, 1:34 p.m. UTC | #1
Am Donnerstag, den 14.04.2011, 11:15 +0200 schrieb Jan Weitzel:
> 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.
> 
> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> ---
>  drivers/mtd/nand/omap2.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index da9a351..288423f 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -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)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Artem Bityutskiy April 15, 2011, 2:03 p.m. UTC | #2
On Fri, 2011-04-15 at 15:34 +0200, Jan Weitzel wrote:
> Am Donnerstag, den 14.04.2011, 11:15 +0200 schrieb Jan Weitzel:
> > 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.
> > 
> > Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
> > ---
> >  drivers/mtd/nand/omap2.c |   10 ++++++++--
> >  1 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> > index da9a351..288423f 100644
> > --- a/drivers/mtd/nand/omap2.c
> > +++ b/drivers/mtd/nand/omap2.c
> > @@ -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)
> 
> 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!
diff mbox

Patch

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index da9a351..288423f 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -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)