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

Huang Shijie b32955 at freescale.com
Sun Oct 27 19:57:33 PDT 2013


于 2013年10月26日 17:47, Artem Bityutskiy 写道:
> 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?
>
i think the mtd->size spans the entire chip and include the all the regions.


> What is the flash you are dealing with? Surely this is not gpmi-nand?
I meet this bug with a Micron's Parallel Nor: M29W256GL
it is not used by the gpmi-nand, it's used by weim driver: 
drivers/bus/imx-weim.c

this NOR's Number of erase block regions is 1, i quote the test here, 
see page 50
(i will send you the datasheet in a private email):

"
   It specifes the number of regions containning contiguous erase blocks 
of the same size.

"

please see allocate_partition():

   
---------------------------------------------------------------------------------
   if (master->numeraseregions > 1) {
       ................
   } else {
       /* Single erase size */
   }

   
---------------------------------------------------------------------------------

this NOR is 32MB, its master partion has 1 for "numeraseregions". if we 
add a 32MB slave partition
  to this NOR, the slave partition does NOT inherit the numeraseregions 
of the master partition.
So the ubiattach will succeed with the slave partition.

But if we attach the master partition directly, we will fails.

thanks
Huang Shijie









More information about the linux-mtd mailing list