Re: [PATCH 4/5] UBI: introduce attach ioctls

Artem Bityutskiy
2007-12-21T08:43:34Z

On Thu, 2007-12-20 at 22:34 +0100, Arnd Bergmann wrote:
> > Err, why should MTD know something about what sits on top of it? Today
> > it is UBI, tommorrow it is something new and better, e.g., more
> > scalable.
>
> The way you would implement this is to have the UBI code grab hold of all
> the MTD devices, and create the ubi-probe attribute in them. This is
> something that is easily possible with the device model, provided that
> we can get a 'struct device' embedded into 'struct mtd_info'. I just realized
> that this is currently missing.

Ok, now I see what you mean. Well, may be some day we make MTD
LDM-enabled. But apart of this, I really do not see any benefit in
ubi-probe stuff. It's about closer integration of 2 separate things,
which does not sound good for me.

> > Yeah, user-space tools could format media. But it is so much appropriate
> > facility to have UBI being able to format it itself. It is really very
> > convenient. Flashes have special state - empty flash, and if the flash
> > is empty - UBI make it UBI-formatted. If the flash has some garbage -
> > UBI does not format it.
>
> Ok, another idea: just create an UBI device for every MTD device, but don't
> probe until the UBI device is first accessed. That way, you don't need
> any dynamic registration, and you can use an ioctl on the device itself
> in order to do the initial formatting with new parameters.

Well, it is technically possible, but requires a lot of code which does
not really worth it. I still think having a control "misc" device is
quite elegant solution.

--
Best regards,
Artem Bityutskiy (Битюцкий Артём)