]> git.baikalelectronics.ru Git - uboot.git/commit
dfu: mtd: skip empty pages when writing page for UBI partition
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 18 Jan 2022 09:26:21 +0000 (10:26 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 28 Jan 2022 22:58:41 +0000 (17:58 -0500)
commiteead8db340a9729d969ec0a28217245d665fd462
tree348e13d87ae05eab5a98c68db962912aafe6d28d
parent29ae5715155d53131a7329ac98f64f4d79ade5c3
dfu: mtd: skip empty pages when writing page for UBI partition

Align the DFU MTD backend for the UBI partitions with the mtd command write
behavior when the option .dontskipff is not used: don't write the empty
pages (full of 0xFF); it is not required for UBI, see [1] for details.

This patch avoids the "free space fixup" procedure in the kernel [2]
and allows to program a UBIFS volume generated by mkfs.ubifs without the
option -F, --space-fixup.

The MTD DFU backend implements this behavior introduced on DFU NAND
backend by the commit 1c48336687c5 ("dfu: Add option to skip empty pages
when flashing UBI images to NAND") and also supported by the command nand
by CONFIG_CMD_NAND_TRIMFFS and by commit c9494866df83 ("cmd_nand: add nand
write.trimffs command").

[1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo
[2] http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/dfu/dfu_mtd.c