linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org
Subject: Re: [PATCH] mtd: nand: add support for Samsung K9LCG08U0B
Date: Thu, 16 Jan 2014 13:36:37 -0800	[thread overview]
Message-ID: <20140116213637.GH8919@ld-irv-0074> (raw)
In-Reply-To: <1387963135-22142-1-git-send-email-b32955@freescale.com>

On Wed, Dec 25, 2013 at 05:18:55PM +0800, Huang Shijie wrote:
> Assume that:
>           tmp = ((extid >> 2) & 0x04) | (extid & 0x03));
> 
> From the K9LCG08U0B's datasheet, we know that:
>   the oob size is 640 when tmp is 6;
>   the oob size is 1024 when tmp is 7;
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  drivers/mtd/nand/nand_base.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ce4dec7..0d113cc 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3242,9 +3242,11 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
>  			mtd->oobsize = 512;
>  			break;
>  		case 6:
> -		default: /* Other cases are "reserved" (unknown) */
>  			mtd->oobsize = 640;
>  			break;
> +		case 7:
> +			mtd->oobsize = SZ_1K;

#include <linux/sizes.h>

Did you compile this?

Anyway, I think just using the literal 1024 is better. I can fix it up
and push myself in a bit.

> +			break;
>  		}
>  		extid >>= 2;
>  		/* Calc blocksize */

Brian

  reply	other threads:[~2014-01-16 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-25  9:18 [PATCH] mtd: nand: add support for Samsung K9LCG08U0B Huang Shijie
2014-01-16 21:36 ` Brian Norris [this message]
2014-01-17  1:40   ` Huang Shijie
2014-01-17  5:41     ` Brian Norris
2014-01-17  5:14       ` Huang Shijie
2014-01-17  6:17       ` [PATCH fix] " Huang Shijie
2014-01-20 19:27         ` 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=20140116213637.GH8919@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=b32955@freescale.com \
    --cc=dwmw2@infradead.org \
    --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).