Thread (4 messages) flat view 4 messages, 2 authors, 3d ago

Re: [PATCH 2/2] powerpc/pseries/dlpar: Remove DT entries if failure from CPU ADD notifier

From: Rob Herring <robh@kernel.org>
Date: 2026-09-16 21:33:12
Also in: linux-devicetree

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help