On Tue, Sep 15, 2026 at 09:32:49PM -0700, Haren Myneni wrote:
For CPU ADD, the device tree entries are retrieved with
configure-connector RTAS call and attached to the device tree.
Then the CPU is added as part of DT node notification. If the CPU
ADD notifier returns failure, the corresponding CPU node entries
should be deleted from the device-tree. See pseries_add_processor()
for the possible failure cases.
The current code does not remove CPU node entries during CPU ADD
notifier failure and causing the following issues:
- Can not add this CPU later since already present in the
device-tree.
- Trying to free memory allocated to CPU node without detaching
the node and it causes freeing its sibling node (existing CPU
nodes).
This patch fixes this issue by calling of_detach_node_no_notify()
for the failure from CPU ADD notifier which removes CPU node
entries without calling CPU REMOVE notifier.
Would using the of_changeset_ API directly solve your issue? It's better
designed for handling reverting a changeset. The of_attach_node/
of_detach_node() APIs have limited users and I'd really like to remove
them. Or make them PPC specific perhaps. Looks like there is 1 non-PPC
user that snuck in.
Rob