public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix Jffs2 type flash erase problem
@ 2018-04-09  3:10 Xiaolei Li
       [not found] ` <1523243410-65424-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Xiaolei Li @ 2018-04-09  3:10 UTC (permalink / raw)
  To: david.oberhollenzer-S6VGOU4v5edDinCvNWH78Q,
	boris.brezillon-LDxbnhwyfcJBDgjK7y7TUQ
  Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	xiaolei.li-NuS5LvNUpcJWk0Htik3J/w,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w

Jffs2 clean marker is not written actually, because OOB write length is
set to 0 when do mtd_write(). So, "-j" option of flash_erase is usless now.

This patch adds support to access OOB available size by
/sys/class/mtd/mtdX/oobavail. Then, user can write clean marker to OOB
free area with the minimum size between OOB available size and 8. This
is the same with Jffs2 itself. Please refer the function
jffs2_write_nand_cleanmarker() in the kernel file fs/jffs2/wbuf.c.

And this patch depends on the reviewing patch "mtd: Add sysfs attribute for
mtd OOB available size"[1].

Changes relative to:
--------------------
tree	: https://github.com/sigma-star/mtd-utils
branch	: master
commit	:
	'commit 80de29a464c7 ("mkfs.ubifs: Allow root entry in device
	 table")'

Tests:
------
* do "flash_erase -j" operation on SLC NAND MT29F16G08ADBCA, which page
  size is 4096, oob size is 224.
* mount jffs2 file system, do "dd" test, and there is no problem.

[1] https://patchwork.kernel.org/patch/10319475/

Xiaolei Li (2):
  libmtd: Add support to access OOB available size
  misc-utils: flash_erase: Fix Jffs2 type flash erase problem

 include/libmtd.h         | 2 ++
 lib/libmtd.c             | 7 +++++++
 lib/libmtd_int.h         | 3 +++
 misc-utils/flash_erase.c | 9 +++++----
 4 files changed, 17 insertions(+), 4 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-09  9:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-09  3:10 [PATCH 0/2] Fix Jffs2 type flash erase problem Xiaolei Li
     [not found] ` <1523243410-65424-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-09  3:10   ` [PATCH 1/2] libmtd: Add support to access OOB available size Xiaolei Li
     [not found]     ` <1523243410-65424-2-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-09  6:58       ` David Oberhollenzer
     [not found]         ` <99d17022-0b07-a999-b6ac-05b51df7d18d-S6VGOU4v5edDinCvNWH78Q@public.gmane.org>
2018-04-09  7:25           ` xiaolei li
2018-04-09  7:35             ` Boris Brezillon
2018-04-09  8:33               ` xiaolei li
2018-04-09  8:37                 ` Boris Brezillon
2018-04-09  8:45                   ` xiaolei li
2018-04-09  8:53                     ` David Oberhollenzer
     [not found]                       ` <bec14308-33e1-d158-37d2-4f59047f0016-S6VGOU4v5edDinCvNWH78Q@public.gmane.org>
2018-04-09  9:01                         ` xiaolei li
2018-04-09  3:10   ` [PATCH 2/2] misc-utils: flash_erase: Fix Jffs2 type flash erase problem Xiaolei Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox