MLK-16089: mtd: gpmi-nand: calculate the correct free oob space for large oob layout...
authorHan Xu <han.xu@nxp.com>
Thu, 27 Jul 2017 02:20:00 +0000 (21:20 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:54 +0000 (15:33 -0500)
for the large oob layout setting, need to calculate the correct free oob
space.

Signed-off-by: Han Xu <han.xu@nxp.com>
drivers/mtd/nand/gpmi-nand/gpmi-nand.c

index 6ca449e..2a93177 100644 (file)
@@ -411,7 +411,8 @@ static int set_geometry_for_large_oob(struct gpmi_nand_data *this)
 
 geo_setting:
 
-       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;
 
        /*