Skip to content

Commit 97a9a71

Browse files
Tyrel Datwylerozbenh
authored andcommitted
powerpc/pseries: dynamically added OF nodes need to call of_node_init
Commit 75b57ec refactored device tree nodes to use kobjects such that they can be exposed via /sysfs. A secondary commit 0829f6d furthered this rework by moving the kobect initialization logic out of of_node_add into its own of_node_init function. The inital commit removed the existing kref_init calls in the pseries dlpar code with the assumption kobject initialization would occur in of_node_add. The second commit had the side effect of triggering a BUG_ON during DLPAR, migration and suspend/resume operations as a result of dynamically added nodes being uninitialized. This patch fixes this by adding of_node_init calls in place of the previously removed kref_init calls. Fixes: 0829f6d ("of: device_node kobject lifecycle fixes") Cc: stable@vger.kernel.org Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent dad6f37 commit 97a9a71

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

arch/powerpc/platforms/pseries/dlpar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
8686
}
8787

8888
of_node_set_flag(dn, OF_DYNAMIC);
89+
of_node_init(dn);
8990

9091
return dn;
9192
}

arch/powerpc/platforms/pseries/reconfig.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
6969

7070
np->properties = proplist;
7171
of_node_set_flag(np, OF_DYNAMIC);
72+
of_node_init(np);
7273

7374
np->parent = derive_parent(path);
7475
if (IS_ERR(np->parent)) {

0 commit comments

Comments
 (0)