[U-Boot] [PATCH 1/6] ls102xa: psci: save context id in cpu_on command

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/cpu/armv7/ls102xa/psci.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/ls102xa/psci.S b/arch/arm/cpu/armv7/ls102xa/psci.S index e1dc5f3..a355c88 100644 --- a/arch/arm/cpu/armv7/ls102xa/psci.S +++ b/arch/arm/cpu/armv7/ls102xa/psci.S @@ -125,7 +125,8 @@ psci_cpu_on:
mov r0, r4 mov r1, r2 - bl psci_save_target_pc + mov r2, r3 + bl psci_save mov r1, r4
@ Get DCFG base address

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/mach-imx/mx7/psci.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mx7/psci.S b/arch/arm/mach-imx/mx7/psci.S index bc2cd8a..7ee2dd7 100644 --- a/arch/arm/mach-imx/mx7/psci.S +++ b/arch/arm/mach-imx/mx7/psci.S @@ -24,7 +24,8 @@ psci_cpu_on: mov r5, r1 mov r0, r1 mov r1, r2 - bl psci_save_target_pc + mov r2, r3 + bl psci_save
mov r0, r4 mov r1, r5

On Mon, Apr 16, 2018 at 10:15:08AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Applied to u-boot/master, thanks!

On Mon, Apr 16, 2018 at 10:15:08AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Applied to u-boot/master, thanks!

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/mach-tegra/psci.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/psci.S b/arch/arm/mach-tegra/psci.S index 645d08f..448df83 100644 --- a/arch/arm/mach-tegra/psci.S +++ b/arch/arm/mach-tegra/psci.S @@ -90,7 +90,8 @@ ENTRY(psci_cpu_on) mov r4, r1 mov r0, r1 mov r1, r2 - bl psci_save_target_pc @ store target PC + mov r2, r3 + bl psci_save @ store target PC and context id mov r1, r4
ldr r6, =TEGRA_RESET_EXCEPTION_VECTOR

On 04/16/2018 02:15 AM, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
So this function doesn't actually exist since it's added in a different patch series that isn't mentioned as a dependency. Luckily I managed to find it in the list archives I have, and assuming the dependency is applied first,
Reviewed-by: Stephen Warren swarren@nvidia.com
diff --git a/arch/arm/mach-tegra/psci.S b/arch/arm/mach-tegra/psci.S
@@ -90,7 +90,8 @@ ENTRY(psci_cpu_on) mov r4, r1 mov r0, r1 mov r1, r2
- bl psci_save_target_pc @ store target PC
- mov r2, r3
- bl psci_save @ store target PC and context id mov r1, r4

Hi Stephen,
From: Stephen Warren [mailto:swarren@wwwdotorg.org] Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command Importance: High
On 04/16/2018 02:15 AM, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
So this function doesn't actually exist since it's added in a different patch series that isn't mentioned as a dependency. Luckily I managed to find it in the list archives I have, and assuming the dependency is applied first,
Thanks for the review and sorry for the dependency with http://patchwork.ozlabs.org/patch/898507/ Not indicated in the patchset.
For information, I plan this development after Mark Rutland remarks on v1 in http://patchwork.ozlabs.org/patch/888210/
I decide to send the serie in 2 separate patches as the second part is more a cleanup patch and need to be review tested by each maintainers.
Do you think I need to RESEND this serie with a cover letter to indicate the dependency ?
Reviewed-by: Stephen Warren swarren@nvidia.com
Patrick

On 04/18/2018 07:58 AM, Patrick DELAUNAY wrote:
Hi Stephen,
From: Stephen Warren [mailto:swarren@wwwdotorg.org] Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command Importance: High
On 04/16/2018 02:15 AM, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
So this function doesn't actually exist since it's added in a different patch series that isn't mentioned as a dependency. Luckily I managed to find it in the list archives I have, and assuming the dependency is applied first,
Thanks for the review and sorry for the dependency with http://patchwork.ozlabs.org/patch/898507/ Not indicated in the patchset.
For information, I plan this development after Mark Rutland remarks on v1 in http://patchwork.ozlabs.org/patch/888210/
I decide to send the serie in 2 separate patches as the second part is more a cleanup patch and need to be review tested by each maintainers.
Do you think I need to RESEND this serie with a cover letter to indicate the dependency ?
I imagine this part of the thread is enough to alert Tom. If you need to resend the series for some reason, you can add the note then.

On Wed, Apr 18, 2018 at 09:23:36AM -0600, Stephen Warren wrote:
On 04/18/2018 07:58 AM, Patrick DELAUNAY wrote:
Hi Stephen,
From: Stephen Warren [mailto:swarren@wwwdotorg.org] Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command Importance: High
On 04/16/2018 02:15 AM, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
So this function doesn't actually exist since it's added in a different patch series that isn't mentioned as a dependency. Luckily I managed to find it in the list archives I have, and assuming the dependency is applied first,
Thanks for the review and sorry for the dependency with http://patchwork.ozlabs.org/patch/898507/ Not indicated in the patchset.
For information, I plan this development after Mark Rutland remarks on v1 in http://patchwork.ozlabs.org/patch/888210/
I decide to send the serie in 2 separate patches as the second part is more a cleanup patch and need to be review tested by each maintainers.
Do you think I need to RESEND this serie with a cover letter to indicate the dependency ?
I imagine this part of the thread is enough to alert Tom. If you need to resend the series for some reason, you can add the note then.
I'll keep this all in mind when I eventually apply things, thanks! :)

On Mon, Apr 16, 2018 at 10:15:09AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com Reviewed-by: Stephen Warren swarren@nvidia.com
Applied to u-boot/master, thanks!

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/mach-uniphier/arm32/psci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-uniphier/arm32/psci.c b/arch/arm/mach-uniphier/arm32/psci.c index efe7419..af33cd4 100644 --- a/arch/arm/mach-uniphier/arm32/psci.c +++ b/arch/arm/mach-uniphier/arm32/psci.c @@ -131,7 +131,8 @@ void psci_arch_init(void)
u32 uniphier_psci_holding_pen_release __secure_data = 0xffffffff;
-int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point) +int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, + u32 context_id) { u32 cpu = cpuid & 0xff;
@@ -139,9 +140,11 @@ int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point) debug_puth(cpuid); debug_puts(", entry_point="); debug_puth(entry_point); + debug_puts(", context_id="); + debug_puth(context_id); debug_puts("\n");
- psci_save_target_pc(cpu, entry_point); + psci_save(cpu, entry_point, context_id);
/* We assume D-cache is off, so do not call flush_dcache() here */ uniphier_psci_holding_pen_release = cpu;

2018-04-16 17:15 GMT+09:00 Patrick Delaunay patrick.delaunay@st.com:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Acked-by: Masahiro Yamada yamada.masahiro@socionext.com

On Mon, Apr 16, 2018 at 10:15:10AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com Acked-by: Masahiro Yamada yamada.masahiro@socionext.com
Applied to u-boot/master, thanks!

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/cpu/armv7/sunxi/psci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index 18da9cb..11b21fe 100644 --- a/arch/arm/cpu/armv7/sunxi/psci.c +++ b/arch/arm/cpu/armv7/sunxi/psci.c @@ -243,14 +243,15 @@ out: cp15_write_scr(scr); }
-int __secure psci_cpu_on(u32 __always_unused unused, u32 mpidr, u32 pc) +int __secure psci_cpu_on(u32 __always_unused unused, u32 mpidr, u32 pc, + u32 context_id) { struct sunxi_cpucfg_reg *cpucfg = (struct sunxi_cpucfg_reg *)SUNXI_CPUCFG_BASE; u32 cpu = (mpidr & 0x3);
- /* store target PC */ - psci_save_target_pc(cpu, pc); + /* store target PC and context id */ + psci_save(cpu, pc, context_id);
/* Set secondary core power on PC */ sunxi_set_entry_address(&psci_cpu_entry);

On Mon, Apr 16, 2018 at 10:15:11AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Applied to u-boot/master, thanks!

This function is no more used, and replaced by psci_save which save also context id as requested by PSCI requirements.
Even if the context id is not used by Linux, it should be saved and restored in r0 when the CPU_ON is performed.
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com ---
arch/arm/cpu/armv7/psci-common.c | 7 ------- arch/arm/include/asm/psci.h | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/arm/cpu/armv7/psci-common.c b/arch/arm/cpu/armv7/psci-common.c index 73f986b..a328b2b 100644 --- a/arch/arm/cpu/armv7/psci-common.c +++ b/arch/arm/cpu/armv7/psci-common.c @@ -27,13 +27,6 @@ static u32 psci_target_pc[CONFIG_ARMV7_PSCI_NR_CPUS] __secure_data = { 0 }; static u32 psci_context_id[CONFIG_ARMV7_PSCI_NR_CPUS] __secure_data = { 0 };
-void __secure psci_save_target_pc(int cpu, u32 pc) -{ - psci_target_pc[cpu] = pc; - psci_context_id[cpu] = 0; - dsb(); -} - void __secure psci_save(int cpu, u32 pc, u32 context_id) { psci_target_pc[cpu] = pc; diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h index b415241..95f18e8 100644 --- a/arch/arm/include/asm/psci.h +++ b/arch/arm/include/asm/psci.h @@ -93,10 +93,9 @@ #ifndef __ASSEMBLY__ #include <asm/types.h>
-/* These 4 helper functions assume cpu < CONFIG_ARMV7_PSCI_NR_CPUS */ +/* These 3 helper functions assume cpu < CONFIG_ARMV7_PSCI_NR_CPUS */ u32 psci_get_target_pc(int cpu); u32 psci_get_context_id(int cpu); -void psci_save_target_pc(int cpu, u32 pc); void psci_save(int cpu, u32 pc, u32 context_id);
void psci_cpu_entry(void);

On Mon, Apr 16, 2018 at 10:15:12AM +0200, Patrick Delaunay wrote:
This function is no more used, and replaced by psci_save which save also context id as requested by PSCI requirements.
Even if the context id is not used by Linux, it should be saved and restored in r0 when the CPU_ON is performed.
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Applied to u-boot/master, thanks!

On Mon, Apr 16, 2018 at 10:15:07AM +0200, Patrick Delaunay wrote:
Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)
Signed-off-by: Patrick Delaunay patrick.delaunay@st.com
Applied to u-boot/master, thanks!
participants (5)
-
Masahiro Yamada
-
Patrick DELAUNAY
-
Patrick Delaunay
-
Stephen Warren
-
Tom Rini