[PATCH] OF device tree update (2.5)

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Oct 11 18:49:21 EST 2003


> The mechanism for initiating addition or removal of a node is
> /proc/ppc64/ofdt.  The write() callback for the the file takes the
> pathname (relative to the base of the device tree) of the node to
> remove.  The writev() callback for the file takes the pathname of the
> node to be added, followed by name-value pairs for the properties.  This
> file is meant for use by userspace tools that would also be initiating
> the proper RTAS operations for a hotplug operation.

I don't like _at all_ the way you hijack write() vs. ritev() semantics.

Especially having write() do something fundamentally different than
writev().

I think you either need one single entry taking a "command word"
followed by the arguments instead, or use 2 different /proc entries
for adding and deleting nodes. I prefer the command word though as
it could later be extended to also add/remove individual properties,
or other actions we may want to provide via this interface.

> The device tree and global list are protected by a read-write spinlock.
>       The device_node structure has gained a reference count, a flags
> field, and a few fields for keeping track of procfs entries.  There is
> no per-node lock at this time.
>
> I have included the ppc64 and arch-independent bits all in one patch.
> (This includes the "keep track of proc entries in device nodes" stuff I
> posted a couple of days ago).  Patch is against latest ameslab bk (cset
> 1.1460).

Note that we still need some locking on properties access. I'm afraid we
can't do that & keep the current get_property() semantics though...

Ben.


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list