linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <ffainelli@freebox.fr>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH] mtd : print out the page size and oob size after parsing out the nand
Date: Tue, 10 Apr 2012 12:28:38 +0200	[thread overview]
Message-ID: <4F840B56.403@freebox.fr> (raw)
In-Reply-To: <1333942897-7392-1-git-send-email-b32955@freescale.com>

Hi Huang,

Le 04/09/12 05:41, Huang Shijie a écrit :
> Some not-supported nand chips may pass the current parsing code,
> and get the wrong page size and oob size. Sometimes, it's hard to notice
> that you get the wrong values, because there is no warning or error.
>
> So it's useful to print out the page size and oob size in the end of
> the parsing function. We can check these values with the datasheet of the nand
> chip as soon as possible.

Relying on the kernel to print something to assert the correctness of 
the NAND detection is really weak, you'd better query these properties 
in userland. Also, I am afraid everyone adds a new NAND property print-out.

>
> Signed-off-by: Huang Shijie<b32955@freescale.com>
> ---
>   drivers/mtd/nand/nand_base.c |    7 ++++---
>   1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 47b19c0..6315b94 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3155,9 +3155,10 @@ ident_done:
>   		chip->cmdfunc = nand_command_lp;
>
>   	pr_info("NAND device: Manufacturer ID:"
> -		" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id,
> -		nand_manuf_ids[maf_idx].name,
> -		chip->onfi_version ? chip->onfi_params.model : type->name);
> +		" 0x%02x, Chip ID: 0x%02x (%s %s), pagesize: %d, oobsize: %d\n",
> +		*maf_id, *dev_id, nand_manuf_ids[maf_idx].name,
> +		chip->onfi_version ? chip->onfi_params.model : type->name,
> +		mtd->writesize, mtd->oobsize);
>
>   	return type;
>   }

  reply	other threads:[~2012-04-10 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09  3:41 [PATCH] mtd : print out the page size and oob size after parsing out the nand Huang Shijie
2012-04-10 10:28 ` Florian Fainelli [this message]
2012-04-11  2:01   ` Huang Shijie
2012-04-21 14:21     ` Artem Bityutskiy
2012-04-22  5:15 ` Artem Bityutskiy

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=4F840B56.403@freebox.fr \
    --to=ffainelli@freebox.fr \
    --cc=b32955@freescale.com \
    --cc=dedekind1@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;
as well as URLs for NNTP newsgroup(s).