* Re: [PATCH] ARM: omap2: mtd split nand_scan in ident and tail [not found] <1302772529-15641-1-git-send-email-j.weitzel@phytec.de> @ 2011-04-15 13:34 ` Jan Weitzel 2011-04-15 14:03 ` Artem Bityutskiy 0 siblings, 1 reply; 6+ messages in thread From: Jan Weitzel @ 2011-04-15 13:34 UTC (permalink / raw) To: linux-omap, linux-mtd Cc: Artem.Bityutskiy, tony, s.hauer, s-ghorai, vimalsingh, dwmw2 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: omap2: mtd split nand_scan in ident and tail 2011-04-15 13:34 ` [PATCH] ARM: omap2: mtd split nand_scan in ident and tail Jan Weitzel @ 2011-04-15 14:03 ` Artem Bityutskiy 2011-04-18 6:50 ` [PATCH v2] " Jan Weitzel 0 siblings, 1 reply; 6+ messages in thread From: Artem Bityutskiy @ 2011-04-15 14:03 UTC (permalink / raw) To: J.Weitzel Cc: vimalsingh, tony, s.hauer, linux-mtd, s-ghorai, linux-omap, dwmw2 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! -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] ARM: omap2: mtd split nand_scan in ident and tail 2011-04-15 14:03 ` Artem Bityutskiy @ 2011-04-18 6:50 ` Jan Weitzel 2011-04-18 6:59 ` Vimal Singh 0 siblings, 1 reply; 6+ messages in thread From: Jan Weitzel @ 2011-04-18 6:50 UTC (permalink / raw) To: linux-omap, linux-mtd, Artem.Bityutskiy Cc: tony, Jan Weitzel, s.hauer, s-ghorai, vimalsingh, dwmw2 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 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) -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ARM: omap2: mtd split nand_scan in ident and tail 2011-04-18 6:50 ` [PATCH v2] " Jan Weitzel @ 2011-04-18 6:59 ` Vimal Singh 2011-04-19 14:15 ` [PATCH v3] " Jan Weitzel 0 siblings, 1 reply; 6+ messages in thread From: Vimal Singh @ 2011-04-18 6:59 UTC (permalink / raw) To: Jan Weitzel Cc: Artem.Bityutskiy, vimalsingh, tony, s.hauer, linux-mtd, s-ghorai, linux-omap, dwmw2 On Mon, Apr 18, 2011 at 12:20 PM, Jan Weitzel <j.weitzel@phytec.de> wrote: > 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 Move above two lines to below (as there are not part of commit log): > > Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> > --- here. Feel free to add: Reviewed-by: Vimal Singh <vimal.newwork@gmail.com> Regards, Vimal ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3] ARM: omap2: mtd split nand_scan in ident and tail 2011-04-18 6:59 ` Vimal Singh @ 2011-04-19 14:15 ` Jan Weitzel 2011-04-20 9:00 ` Artem Bityutskiy 0 siblings, 1 reply; 6+ messages in thread From: Jan Weitzel @ 2011-04-19 14:15 UTC (permalink / raw) To: linux-omap, linux-mtd, linux-arm-kernel, Artem.Bityutskiy Cc: tony, Jan Weitzel, s.hauer, vimal.newwork, s-ghorai, dwmw2 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. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Reviewed-by: Vimal Singh <vimal.newwork@gmail.com> --- v2: update commit message v3: Add Reviewed-by 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) -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3] ARM: omap2: mtd split nand_scan in ident and tail 2011-04-19 14:15 ` [PATCH v3] " Jan Weitzel @ 2011-04-20 9:00 ` Artem Bityutskiy 0 siblings, 0 replies; 6+ messages in thread From: Artem Bityutskiy @ 2011-04-20 9:00 UTC (permalink / raw) To: Jan Weitzel Cc: tony, s.hauer, linux-mtd, s-ghorai, vimal.newwork, linux-omap, dwmw2, linux-arm-kernel On Tue, 2011-04-19 at 16:15 +0200, Jan Weitzel wrote: > 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. > > Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> > Reviewed-by: Vimal Singh <vimal.newwork@gmail.com> Jan, thanks for the patch, pushed to l2-mtd-2.6.git. And apologies that I missed. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-20 9:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1302772529-15641-1-git-send-email-j.weitzel@phytec.de>
2011-04-15 13:34 ` [PATCH] ARM: omap2: mtd split nand_scan in ident and tail Jan Weitzel
2011-04-15 14:03 ` Artem Bityutskiy
2011-04-18 6:50 ` [PATCH v2] " Jan Weitzel
2011-04-18 6:59 ` Vimal Singh
2011-04-19 14:15 ` [PATCH v3] " Jan Weitzel
2011-04-20 9:00 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).