Skip to contentSkip to conversation

ls102xa: psci: save context id in cpu_on command

PATCH New Patrick Delaunay 4 participants 18 messages Apr 16, 2018 – May 8, 2018

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

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)

---

 arch/arm/cpu/armv7/ls102xa/psci.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/ls102xa/psci.S +2 -1
index e1dc5f3..a355c88 100644
@@ -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
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/6 imx7: 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)

---

 arch/arm/mach-imx/mx7/psci.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mx7/psci.S +2 -1
index bc2cd8a..7ee2dd7 100644
@@ -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
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/6 imx7: psci: save context id in cpu_on command

Quoted 4 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/6c2774e2/attachment.sig>
#3 lore raw

PATCH 2/6 imx7: psci: save context id in cpu_on command

In reply to Patrick Delaunay
Quoted 4 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/28407760/attachment.sig>
#4 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

In reply to Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

---

 arch/arm/mach-tegra/psci.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/psci.S +2 -1
index 645d08f..448df83 100644
@@ -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
Signature · 1 line
2.7.4
#5 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

Quoted 2 lines · Patrick Delaunay

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,

Quoted 10 lines
arch/arm/mach-tegra/psci.S +2 -1
@@ -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
#6 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

Hi Stephen,

Quoted 5 lines

From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command
Importance: High

Quoted 7 lines
Quoted 2 lines · Patrick Delaunay

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 ?

Quoted 1 line

Patrick

#7 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

Quoted 15 lines · Patrick DELAUNAY

Hi Stephen,

Quoted 5 lines

From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command
Importance: High

Quoted 7 lines
Quoted 2 lines · Patrick Delaunay

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,

Quoted 8 lines

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.

#8 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

Quoted 19 lines · Stephen Warren
Quoted 18 lines · Patrick DELAUNAY

Hi Stephen,

Quoted 5 lines

From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Subject: Re: [U-Boot] [PATCH 3/6] tegra: psci: save context id in cpu_on command
Importance: High

Quoted 7 lines
Quoted 2 lines · Patrick Delaunay

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.

Quoted 8 lines
Quoted 5 lines

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! :)

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180418/b9513568/attachment.sig>
#9 lore raw

PATCH 3/6 tegra: psci: save context id in cpu_on command

In reply to Patrick Delaunay
Quoted 5 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/91fcb909/attachment.sig>
#10 lore raw

PATCH 4/6 uniphier: psci: save context id in cpu_on command

In reply to Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

---

 arch/arm/mach-uniphier/arm32/psci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-uniphier/arm32/psci.c +5 -2
index efe7419..af33cd4 100644
@@ -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;
Signature · 1 line
2.7.4
#12 lore raw

PATCH 4/6 uniphier: psci: save context id in cpu_on command

In reply to Patrick Delaunay
Quoted 5 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/db6ab2a1/attachment.sig>
#13 lore raw

PATCH 5/6 sunxi: psci: save context id in cpu_on command

In reply to Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

---

 arch/arm/cpu/armv7/sunxi/psci.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/cpu/armv7/sunxi/psci.c +4 -3
index 18da9cb..11b21fe 100644
@@ -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);
Signature · 1 line
2.7.4
#14 lore raw

PATCH 5/6 sunxi: psci: save context id in cpu_on command

Quoted 4 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/d101cf5d/attachment.sig>
#15 lore raw

PATCH 6/6 psci: arm: remove armv7 function psci_save_target_pc

In reply to Patrick Delaunay

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.

---

 arch/arm/cpu/armv7/psci-common.c | 7 -------
 arch/arm/include/asm/psci.h      | 3 +--
 2 files changed, 1 insertion(+), 9 deletions(-)
arch/arm/cpu/armv7/psci-common.c +0 -7
index 73f986b..a328b2b 100644
@@ -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;
arch/arm/include/asm/psci.h +1 -2
index b415241..95f18e8 100644
@@ -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);
Signature · 1 line
2.7.4
#16 lore raw

PATCH 6/6 psci: arm: remove armv7 function psci_save_target_pc

Quoted 7 lines · Patrick Delaunay

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/48c813ba/attachment.sig>
#17 lore raw

PATCH 1/6 ls102xa: psci: save context id in cpu_on command

In reply to Patrick Delaunay
Quoted 5 lines · Patrick Delaunay

Replace the psci_save_target_pc call by the new function psci_save(cpu, pc,context_id)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/2d265d21/attachment.sig>