All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Lukas Wunner <lukas@wunner.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH] device property: Track owner device of device property
Date: Tue, 24 Oct 2017 16:41:21 +0300	[thread overview]
Message-ID: <fcde8be2-e19b-901c-b8fe-8dc54d1e847d@linux.intel.com> (raw)
In-Reply-To: <20171020143423.GA27882@kroah.com>

On 10/20/2017 05:34 PM, Greg Kroah-Hartman wrote:
>> @@ -938,6 +940,7 @@ int device_add_properties(struct device *dev,
>>   
>>   	p->fwnode.ops = &pset_fwnode_ops;
>>   	set_secondary_fwnode(dev, &p->fwnode);
>> +	p->dev = dev;
> 
> Don't you also need to increment the reference counter here?  Or how is
> it assured that it will not go away?
> 
I need to scratch my head on this. It sounds more robust to track 
references and remove properties when last reference is dropped in 
device_remove_properties(). What I don't know are properties be expected 
to be copied and be usable for another device for instance by 
ACPI_COMPANION_SET().

I can figure out case where properties are added to one device, another 
device gets reference to them via ACPI_COMPANION_SET() and properties 
get freed when the first device is removed. But should the second device 
be able to use those properties at first place?

Rafael: What's you opinion: should there be reference counting for 
device properties? Initial increment in device_add_properties(), other 
around ACPI_COMPANION_SET()/set_primary_fwnode() and decrementing in 
device_remove_properties().

-- 
Jarkko

      reply	other threads:[~2017-10-24 13:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 13:28 [PATCH] device property: Track owner device of device property Jarkko Nikula
2017-10-20 14:34 ` Greg Kroah-Hartman
2017-10-24 13:41   ` Jarkko Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcde8be2-e19b-901c-b8fe-8dc54d1e847d@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=rjw@rjwysocki.net \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.