The legacy ECC layout uses all the OOB area by computing the ECC
strength and ECC step size ourselves.
The patch "
2febcdf mtd: gpmi: set the BCHs geometry with the ecc info"
makes the gpmi to use the ECC info (ECC strength and ECC step size)
provided by the MTD code, and creates a different NAND ECC layout
for the BCH, and use the new ECC layout. This causes a regression:
We can not mount the ubifs which was created by the old NAND ECC layout.
This patch fixes this issue by reverting to the legacy ECC layout
firstly; if it fails, we try to use the new ECC layout.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
int common_nfc_set_geometry(struct gpmi_nand_data *this)
{
- return set_geometry_by_ecc_info(this) ? 0 : legacy_set_geometry(this);
+ return legacy_set_geometry(this) ?
+ (!set_geometry_by_ecc_info(this)) : 0;
}
struct dma_chan *get_dma_chan(struct gpmi_nand_data *this)