[PATCH] of_add_property and property list locking (2.5)
Nathan Lynch
nathanl at austin.ibm.com
Wed Nov 26 04:36:05 EST 2003
Benjamin Herrenschmidt wrote:
> On Tue, 2003-11-25 at 16:06, Nathan Lynch wrote:
>>
>>We need the ability to add custom properties to OF device nodes in
>>certain situations (e.g. cpu hotplug). And if we're going to be adding
>>properties, we need some sort of locking for struct device_node's
>>properties list. I've also added a public proc_device_tree_add_property
>>interface to fs/proc/proc_devtree.c to avoid duplication of code.
>>
>>The natural thing to follow this would be deprecating get_property in
>>favor of a function (of_get_property?) that takes the new lock when
>>searching the property list.
>
>
> Hrm... how do you protect the property content against deletion ?
The only place that deletes properties afaik is the of_remove_node code.
Properties are not deleted until their node is removed from the tree
and the global list -- meaning that no other users should have
references to the node or its properties at that time.
If you are thinking of reference counts for properties, this is doable.
But don't you think it could wait until we are deleting properties
outside the context of deleting a device node?
Nathan
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list