[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cdi-devel] [PATCH 0/3] Rework device creation mechanism
On Wed, Dec 30, 2009 at 09:13:02AM +1000, Matthew Iselin wrote:
> On Wed, Dec 30, 2009 at 4:51 AM, Kevin Wolf <kevin@xxxxxxxxxx> wrote:
> > Making it library driven should solve these problems and might simplify
> > adaption to OS specific needs as an extra bonus (I'm thinking of
> > Pedigree's pDev here).
> Sounds great - certainly seems to be a major improvement that will
> make CDI more dynamic.
> I'm wondering if this may be an important stepping stone towards a
> system where the OS can not only load devices on-demand (and in
> hotplug circumstances), but where the OS can also load _drivers_ when
> devices are detected. For example, a table linking devices to CDI
> driver names, which the OS can use to load drivers on the fly rather
> than have a static set of drivers loaded at any one time.
I've never thought about doing this in CDI, but probably it's a good
idea. I think linking devices to driver names should actually be linking
a cdi_bus_addr to a driver name. For PCI devices this would be based on
device and vendor IDs.
I think what we could do now very easily is to add some table of valid
addresses to each driver.
However, there is also a harder part. Let's forget PCI for a while now,
it's not a CDI driver (might be a future project, too). USB looks much
more like the generic case. And imagine a microkernel approach where
each CDI driver runs in its own process. Who is responsible for the
drivers (probably the driver providing the bus?), what information does
it need (list of all available drivers and their list of supported
bus_addrs) and where can it get the information from? The last question
is probably the most interesting one: We need the table for all
installed drivers, but the drivers are not yet running. So this is
something that cannot be hidden in the CDI library.
Hm, brain dump completed on this topic, I think. Maybe it helps, maybe
it doesn't. ;-)
> I think this idea may be out of the scope of this specific patchset
> discussion, however. I will work on a proper proposal and interface
> while I am unable to access the internet over the next week, and
> submit it to the list.
Sounds great. I'm sure you'll find a nice answer to my questions.