From: Huang Shijie <b32955@freescale.com>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH] ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1
Date: Wed, 9 Oct 2013 17:00:12 +0800 [thread overview]
Message-ID: <52551B1C.4080608@freescale.com> (raw)
In-Reply-To: <1379470659-12158-1-git-send-email-b32955@freescale.com>
于 2013年09月18日 10:17, Huang Shijie 写道:
> 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@freescale ~$ 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 fixes it.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
> drivers/mtd/ubi/build.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index a561335..006f98a 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -638,7 +638,7 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
> dbg_gen("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb));
> dbg_gen("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry));
>
> - if (ubi->mtd->numeraseregions != 0) {
> + if (ubi->mtd->numeraseregions > 1) {
> /*
> * Some flashes have several erase regions. Different regions
> * may have different eraseblock size and other
Hi Artem:
could you please check this patch?
thanks
Huang Shijie
next prev parent reply other threads:[~2013-10-09 8:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 2:17 [PATCH] ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1 Huang Shijie
2013-10-09 9:00 ` Huang Shijie [this message]
2013-10-26 9:47 ` Artem Bityutskiy
2013-10-28 2:57 ` Huang Shijie
2013-11-05 6:12 ` Huang Shijie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52551B1C.4080608@freescale.com \
--to=b32955@freescale.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.