arm64: skip cpu nodes marked as disabled in DT
PATCH 1/1 arm64: skip cpu nodes marked as disabled in DT
Skip the CPU nodes that are marked as disabled in DT.
Bug 1828570
Reviewed-on: http://git-master/r/1245333
--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/kernel/smp.c +4 -0
@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn); +/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +if (hwid ==INVALID_HWID ) goto next;
Signature · 1 line
2.1.4
Adding few other folks.
Thanks
Rohit
________________________________________
From: Rohit Khanna
Sent: Wednesday, April 25, 2018 4:08 PM
To: [email protected]; [email protected]
Cc: [email protected]; Rohit Khanna
Subject: [PATCH] arm64: skip cpu nodes marked as disabled in DT
Skip the CPU nodes that are marked as disabled in DT.
Bug 1828570
Reviewed-on: http://git-master/r/1245333
--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/kernel/smp.c +4 -0
@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn); +/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +if (hwid ==INVALID_HWID ) goto next;
--
2.1.4
Catalin Marinas
maintainerQuoted 1 line · Rohit Khanna
Adding few other folks.
It looks fine to me but cc'ing Mark and Lorenzo (and it should have been posted on [email protected]).
Quoted 34 lines
From: Rohit Khanna
Sent: Wednesday, April 25, 2018 4:08 PM
To: [email protected]; [email protected]
Cc: [email protected]; Rohit Khanna
Subject: [PATCH] arm64: skip cpu nodes marked as disabled in DTSkip the CPU nodes that are marked as disabled in DT.
Bug 1828570
Signed-off-by Rohit Khanna <[email protected]>Reviewed-on: http://git-master/r/1245333
Reviewed-by Alexander Van Brunt <[email protected]>--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/kernel/smp.c +4
-1@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn); +/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +if (hwid ==INVALID_HWID ) goto next; --2.1.4
Quoted 15 lines · Catalin Marinas
Quoted 1 line · Rohit Khanna
Adding few other folks.
It looks fine to me but cc'ing Mark and Lorenzo (and it should have been posted on [email protected]).
Quoted 9 lines
From: Rohit Khanna
Sent: Wednesday, April 25, 2018 4:08 PM
To: [email protected]; [email protected]
Cc: [email protected]; Rohit Khanna
Subject: [PATCH] arm64: skip cpu nodes marked as disabled in DTSkip the CPU nodes that are marked as disabled in DT.
Bug 1828570
That's not information that can be used in its current form, which bug-tracking system ?
Quoted 2 lines
Quoted 2 lines
Signed-off-by Rohit Khanna <[email protected]>Reviewed-on: http://git-master/r/1245333
If it is a public mailing list discussion the
Link:
tag and the lkml redirector should be used, I do not know what the redirector used here is though.
Process is defined here:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
Quoted 13 lines
Quoted 13 lines
Reviewed-by Alexander Van Brunt <[email protected]>--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/kernel/smp.c +0
-0@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn);
Quoted 4 lines
arch/arm64/kernel/smp.c static void __init of_parse_and_init_cpus(void) · line 584
Quoted 4 lines
arch/arm64/kernel/smp.c +4
-0+/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +
This was discussed a long time ago and kind of dropped - I digged the thread out of archives for everyone's information:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/174324.html
Lorenzo
Thanks Lorenzo for pulling out the old thread.
So just to make sure my understanding is correct from the discussion on that thread, below is not a preferred approach.
"If CPUs are marked as disabled in the devicetree, make sure they do not exist in the system CPU information and CPU topology information."
The reason is because - "The meaning of disabled for cpus in ePAPR is that the cpu is offline (i.e. in a spinloop or wfi), not that the cpu is unavailable."
Preferred approach is -
"Since with this approach the DT should change anyway if on different
Quoted 3 lines
hardware devices based on the same chip you want to allow booting a different number of CPUs, why do not we remove the cpu nodes instead of disabling them"
Thanks
Rohit
________________________________________
From: Lorenzo Pieralisi <[email protected]>
Sent: Thursday, April 26, 2018 3:18 AM
To: Catalin Marinas; Rohit Khanna
Cc: [email protected]; [email protected]; Thierry Reding; Alexander Van Brunt; Bo Yan; Jason Sequeira; Mark Rutland
Subject: Re: [PATCH] arm64: skip cpu nodes marked as disabled in DT
Quoted 15 lines · Catalin Marinas
Quoted 1 line · Rohit Khanna
Adding few other folks.
It looks fine to me but cc'ing Mark and Lorenzo (and it should have been posted on [email protected]).
Quoted 9 lines
From: Rohit Khanna
Sent: Wednesday, April 25, 2018 4:08 PM
To: [email protected]; [email protected]
Cc: [email protected]; Rohit Khanna
Subject: [PATCH] arm64: skip cpu nodes marked as disabled in DTSkip the CPU nodes that are marked as disabled in DT.
Bug 1828570
That's not information that can be used in its current form, which bug-tracking system ?
Quoted 2 lines
Quoted 2 lines
Signed-off-by Rohit Khanna <[email protected]>Reviewed-on: http://git-master/r/1245333
If it is a public mailing list discussion the
Link:
tag and the lkml redirector should be used, I do not know what the redirector used here is though.
Process is defined here:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
Quoted 13 lines
Quoted 13 lines
Reviewed-by Alexander Van Brunt <[email protected]>--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/kernel/smp.c +0
-0@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn);
Quoted 4 lines
arch/arm64/kernel/smp.c static void __init of_parse_and_init_cpus(void) · line 584
Quoted 4 lines
arch/arm64/kernel/smp.c +4
-0+/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +
This was discussed a long time ago and kind of dropped - I digged the thread out of archives for everyone's information:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/174324.html
Lorenzo
Quoted 9 lines · Rohit Khanna
Thanks Lorenzo for pulling out the old thread.
So just to make sure my understanding is correct from the discussion on that thread, below is not a preferred approach.
"If CPUs are marked as disabled in the devicetree, make sure they do not exist in the system CPU information and CPU topology information."
Quoted 10 lines
The reason is because - "The meaning of disabled for cpus in ePAPR is that the cpu is offline (i.e. in a spinloop or wfi), not that the cpu is unavailable."
Preferred approach is -
"Since with this approach the DT should change anyway if on differentQuoted 3 lines
hardware devices based on the same chip you want to allow booting a different number of CPUs, why do not we remove the cpu nodes instead of disabling them"
Yes, I think that's the best course of action and it was the outcome of that email thread.
Lorenzo
Quoted 67 lines
Thanks
Rohit
________________________________________
From: Lorenzo Pieralisi <[email protected]>
Sent: Thursday, April 26, 2018 3:18 AM
To: Catalin Marinas; Rohit Khanna
Cc: [email protected]; [email protected]; Thierry Reding; Alexander Van Brunt; Bo Yan; Jason Sequeira; Mark Rutland
Subject: Re: [PATCH] arm64: skip cpu nodes marked as disabled in DTQuoted 15 lines · Catalin Marinas
Quoted 1 line · Rohit Khanna
Adding few other folks.
It looks fine to me but cc'ing Mark and Lorenzo (and it should have been posted on [email protected]).
Quoted 9 lines
From: Rohit Khanna
Sent: Wednesday, April 25, 2018 4:08 PM
To: [email protected]; [email protected]
Cc: [email protected]; Rohit Khanna
Subject: [PATCH] arm64: skip cpu nodes marked as disabled in DTSkip the CPU nodes that are marked as disabled in DT.
Bug 1828570
That's not information that can be used in its current form, which bug-tracking system ?
Quoted 2 lines
Quoted 2 lines
Signed-off-by Rohit Khanna <[email protected]>Reviewed-on: http://git-master/r/1245333
If it is a public mailing list discussion the
Link:
tag and the lkml redirector should be used, I do not know what the redirector used here is though.
Process is defined here:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
Quoted 13 lines
Quoted 13 lines
Reviewed-by Alexander Van Brunt <[email protected]>--- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/kernel/smp.c +0
-0@@ -578,6 +578,10 @@ static void __init of_parse_and_init_cpus(void)for_each_node_by_type (dn,"cpu" ) {u64 hwid =of_get_cpu_mpidr (dn);Quoted 4 lines
arch/arm64/kernel/smp.c static void __init of_parse_and_init_cpus(void) · line 584
Quoted 4 lines
arch/arm64/kernel/smp.c +4
-0+/* Check to see if the cpu is disabled */ +if (!of_device_is_available (dn)) + goto next; +This was discussed a long time ago and kind of dropped - I digged the thread out of archives for everyone's information:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/174324.html
Lorenzo