Patchwork mtd : change the location of the ONFI detected log

login
register
mail settings
Submitter Huang Shijie
Date Feb. 17, 2012, 3:22 a.m.
Message ID <1329448957-9756-1-git-send-email-b32955@freescale.com>
Download mbox | patch
Permalink /patch/141725/
State Accepted
Commit d42b5de35fb058513367d1a9ee146be5aaab7c6a
Headers show

Comments

Huang Shijie - Feb. 17, 2012, 3:22 a.m.
Some strange nand chip(such as Hynix H27UBG8T2A) can pass the `ONFI` signature
check. So the log can be printed out even it is not an ONFI nand indeed.

Change this log to the end of the function. Print out the log only when we
really detect an ONFI nand.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Florian Fainelli - Feb. 17, 2012, 8:47 a.m.
Le 02/17/12 04:22, Huang Shijie a écrit :
> Some strange nand chip(such as Hynix H27UBG8T2A) can pass the `ONFI` signature
> check. So the log can be printed out even it is not an ONFI nand indeed.
>
> Change this log to the end of the function. Print out the log only when we
> really detect an ONFI nand.
>
> Signed-off-by: Huang Shijie<b32955@freescale.com>

Acked-by: Florian Fainelli <ffainelli@freebox.fr>

> ---
>   drivers/mtd/nand/nand_base.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 5822e3a..1e907dc 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2853,7 +2853,6 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
>   		chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I')
>   		return 0;
>
> -	pr_info("ONFI flash detected\n");
>   	chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
>   	for (i = 0; i<  3; i++) {
>   		chip->read_buf(mtd, (uint8_t *)p, sizeof(*p));
> @@ -2903,6 +2902,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
>   	chip->options |= (NAND_NO_READRDY |
>   			NAND_NO_AUTOINCR)&  NAND_CHIPOPTIONS_MSK;
>
> +	pr_info("ONFI flash detected\n");
>   	return 1;
>   }
>
Brian Norris - Feb. 18, 2012, 5:46 a.m.
On Thu, Feb 16, 2012 at 7:22 PM, Huang Shijie <b32955@freescale.com> wrote:
> Some strange nand chip(such as Hynix H27UBG8T2A) can pass the `ONFI` signature
> check. So the log can be printed out even it is not an ONFI nand indeed.
>
> Change this log to the end of the function. Print out the log only when we
> really detect an ONFI nand.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>

Acked-by: Brian Norris <computersforpeace@gmail.com>
Bityutskiy, Artem - Feb. 29, 2012, 3:08 p.m.
On Fri, 2012-02-17 at 11:22 +0800, Huang Shijie wrote:
> Some strange nand chip(such as Hynix H27UBG8T2A) can pass the `ONFI` signature
> check. So the log can be printed out even it is not an ONFI nand indeed.
> 
> Change this log to the end of the function. Print out the log only when we
> really detect an ONFI nand.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5822e3a..1e907dc 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2853,7 +2853,6 @@  static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 		chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I')
 		return 0;
 
-	pr_info("ONFI flash detected\n");
 	chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
 	for (i = 0; i < 3; i++) {
 		chip->read_buf(mtd, (uint8_t *)p, sizeof(*p));
@@ -2903,6 +2902,7 @@  static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	chip->options |= (NAND_NO_READRDY |
 			NAND_NO_AUTOINCR) & NAND_CHIPOPTIONS_MSK;
 
+	pr_info("ONFI flash detected\n");
 	return 1;
 }