On Wed, 2011-08-03 at 13:50 +0800, [email protected] wrote:
> From: Liu Shuo <[email protected]>
>
> Flash_erase -j should fill discrete freeoob areas with required bytes
> of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
> the first freeoob area.
>
> Signed-off-by: Liu Shuo <[email protected]>
> Signed-off-by: Li Yang <[email protected]>
...
> /*
> * Process user arguments
> @@ -197,15 +198,40 @@ int main(int argc, char *argv[])
> if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
> return sys_errmsg("%s: unable to get NAND
> oobinfo", mtd_device);
>
> + cleanmarker.totlen = cpu_to_je32(8);
> /* Check for autoplacement */
> if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
> + struct nand_ecclayout_user ecclayout;
> /* Get the position of the free bytes */
> - if (!oobinfo.oobfree[0][1])
> + if (ioctl(fd, ECCGETLAYOUT, &ecclayout) != 0)
> + return sys_errmsg("%s: unable to get
> NAND ecclayout", mtd_device);
> +
Hmm, shouldn't we instead make MTD_OOB_AUTO be available for userspace
via an ioctl instead and make flash_eraseall use it instead?
--
Best Regards,
Artem Bityutskiy
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev