* [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init
@ 2014-07-10 1:20 Tyrel Datwyler
2014-07-10 2:33 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Tyrel Datwyler @ 2014-07-10 1:20 UTC (permalink / raw)
To: linuxppc-dev; +Cc: grant.likely, nfont, Tyrel Datwyler
Commit 75b57ecf9 refactored device tree nodes to use kobjects such that they
can be exposed via /sysfs. A secondary commit 0829f6d1f 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 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.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/dlpar.c | 1 +
arch/powerpc/platforms/pseries/reconfig.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 022b38e..2d0b4d6 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -86,6 +86,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
}
of_node_set_flag(dn, OF_DYNAMIC);
+ of_node_init(dn);
return dn;
}
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 0435bb6..1c0a60d 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -69,6 +69,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
np->properties = proplist;
of_node_set_flag(np, OF_DYNAMIC);
+ of_node_init(np);
np->parent = derive_parent(path);
if (IS_ERR(np->parent)) {
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init
2014-07-10 1:20 [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init Tyrel Datwyler
@ 2014-07-10 2:33 ` Michael Ellerman
2014-07-10 13:40 ` Nathan Fontenot
2014-07-10 18:36 ` Tyrel Datwyler
0 siblings, 2 replies; 4+ messages in thread
From: Michael Ellerman @ 2014-07-10 2:33 UTC (permalink / raw)
To: Tyrel Datwyler; +Cc: grant.likely, nfont, linuxppc-dev
On Wed, 2014-07-09 at 21:20 -0400, Tyrel Datwyler wrote:
> Commit 75b57ecf9 refactored device tree nodes to use kobjects such that they
> can be exposed via /sysfs. A secondary commit 0829f6d1f 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 as a result of dynamically added nodes being uninitialized.
So does this mean DLPAR is broken since 0829f6d1f (3.15-rc1)?
If so this should have a Cc: stable@kernel.org shouldn't it?
And the latest trend is to also add:
Fixes: 0829f6d1f69e ("of: device_node kobject lifecycle fixes")
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init
2014-07-10 2:33 ` Michael Ellerman
@ 2014-07-10 13:40 ` Nathan Fontenot
2014-07-10 18:36 ` Tyrel Datwyler
1 sibling, 0 replies; 4+ messages in thread
From: Nathan Fontenot @ 2014-07-10 13:40 UTC (permalink / raw)
To: Michael Ellerman, Tyrel Datwyler; +Cc: grant.likely, linuxppc-dev
On 07/09/2014 09:33 PM, Michael Ellerman wrote:
> On Wed, 2014-07-09 at 21:20 -0400, Tyrel Datwyler wrote:
>> Commit 75b57ecf9 refactored device tree nodes to use kobjects such that they
>> can be exposed via /sysfs. A secondary commit 0829f6d1f 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 as a result of dynamically added nodes being uninitialized.
>
> So does this mean DLPAR is broken since 0829f6d1f (3.15-rc1)?
Yes. Partition migration would also be affected by this.
-Nathan
>
> If so this should have a Cc: stable@kernel.org shouldn't it?
>
> And the latest trend is to also add:
>
> Fixes: 0829f6d1f69e ("of: device_node kobject lifecycle fixes")
>
> cheers
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init
2014-07-10 2:33 ` Michael Ellerman
2014-07-10 13:40 ` Nathan Fontenot
@ 2014-07-10 18:36 ` Tyrel Datwyler
1 sibling, 0 replies; 4+ messages in thread
From: Tyrel Datwyler @ 2014-07-10 18:36 UTC (permalink / raw)
To: Michael Ellerman; +Cc: grant.likely, nfont, linuxppc-dev
On 07/09/2014 07:33 PM, Michael Ellerman wrote:
> On Wed, 2014-07-09 at 21:20 -0400, Tyrel Datwyler wrote:
>> Commit 75b57ecf9 refactored device tree nodes to use kobjects such that they
>> can be exposed via /sysfs. A secondary commit 0829f6d1f 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 as a result of dynamically added nodes being uninitialized.
>
> So does this mean DLPAR is broken since 0829f6d1f (3.15-rc1)?
Yes, as well as suspend and migration.
>
> If so this should have a Cc: stable@kernel.org shouldn't it?
Doh, right you are.
>
> And the latest trend is to also add:
>
> Fixes: 0829f6d1f69e ("of: device_node kobject lifecycle fixes")
Got it. Will resend v2.
-Tyrel
>
> cheers
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-10 18:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10 1:20 [PATCH] powerpc/pseries: dynamically added OF nodes need to call of_node_init Tyrel Datwyler
2014-07-10 2:33 ` Michael Ellerman
2014-07-10 13:40 ` Nathan Fontenot
2014-07-10 18:36 ` Tyrel Datwyler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).