[cdi-devel] [PATCH 0/3] Rework device creation mechanism
Max Reitz ·
Kevin Wolf wrote: >> The OS then looks after a >> registered USB device driver which is able to handle that device. > > Registered means running here, right? If so, it doesn't use help any > further. What Matt is talking about is _launching_ the driver if it's > not running. We have a device 8086:100e, no running driver likes the > device and we need to find out that we should start e1000. Well, what do you mean with not running? Not even loaded? I don't know how you want to start a not loaded driver upon device detection. No problem in a monolithic kernel, of course - all drivers are "loaded" right from loading the kernel because they're all in the kernel. But a driver needs to register itself somehow, be it active or passive. The current model for USB is active registering (call a function), but there's no problem about making it passive (store information in a new section or whatever about the devices to be handled). Anyway the OS must (just imo, of course ;-)) load the driver first to know which devices it's able to handle. The only "escape" would be to name the driver in a way the OS can search a driver by its name - i. e. call that e1000 driver "8086-100e". But that's imo stupid (sorry, I just say it in that way, because nobody except me suggested this model up to now *g*) because the name of a driver _in the filesystem_ is totally unrelated to CDI. So one must _load_ a driver before knowing which devices it is able to handle. And if you use a "passive" registration system, loading means registering. Hence, registered is not forced to mean running (just in the active model) but to mean loaded. With your new driver registration model (the new section called "cdi_drivers") CDI changed from such an active model to a passive model. Every driver is registered just by loading it into memory and before it is actually started (by calling the "init" method). I'm sorry, if all I told you was simply crap and totally unrelated to your opinion. ;-)