From: Warrick <warrick.jiang@gmail.com>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: linux-mtd@lists.infradead.org, Jiang Lu <lu.jiang@windriver.com>
Subject: Re: [PATCH] UBI:Force ubi driver load after mtd device drivers
Date: Thu, 09 Aug 2012 13:46:50 +0800 [thread overview]
Message-ID: <50234ECA.3070409@gmail.com> (raw)
In-Reply-To: <CAFLxGvzoXrOhmG=0Jd5My_sEowsUXrG3=HWHR8JUYkCFs-cWHg@mail.gmail.com>
于 2012年08月09日 05:52, richard -rw- weinberger 写道:
> On Wed, Aug 8, 2012 at 4:31 AM, Jiang Lu <lu.jiang@windriver.com> wrote:
>> To implement rootfs on mtd device with UBIFS, kernel need create a
>> UBIFS device when booting:
>>
>> drivers/mtd/ubi/build.c ubi_init()
>> for (i = 0; i < mtd_devs; i++) {
>> ...
>> mtd = open_mtd_device(p->name);
>> if (IS_ERR(mtd)) {
>> err = PTR_ERR(mtd);
>> goto out_detach;
>> }
>>
>> ubi_attach_mtd_dev()
>> ...
>> }
>> module_init(ubi_init);
>>
>> Kernel can not create the UBIFS device without corresponding mtd
>> partiton.
>>
>> Some NAND device can not guarenteen the mtd patition created before
>> UBIFS deivce driver loading. Such as SPI NAND deivce, the mtd partition
>> will create after SPI bus driver loaded.
>>
>> UBI device driver must load after other mtd device drivers to make sure
>> the mtd partition already exist when creating UBI deivce.
>>
>> The patch updates the UBI device driver's initial routine to
>> late_initcall level.
>>
>> Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
>> ---
>> drivers/mtd/ubi/build.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
>> index 0fde9fc..efbcaef 100644
>> --- a/drivers/mtd/ubi/build.c
>> +++ b/drivers/mtd/ubi/build.c
>> @@ -1275,7 +1275,7 @@ out:
>> ubi_err("UBI error: cannot initialize UBI, error %d", err);
>> return err;
>> }
>> -module_init(ubi_init);
>> +late_initcall(ubi_init);
> Cant we use a simple initrd in such a case?
> Within the initrd you can load the ubi module after your SPI NAND is done.
>
This could be a workround. But for the ubi device driver, kernel should
invoke ubi_init() after all mtd partition ready.
next prev parent reply other threads:[~2012-08-09 5:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 2:31 [PATCH] UBI:Force ubi driver load after mtd device drivers Jiang Lu
2012-08-08 21:52 ` richard -rw- weinberger
2012-08-09 5:46 ` Warrick [this message]
2012-08-24 9:41 ` Artem Bityutskiy
2012-08-24 10:03 ` Artem Bityutskiy
2012-08-24 11:24 ` Artem Bityutskiy
2012-08-27 1:10 ` Lu.Jiang
2012-08-28 13:52 ` Artem Bityutskiy
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=50234ECA.3070409@gmail.com \
--to=warrick.jiang@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=lu.jiang@windriver.com \
--cc=richard.weinberger@gmail.com \
/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.