[PATCH 2/2] ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1
Rajeev Kumar
rajeev_kumar at mentor.com
Mon Jul 25 04:16:57 PDT 2016
Richard
On 07/25/2016 04:01 PM, Richard Weinberger wrote:
> Rajeev,
>
> Am 25.07.2016 um 11:46 schrieb Rajeev Kumar:
>> If the master mtd does not have any slave mtd partitions,
>> and its numeraseregions is one(only has one erease block), and
>> we attach the master mtd with : ubiattach -m 0 -d 0
>>
>> We will meet the error:
>> -------------------------------------------------------
>> root ~$ ubiattach /dev/ubi_ctrl -m 0 -d 0
>> UBI: attaching mtd0 to ubi0
>> UBI error: io_init: multiple regions, not implemented
>> ubiattach: error!: cannot attach mtd0
>> error 22 (Invalid argument)
>> -------------------------------------------------------
>>
>> In fact, if there is only one "erase block", we should not
>> prevent the attach.
>>
>> This patch is tested against 3.14 kernel and only build test is
>> performed against current upstream master branch.
>
> The more interesting question is, why is ->numeraseregions not 0?
>
> The comment in the header says:
> /* Data for variable erase regions. If numeraseregions is zero,
> * it means that the whole device has erasesize as given above.
> */
>
> So, if your MTD erase regions with the same size, it should be 0.
>
> IIRC we had such a discussion already on linux-mtd and it was not clear
> whether numeraseregions of 0 and 1 are equal or not.
>
Could you please pass the link
Thanks in advance
~Rajeev
> Thanks,
> //richard
>
More information about the linux-mtd
mailing list