public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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