All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Nikolay Martynov <mar.kolya@gmail.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: Re: [PATCH] mtd: nand: Fix Spansion sparearea size detection
Date: Mon, 30 Nov 2015 12:35:18 -0800	[thread overview]
Message-ID: <20151130203518.GL64635@google.com> (raw)
In-Reply-To: <1448519122-6259-1-git-send-email-mar.kolya@gmail.com>

Hi Nikolay,

On Thu, Nov 26, 2015 at 01:25:22AM -0500, Nikolay Martynov wrote:
> According to datasheet S34ML02G2 and S34ML04G2 have
> larger sparea area size than was detected.
> 
> Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
> ---
>  drivers/mtd/nand/nand_base.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ceb68ca..2c01f9e 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3415,6 +3415,7 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
>  	/*
>  	 * Field definitions are in the following datasheets:
>  	 * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32)
> +	 *                          Spansion S34ML02G2 (p.33)
>  	 * New Samsung (6 byte ID): Samsung K9GAG08U0F (p.44)
>  	 * Hynix MLC   (6 byte ID): Hynix H27UBG8T2B (p.22)
>  	 *
> @@ -3512,6 +3513,14 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
>  		*busw = (extid & 0x01) ? NAND_BUSWIDTH_16 : 0;
>  
>  		/*
> +		 * Spansion S34ML0[24]G2 have oobsize twice as large
> +		 * as S34ML01G2 encoded in the same bit. We
> +		 * differentiate them by their ID length

Hmm, are you sure the ID length heuristic works correctly for these
particular flash? i.e., did you actually test both of these flash?
Sometimes it's hard to tell if a device has a 4-byte or 5-byte ID just
from reading out bytes, since a "4-byte ID" NAND may just have a "don't
care" byte for the 5th one, and so we might still compute id_len == 5.

Also, why do you even need nand_decode_ext_id() for these flash?
According to the datasheet, these flash support ONFI.

Brian

> +		 */
> +		if (id_len == 5 && id_data[0] == NAND_MFR_AMD)
> +			mtd->oobsize *= 2;
> +
> +		/*
>  		 * Toshiba 24nm raw SLC (i.e., not BENAND) have 32B OOB per
>  		 * 512B page. For Toshiba SLC, we decode the 5th/6th byte as
>  		 * follows:
> -- 
> 2.6.3
> 

  reply	other threads:[~2015-11-30 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26  6:25 [PATCH] mtd: nand: Fix Spansion sparearea size detection Nikolay Martynov
2015-11-30 20:35 ` Brian Norris [this message]
2015-11-30 23:59   ` Nikolay Martynov
2015-12-01  0:09     ` Brian Norris
2015-12-01  0:19       ` Nikolay Martynov
2015-12-01  1:05         ` Brian Norris
2015-12-01  1:20           ` Nikolay Martynov

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=20151130203518.GL64635@google.com \
    --to=computersforpeace@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mar.kolya@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.