On 4/20/07, Tejun Heo <[email protected]> wrote:
Hello, Dmitry.
Dmitry Torokhov wrote:
>> Many drivers (at least all the SCSI/IDE ones) consider struct device as
>> the base class of the devices those drivers implement. I don't think we
>> can just consider those drivers to be wrong.
>
> I am not saying they are wrong I am just saying that driver core is
> not where most work is done. Every subsystem has its own locking rules
> and lifetime rules and they are what is important. Whether subsystem
> uses embedding or referencing of struct devices is implementation
> detail.
>
> What is the goal of driver core? I thought the main goal was to have
> an uniform interface for device power management and presentation of
> device tree to userspace. It has nothing to do with main purposes of
> every individual subsystem - making some set of devices/services work.
I think we're running in circle here.
1. The driver's lifetime rules matters but currently the driver model
imposes reference counted model to each struct device.
2. You can decouple struct device completely from actual driver
implementation.
I agree with you that #2 is possible but just don't think it's the right
thing to do. By making struct device independent from driver
implementation doesn't help solving lifetime problems in drivers. It
just insulates driver model from those.
Isn't think a good thing? By decoupling the 2 layers we insulate them
from changes in each other. This allows bug subsystems to concentrate
on topics that important to them instead of worying about refcounting
objects that are not directly interesting for the subsystem in
question.
Now for smaller subsystems it may make sense to embed stuct devices
into subsystem objects and manage it all together. In fact input
system does this but I think it is much simlpier than SCSI or IDE.
--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]