Re: [PATCH 1/6] software node: Provide replacement for device_add_properties()

From: Rafael J. Wysocki
Date: Wed Feb 03 2021 - 09:41:24 EST


On Wed, Feb 3, 2021 at 3:27 PM Heikki Krogerus
<heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Feb 03, 2021 at 02:50:24PM +0100, Rafael J. Wysocki wrote:
> > On Wed, Feb 3, 2021 at 10:45 AM Heikki Krogerus
> > <heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
> > >
> > > On Tue, Feb 02, 2021 at 05:08:40PM +0100, Rafael J. Wysocki wrote:
> > > > It looks like there is a use case that cannot be addressed by using
> > > > device_add_properties() and that's why you need this new function.
> > > >
> > > > Can you describe that use case, please, and explain what the problem
> > > > with using device_add_properties() in it is?
> > >
> > > The problem with device_add_properties() is that it gives false
> > > impression that the device properties are somehow directly attached to
> > > the devices, which is not true. Now, that should not be a major issue,
> > > but it seems that it is. I think Lee Jones basically used that as an
> > > argument to refuse changes (and pretty minor changes) that would have
> > > allowed us to use software nodes with the MFD drivers.
> > >
> > > Nevertheless, I was not planning to provide a replacement for it
> > > originally. We do in any case have the real issue caused by that
> > > device_remove_properties() call in device_del() which has to be fixed.
> >
> > What's that issue, specifically?
>
> The problem is that we can't now reuse or share if necessary, or just
> in general be in charge of the lifetime of the software nodes because
> that call is in device_del(). Now the lifetime of the software nodes
> is always tied to the devices they are attached, no questions asked.

I see and so instead you want the reference counting to trigger the
cleanup when the count gets to 0.

Sounds reasonable to me and please put this information into the patch
changelog.