* [PATCH] mtd: nand: gpmi: get correct free oob space
@ 2016-04-12 22:06 Han Xu
2016-04-12 22:43 ` Boris Brezillon
2016-08-14 15:45 ` Boris Brezillon
0 siblings, 2 replies; 5+ messages in thread
From: Han Xu @ 2016-04-12 22:06 UTC (permalink / raw)
To: han.xu, boris.brezillon, richard, dwmw2, computersforpeace
Cc: linux-mtd, linux-kernel
change the way to calculate pagesize to get correct free oob space for
legacy_set_geometry function.
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;
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: nand: gpmi: get correct free oob space
2016-04-12 22:06 [PATCH] mtd: nand: gpmi: get correct free oob space Han Xu
@ 2016-04-12 22:43 ` Boris Brezillon
2016-04-29 8:31 ` Boris Brezillon
2016-08-14 15:45 ` Boris Brezillon
1 sibling, 1 reply; 5+ messages in thread
From: Boris Brezillon @ 2016-04-12 22:43 UTC (permalink / raw)
To: Han Xu; +Cc: richard, dwmw2, computersforpeace, linux-mtd, linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: nand: gpmi: get correct free oob space
2016-04-12 22:43 ` Boris Brezillon
@ 2016-04-29 8:31 ` Boris Brezillon
2016-04-29 14:35 ` Han Xu
0 siblings, 1 reply; 5+ messages in thread
From: Boris Brezillon @ 2016-04-29 8:31 UTC (permalink / raw)
To: Han Xu; +Cc: richard, dwmw2, computersforpeace, linux-mtd, linux-kernel
Hi Han,
On Wed, 13 Apr 2016 00:43:51 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> 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?
You did not answer this question. Do you want me to drop this patch. If
that's not the case, can you confirm it does not break platforms that
didn't have those free OOB bytes exposed before this change.
Thanks,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: nand: gpmi: get correct free oob space
2016-04-29 8:31 ` Boris Brezillon
@ 2016-04-29 14:35 ` Han Xu
0 siblings, 0 replies; 5+ messages in thread
From: Han Xu @ 2016-04-29 14:35 UTC (permalink / raw)
To: Boris Brezillon
Cc: richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
________________________________________
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Sent: Friday, April 29, 2016 2:31 AM
To: Han Xu
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
Hi Han,
On Wed, 13 Apr 2016 00:43:51 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> 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?
You did not answer this question. Do you want me to drop this patch. If
that's not the case, can you confirm it does not break platforms that
didn't have those free OOB bytes exposed before this change.
I think it's safe to expose the free OOB and also tested on my side, no
issue found.
Thanks,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: nand: gpmi: get correct free oob space
2016-04-12 22:06 [PATCH] mtd: nand: gpmi: get correct free oob space Han Xu
2016-04-12 22:43 ` Boris Brezillon
@ 2016-08-14 15:45 ` Boris Brezillon
1 sibling, 0 replies; 5+ messages in thread
From: Boris Brezillon @ 2016-08-14 15:45 UTC (permalink / raw)
To: Han Xu; +Cc: richard, dwmw2, computersforpeace, linux-mtd, linux-kernel
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.
>
Applied (sorry for the delay, it seems this patch felt through the
cracks).
Thanks,
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;
>
> /*
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-14 15:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12 22:06 [PATCH] mtd: nand: gpmi: get correct free oob space Han Xu
2016-04-12 22:43 ` Boris Brezillon
2016-04-29 8:31 ` Boris Brezillon
2016-04-29 14:35 ` Han Xu
2016-08-14 15:45 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox