public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Han Xu <han.xu@nxp.com>
Cc: <richard@nod.at>, <dwmw2@infradead.org>,
	<computersforpeace@gmail.com>, <linux-mtd@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: nand: gpmi: get correct free oob space
Date: Wed, 13 Apr 2016 00:43:51 +0200	[thread overview]
Message-ID: <20160413004351.40064fcd@bbrezillon> (raw)
In-Reply-To: <1460498793-19431-1-git-send-email-han.xu@nxp.com>

Hi Han,

On Tue, 12 Apr 2016 17:06:33 -0500
Han Xu <han.xu@nxp.com> wrote:

> change the way to calculate pagesize to get correct free oob space for
> legacy_set_geometry function.

Are you sure it's safe to expose free OOB bytes in this case? Do you
know why it wasn't done before?

Best Regards,

Boris

> 
> Signed-off-by: Han Xu <han.xu@nxp.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 316b5ac..bda77a9 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -319,7 +319,8 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)
>  		return -EINVAL;
>  	}
>  
> -	geo->page_size = mtd->writesize + mtd->oobsize;
> +	geo->page_size = mtd->writesize + geo->metadata_size +
> +		(geo->gf_len * geo->ecc_strength * geo->ecc_chunk_count) / 8;
>  	geo->payload_size = mtd->writesize;
>  
>  	/*



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-04-12 22:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 22:06 [PATCH] mtd: nand: gpmi: get correct free oob space Han Xu
2016-04-12 22:43 ` Boris Brezillon [this message]
2016-04-29  8:31   ` Boris Brezillon
2016-04-29 14:35     ` Han Xu
2016-08-14 15:45 ` Boris Brezillon

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=20160413004351.40064fcd@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=han.xu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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