[PATCH] ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1

Artem Bityutskiy dedekind1 at gmail.com
Sat Oct 26 02:47:50 PDT 2013


On Wed, 2013-09-18 at 10:17 +0800, Huang Shijie wrote:
> -	if (ubi->mtd->numeraseregions != 0) {
> +	if (ubi->mtd->numeraseregions > 1) {

The purpose of this code is to refuse "composite" mtd devices, simply
because UBIFS authors never had any of them and did not know how to deal
with them.

numeraseregions == 0 means "no erase regions". This is the ABI, as we
expose this piece of information via sysfs, see
"Documentation/ABI/testing/sysfs-class-mtd".

numeraseregions > 1 means that this is some kind of a composite flash
consisting of several regions with different eraseblock sizes. I've
never saw these, but I guess there is always one large "main" region and
some small special-purpose regions.

What is 'numeraseregions == 1'? How is it different to 'numeraseregions
== 0'?

Is the "main" area covered by mtd->size, or 'mtd->size' spans the entire
chip and includes all the regions?

What is the flash you are dealing with? Surely this is not gpmi-nand?

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list