linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mtdoops: refactor loop
@ 2012-05-11 20:30 Brian Norris
  2012-05-11 20:30 ` [PATCH 2/3] mtd: cafe_nand: spelling mistake Brian Norris
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Brian Norris @ 2012-05-11 20:30 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Brian Norris, linux-mtd

We can clean up the loop logic a bit, here. This refactoring was enabled
in part by:

 Commit bb4a09866 [mtdoops: clean-up new MTD API usage]

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/mtdoops.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index ae36d7e..6ba9507 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -169,14 +169,7 @@ static void mtdoops_workfunc_erase(struct work_struct *work)
 			cxt->nextpage = 0;
 	}
 
-	while (1) {
-		ret = mtd_block_isbad(mtd, cxt->nextpage * record_size);
-		if (!ret)
-			break;
-		if (ret < 0) {
-			printk(KERN_ERR "mtdoops: block_isbad failed, aborting\n");
-			return;
-		}
+	while ((ret = mtd_block_isbad(mtd, cxt->nextpage * record_size)) > 0) {
 badblock:
 		printk(KERN_WARNING "mtdoops: bad block at %08lx\n",
 		       cxt->nextpage * record_size);
@@ -190,6 +183,11 @@ badblock:
 		}
 	}
 
+	if (ret < 0) {
+		printk(KERN_ERR "mtdoops: mtd_block_isbad failed, aborting\n");
+		return;
+	}
+
 	for (j = 0, ret = -1; (j < 3) && (ret < 0); j++)
 		ret = mtdoops_erase_block(cxt, cxt->nextpage * record_size);
 
-- 
1.7.5.4.2.g519b1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] mtd: cafe_nand: spelling mistake
  2012-05-11 20:30 [PATCH 1/3] mtdoops: refactor loop Brian Norris
@ 2012-05-11 20:30 ` Brian Norris
  2012-05-11 20:30 ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw Brian Norris
  2012-05-15  7:58 ` [PATCH 1/3] mtdoops: refactor loop Artem Bityutskiy
  2 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2012-05-11 20:30 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Brian Norris, linux-mtd

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/cafe_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 41371ba..f3594a6 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -377,7 +377,7 @@ static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
  * @buf:	buffer to store read data
  * @oob_required:	caller expects OOB data read to chip->oob_poi
  *
- * The hw generator calculates the error syndrome automatically. Therefor
+ * The hw generator calculates the error syndrome automatically. Therefore
  * we need a special oob layout and handling.
  */
 static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip,
-- 
1.7.5.4.2.g519b1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw
  2012-05-11 20:30 [PATCH 1/3] mtdoops: refactor loop Brian Norris
  2012-05-11 20:30 ` [PATCH 2/3] mtd: cafe_nand: spelling mistake Brian Norris
@ 2012-05-11 20:30 ` Brian Norris
  2012-05-14  2:48   ` Huang Shijie
  2012-05-15  7:58 ` [PATCH 1/3] mtdoops: refactor loop Artem Bityutskiy
  2 siblings, 1 reply; 6+ messages in thread
From: Brian Norris @ 2012-05-11 20:30 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Huang Shijie, Brian Norris, linux-mtd

This patch is simply an added warning in the comments. Ideally, this patch
need not be merged, but rather, a developer will write a proper solution
that can use the ecc.read_oob_raw and ecc.write_oob_raw interfaces.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 8250f63..033bd7a 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1054,6 +1054,9 @@ exit_auxiliary:
  * ECC-based or raw view of the page is implicit in which function it calls
  * (there is a similar pair of ECC-based/raw functions for writing).
  *
+ * FIXME: The following paragraph is incorrect, now that there exist
+ * ecc.read_oob_raw and ecc.write_oob_raw functions.
+ *
  * Since MTD assumes the OOB is not covered by ECC, there is no pair of
  * ECC-based/raw functions for reading or or writing the OOB. The fact that the
  * caller wants an ECC-based or raw view of the page is not propagated down to
-- 
1.7.5.4.2.g519b1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw
  2012-05-11 20:30 ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw Brian Norris
@ 2012-05-14  2:48   ` Huang Shijie
  2012-05-15  7:59     ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read,write}_oob_raw Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Huang Shijie @ 2012-05-14  2:48 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd, Artem Bityutskiy

Hi Brian :
> This patch is simply an added warning in the comments. Ideally, this patch
> need not be merged, but rather, a developer will write a proper solution
> that can use the ecc.read_oob_raw and ecc.write_oob_raw interfaces.
>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Huang Shijie <b32955@freescale.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 8250f63..033bd7a 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -1054,6 +1054,9 @@ exit_auxiliary:
>   * ECC-based or raw view of the page is implicit in which function it calls
>   * (there is a similar pair of ECC-based/raw functions for writing).
>   *
> + * FIXME: The following paragraph is incorrect, now that there exist
> + * ecc.read_oob_raw and ecc.write_oob_raw functions.
I think you can just remove the following paragraph(it's out of date now).

Best Regards
Huang Shijie
> + *
>   * Since MTD assumes the OOB is not covered by ECC, there is no pair of
>   * ECC-based/raw functions for reading or or writing the OOB. The fact that the
>   * caller wants an ECC-based or raw view of the page is not propagated down to

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] mtdoops: refactor loop
  2012-05-11 20:30 [PATCH 1/3] mtdoops: refactor loop Brian Norris
  2012-05-11 20:30 ` [PATCH 2/3] mtd: cafe_nand: spelling mistake Brian Norris
  2012-05-11 20:30 ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw Brian Norris
@ 2012-05-15  7:58 ` Artem Bityutskiy
  2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2012-05-15  7:58 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

On Fri, 2012-05-11 at 13:30 -0700, Brian Norris wrote:
> We can clean up the loop logic a bit, here. This refactoring was enabled
> in part by:
> 
>  Commit bb4a09866 [mtdoops: clean-up new MTD API usage]
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Pushed all 3 to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read,write}_oob_raw
  2012-05-14  2:48   ` Huang Shijie
@ 2012-05-15  7:59     ` Artem Bityutskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2012-05-15  7:59 UTC (permalink / raw)
  To: Huang Shijie; +Cc: Brian Norris, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

On Mon, 2012-05-14 at 10:48 +0800, Huang Shijie wrote:
> Hi Brian :
> > This patch is simply an added warning in the comments. Ideally, this patch
> > need not be merged, but rather, a developer will write a proper solution
> > that can use the ecc.read_oob_raw and ecc.write_oob_raw interfaces.
> >
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > Cc: Huang Shijie <b32955@freescale.com>
> > ---
> >  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > index 8250f63..033bd7a 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > @@ -1054,6 +1054,9 @@ exit_auxiliary:
> >   * ECC-based or raw view of the page is implicit in which function it calls
> >   * (there is a similar pair of ECC-based/raw functions for writing).
> >   *
> > + * FIXME: The following paragraph is incorrect, now that there exist
> > + * ecc.read_oob_raw and ecc.write_oob_raw functions.
> I think you can just remove the following paragraph(it's out of date now).

I've pushed Brian's patch to l2-mtd.git - it is OK in this form and I
think it is better if someone who takes care of gpmi fixes-up the
comments properly instead.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-15  7:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 20:30 [PATCH 1/3] mtdoops: refactor loop Brian Norris
2012-05-11 20:30 ` [PATCH 2/3] mtd: cafe_nand: spelling mistake Brian Norris
2012-05-11 20:30 ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read, write}_oob_raw Brian Norris
2012-05-14  2:48   ` Huang Shijie
2012-05-15  7:59     ` [PATCH 3/3] mtd: nand: gpmi: [FIXME] need to use {read,write}_oob_raw Artem Bityutskiy
2012-05-15  7:58 ` [PATCH 1/3] mtdoops: refactor loop 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).