Excessive scanning of empty space due to point/unpoint methods

Joakim Tjernlund joakim.tjernlund at transmode.se
Mon Mar 26 05:47:53 EDT 2007

I have noticed that the point/unpoint methods used by default by
cfi_cmdset_0001.c causes excessive scanning of empty flash space.
My mount time goes down from ~15 seconds to <1 second if I
remove the extra scanning.

point/unpoint sets buf_size to 0 in jffs2_scan_medium and that
makes jffs2_scan_eraseblock assume a scan length equal to
sector size:
	if (!buf_size) {
		/* This is the XIP case -- we're reading _directly_ from the flash chip */
		buf_len = c->sector_size;
	} else {
		buf_len = EMPTY_SCAN_SIZE(c->sector_size);
		err = jffs2_fill_scan_buf(c, buf, buf_ofs, buf_len);
		if (err)
			return err;
This apperently has something to do with XIP but I don't know much
about the requierments of XIP so could someone comment why XIP
needs to scan the whole flash?


More information about the linux-mtd mailing list