[PATCH] UBI:Force ubi driver load after mtd device drivers

Artem Bityutskiy dedekind1 at gmail.com
Fri Aug 24 06:03:17 EDT 2012


On Fri, 2012-08-24 at 12:41 +0300, Artem Bityutskiy wrote:
> On Wed, 2012-08-08 at 10:31 +0800, Jiang Lu wrote:
> > 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);
> 
> The problem is that UBIFS, which is usually used on top of UBI, also
> uses 'late_initcall()'. If we do this change, how do we guarantee that
> UBIFS is initialized after UBI?

It looks like the right way to fix the issue is to change the way UBI
initializes. We should not try to open the MTD device, scan it and
attach in the initcall. We should instead delay this till the first
open. So when you open the device for the firs time, you actually end up
with the scanning, etc.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120824/41b5dd00/attachment.sig>


More information about the linux-mtd mailing list