Skip to content

Commit 1848a05

Browse files
hanxu-nxpBoris Brezillon
authored andcommitted
mtd: nand: gpmi: get correct free oob space
change the way to calculate pagesize to get correct free oob space for legacy_set_geometry function. Signed-off-by: Han Xu <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
1 parent 3fe4f90 commit 1848a05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mtd/nand/gpmi-nand/gpmi-nand.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)
318318
return -EINVAL;
319319
}
320320

321-
geo->page_size = mtd->writesize + mtd->oobsize;
321+
geo->page_size = mtd->writesize + geo->metadata_size +
322+
(geo->gf_len * geo->ecc_strength * geo->ecc_chunk_count) / 8;
322323
geo->payload_size = mtd->writesize;
323324

324325
/*

0 commit comments

Comments
 (0)