[PATCH] OF device tree update (2.5)

Paul Mackerras paulus at samba.org
Tue Oct 14 16:35:04 EST 2003


Nathan Lynch writes:

> The attached patch allows the addition and removal of Open Firmware
> device tree nodes at runtime, after the system has booted.  This
> capability is desirable for supporting hotplug of devices that have
> representations in /proc/device-tree (e.g. PCI devices, CPUs).
>
> 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.

It's not acceptable to have write and writev do different things.
The only difference between write and writev is in the layout of the
data in memory.  In other words, writev with a 1-element iovec should
be completely equivalent to write.

> 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.

This part sounds OK.  Does anything in the ppc64 world use the addrs,
n_addrs, intrs or n_intrs fields of the device node?  Maybe you can
leave out the initialization of those fields when you add a node.
(Ben H has suggested getting rid of them.)

Regards,
Paul.

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





More information about the Linuxppc64-dev mailing list