public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH 07/12] mtd: nand: return failure when failing to get ECC from ONFI
Date: Thu, 5 Sep 2013 10:34:21 +0800	[thread overview]
Message-ID: <5227EDAD.6000808@freescale.com> (raw)
In-Reply-To: <1378319126-24473-8-git-send-email-computersforpeace@gmail.com>

于 2013年09月05日 02:25, Brian Norris 写道:
> If ONFI fails to provide ECC information, we should not use it. Print
> appropriate error messages and return.
>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Huang Shijie <b32955@freescale.com>
> ---
>  drivers/mtd/nand/nand_base.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 7ed4841..38b8dd4 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3010,8 +3010,13 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
>  			chip->cmdfunc = nand_command_lp;
>  
>  		/* The Extended Parameter Page is supported since ONFI 2.1. */
> -		if (nand_flash_detect_ext_param_page(mtd, chip, p))
> -			pr_info("Failed to detect the extended param page.\n");
> +		if (nand_flash_detect_ext_param_page(mtd, chip, p)) {
> +			pr_info("Failed to detect ONFI extended param page\n");
> +			return 0;
> +		}
> +	} else {
> +		pr_err("Could not retrieve ONFI ECC requirements\n");
> +		return 0;
This return will skips the message "ONFI flash detected", could we
remove the 'return' from this patch?

most of the drivers will not use the ECC info, so i think even we fail
to detect the ECC info
we do not need to skip the message "ONFI flash detected".

My suggestion is to use the pr_warn() to just print out the warning,
such as:
pr_warn("Could not retrieve ONFI ECC requirements\n");



thanks
Huang Shijie

>  	}
>  
>  	pr_info("ONFI flash detected\n");

  reply	other threads:[~2013-09-05  2:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 18:25 [PATCH 00/12] mtd: miscellaneous fixes Brian Norris
2013-09-04 18:25 ` [PATCH 01/12] nand: docg4: use nand_base's default BBT scan Brian Norris
2013-09-05 20:09   ` Mike Dunn
2013-09-04 18:25 ` [PATCH 02/12] mtd: nand: lpc32xx_slc: don't call nand_default_bbt directly Brian Norris
2013-09-04 18:25 ` [PATCH 03/12] mtd: nandsim: don't call nand_default_bbt() directly Brian Norris
2013-09-04 18:25 ` [PATCH 04/12] mtd: nand: stop exporting nand_default_bbt Brian Norris
2013-09-04 18:25 ` [PATCH 05/12] mtd: dataflash: remove unused field Brian Norris
2013-09-04 18:25 ` [PATCH 06/12] mtd: denali: make init function static Brian Norris
2013-09-04 18:25 ` [PATCH 07/12] mtd: nand: return failure when failing to get ECC from ONFI Brian Norris
2013-09-05  2:34   ` Huang Shijie [this message]
2013-09-11 21:43     ` Brian Norris
2013-09-11 23:02       ` Ezequiel Garcia
2013-09-04 18:25 ` [PATCH 08/12] mtd: nand: don't print ONFI buswidth errors unless we need to Brian Norris
2013-09-04 18:25 ` [PATCH 09/12] mtd: onenand: remove redundant offset check Brian Norris
2013-09-04 18:25 ` [PATCH 10/12] mtd: nand: remove obsolete 'ecclayout' field Brian Norris
2013-09-04 18:25 ` [PATCH 11/12] mtd: onenand: remove unused variable assignments Brian Norris
2013-09-04 18:25 ` [PATCH 12/12] mtd: lpddr_cmds: make function static Brian Norris
2013-09-11 22:27 ` [PATCH 00/12] mtd: miscellaneous fixes Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5227EDAD.6000808@freescale.com \
    --to=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox