Re: [PATCH RFD] alternative kobject release wait mechanism

From: Tejun Heo
Date: Fri Apr 20 2007 - 12:52:28 EST


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.

--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/