Skip to contentSkip to conversation

powerpc/powernv: Fix CPU_HOTPLUG=n idle.c compile error

PATCH Applied Nicholas Piggin 6 participants 16 messages May 11, 2017 – May 30, 2017

Subsystems (2)
lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/3 powerpc/powernv: Fix CPU_HOTPLUG=n idle.c compile error

Fixes a7cd88da97 ("powerpc/powernv: Move CPU-Offline idle state invocation from smp.c to idle.c")
Cc Gautham R. Shenoy <[email protected]>
---
 arch/powerpc/platforms/powernv/idle.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powernv/idle.c +2 -0
index 445f30a2c5ef..0c21747ed7e0 100644
@@ -261,6 +261,7 @@ static u64 pnv_deepest_stop_psscr_val;
 static u64 pnv_deepest_stop_psscr_mask;
 static bool deepest_stop_found;
 
+#ifdef CONFIG_HOTPLUG_CPU
 /*
  * pnv_cpu_offline: A function that puts the CPU into the deepest
  * available platform idle state on a CPU-Offline.
@@ -293,6 +294,7 @@ unsigned long pnv_cpu_offline(unsigned int cpu)
 
 	return srr1;
 }
+#endif
 
 /*
  * Power ISA 3.0 idle initialization.
Signature · 1 line
2.11.0
author reviewer
#1 lore raw

PATCH 2/3 powerpc/32: tlbie provide L operand explicitly

The single-operand form of tlbie used to be accepted as the second operand (L) being implicitly 0. Newer binutils reject this.

Change remaining single-op tlbie instructions to have explicit 0 second argument.

Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/include/asm/ppc_asm.h      | 2 +-
 arch/powerpc/kernel/head_32.S           | 2 +-
 arch/powerpc/kernel/head_8xx.S          | 8 ++++----
 arch/powerpc/kernel/swsusp_32.S         | 2 +-
 arch/powerpc/mm/hash_low_32.S           | 8 ++++----
 arch/powerpc/mm/mmu_decl.h              | 2 +-
 arch/powerpc/platforms/powermac/sleep.S | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)
arch/powerpc/include/asm/ppc_asm.h +1 -1
index 359c44341761..6e250733912a 100644
@@ -418,7 +418,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 	lis	r4,KERNELBASE@h;		\
 	.machine push;				\
 	.machine "power4";			\
-0:	tlbie	r4;				\
+0:	tlbie	r4,0;				\
 	.machine pop;				\
 	addi	r4,r4,0x1000;			\
 	bdnz	0b
arch/powerpc/kernel/head_32.S +1 -1
index e22734278458..c0be7f9654ac 100644
@@ -1103,7 +1103,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
 flush_tlbs:
 	lis	r10, 0x40
 1:	addic.	r10, r10, -0x1000
-	tlbie	r10
+	tlbie	r10,0
 	bgt	1b
 	sync
 	blr
arch/powerpc/kernel/head_8xx.S +4 -4
index c032fe8c2d26..dda28cad8024 100644
@@ -317,9 +317,9 @@ SystemCall:
 #ifdef CONFIG_8xx_CPU15
 #define INVALIDATE_ADJACENT_PAGES_CPU15(tmp, addr)	\
 	addi	tmp, addr, PAGE_SIZE;	\
-	tlbie	tmp;			\
+	tlbie	tmp,0;			\
 	addi	tmp, addr, -PAGE_SIZE;	\
-	tlbie	tmp
+	tlbie	tmp,0
 #else
 #define INVALIDATE_ADJACENT_PAGES_CPU15(tmp, addr)
 #endif
@@ -572,7 +572,7 @@ InstructionTLBError:
 	mr	r5,r9
 	andis.	r10,r5,0x4000
 	beq+	1f
-	tlbie	r4
+	tlbie	r4,0
 itlbie:
 	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
 1:	EXC_XFER_LITE(0x400, handle_page_fault)
@@ -597,7 +597,7 @@ DARFixed:/* Return from dcbx instruction bug workaround */
 	mfspr	r4,SPRN_DAR
 	andis.	r10,r5,0x4000
 	beq+	1f
-	tlbie	r4
+	tlbie	r4,0
 dtlbie:
 1:	li	r10,RPN_PATTERN
 	mtspr	SPRN_DAR,r10	/* Tag DAR, to be used in DTLB Error */
arch/powerpc/kernel/swsusp_32.S +1 -1
index ba4dee3d233f..cb26ab39a8d5 100644
@@ -302,7 +302,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
 	/* Flush all TLBs */
 	lis	r4,0x1000
 1:	addic.	r4,r4,-0x1000
-	tlbie	r4
+	tlbie	r4,0
 	bgt	1b
 	sync
 
arch/powerpc/mm/hash_low_32.S +4 -4
index 6f962e5cb5e1..31dfbc51a3f1 100644
@@ -350,7 +350,7 @@ _GLOBAL(hash_page_patch_A)
 	 */
 	andi.	r6,r6,_PAGE_HASHPTE
 	beq+	10f			/* no PTE: go look for an empty slot */
-	tlbie	r4
+	tlbie	r4,0
 
 	addis	r4,r7,htab_hash_searches@ha
 	lwz	r6,htab_hash_searches@l(r4)
@@ -610,7 +610,7 @@ _GLOBAL(flush_hash_patch_B)
 3:	li	r0,0
 	STPTE	r0,0(r12)		/* invalidate entry */
 4:	sync
-	tlbie	r4			/* in hw tlb too */
+	tlbie	r4,0			/* in hw tlb too */
 	sync
 
 8:	ble	cr1,9f			/* if all ptes checked */
@@ -659,7 +659,7 @@ _GLOBAL(_tlbie)
 	stwcx.	r8,0,r9
 	bne-	10b
 	eieio
-	tlbie	r3
+	tlbie	r3,0
 	sync
 	TLBSYNC
 	li	r0,0
@@ -668,7 +668,7 @@ _GLOBAL(_tlbie)
 	SYNC_601
 	isync
 #else /* CONFIG_SMP */
-	tlbie	r3
+	tlbie	r3,0
 	sync
 #endif /* CONFIG_SMP */
 	blr
arch/powerpc/mm/mmu_decl.h +1 -1
index f988db655e5b..9b9e780b8003 100644
@@ -55,7 +55,7 @@ extern void _tlbil_pid_noind(unsigned int pid);
 static inline void _tlbil_va(unsigned long address, unsigned int pid,
 			     unsigned int tsize, unsigned int ind)
 {
-	asm volatile ("tlbie %0; sync" : : "r" (address) : "memory");
+	asm volatile ("tlbie %0,0; sync" : : "r" (address) : "memory");
 }
 #elif defined(CONFIG_PPC_BOOK3E)
 extern void _tlbil_va(unsigned long address, unsigned int pid,
arch/powerpc/platforms/powermac/sleep.S +1 -1
index 1c2802fabd57..7991ae5b83f6 100644
@@ -347,7 +347,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
 	/* Flush all TLBs */
 	lis	r4,0x1000
 1:	addic.	r4,r4,-0x1000
-	tlbie	r4
+	tlbie	r4,0
 	blt	1b
 	sync
 
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 2/3] powerpc/32: tlbie provide L operand explicitly

Quoted 5 lines · Nicholas Piggin

The single-operand form of tlbie used to be accepted as the second operand (L) being implicitly 0. Newer binutils reject this.

Change remaining single-op tlbie instructions to have explicit 0 second argument.

Do old(er) binutils accept the two operand version?

cheers

author reviewer
#3 lore raw

Re: [PATCH 2/3] powerpc/32: tlbie provide L operand explicitly

Quoted 10 lines · Michael Ellerman
Quoted 5 lines · Nicholas Piggin

The single-operand form of tlbie used to be accepted as the second operand (L) being implicitly 0. Newer binutils reject this.

Change remaining single-op tlbie instructions to have explicit 0 second argument.

Do old(er) binutils accept the two operand version?

They should going back to 2002, but now I dig further into it, the problem is
my cross compiler that is not setting the cpu / ISA version correctly. So powerpc32 CPUs with current binutils tlbie second parameter is still optional
AFAIKS.

So this patch is not required.

Thanks,
Nick

author reviewer
#4 lore raw

PATCH 3/3 powerpc/8xx: xmon compile fix

In reply to Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +4 -1
index f11f65634aab..ec420b0e6e88 100644
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx
+	int mode;
 	const char badaddr[] = "Only kernel addresses are permitted "
 		"for breakpoints\n";
+#endif
 
 	cmd = inchar();
 	switch (cmd) {
Signature · 1 line
2.11.0
#5 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx

Would be better to use CONFIG_PPC_8xx

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

Christophe

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1254

Quoted 8 lines
arch/powerpc/xmon/xmon.c +2 -0
+	int mode;
 	const char badaddr[] = "Only kernel addresses are permitted "
 		"for breakpoints\n";
+#endif
 
 	cmd = inchar();
 	switch (cmd) {

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#6 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

Quoted 25 lines · christophe leroy
Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
     int cmd;
     unsigned long a;
-    int mode, i;
+    int i;
     struct bpt *bp;
+#ifndef CONFIG_8xx

Would be better to use CONFIG_PPC_8xx

Quoted 2 lines

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

I had the same comment in https://patchwork.ozlabs.org/patch/700354/
I also suggested to move the relevant declarations inside the switch()

Christophe

Quoted 10 lines

Christophe

Quoted 5 lines
arch/powerpc/xmon/xmon.c +2 -0
+    int mode;
     const char badaddr[] = "Only kernel addresses are permitted "
         "for breakpoints\n";
+#endif
 
Quoted 8 lines

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1254

Quoted 3 lines
arch/powerpc/xmon/xmon.c +0 -0
     cmd = inchar();
     switch (cmd) {

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

author reviewer
#7 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

Quoted 26 lines · On Thu, 11 May 2017 20:52:56 +0200 christophe leroy <[email protected]>…
Quoted 25 lines · christophe leroy
Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
     int cmd;
     unsigned long a;
-    int mode, i;
+    int i;
     struct bpt *bp;
+#ifndef CONFIG_8xx  

Would be better to use CONFIG_PPC_8xx

Quoted 5 lines
Quoted 2 lines

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

I had the same comment in https://patchwork.ozlabs.org/patch/700354/
I also suggested to move the relevant declarations inside the switch()

Apologies, you did. I was just cleaning out an old backlog of patches and I forgot about your comments. Sorry, I'll resend the patch.

Thanks,
Nick

author reviewer
#8 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

In reply to christophe leroy
Quoted 26 lines · On Thu, 11 May 2017 20:52:56 +0200 christophe leroy <[email protected]>…
Quoted 25 lines · christophe leroy
Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
     int cmd;
     unsigned long a;
-    int mode, i;
+    int i;
     struct bpt *bp;
+#ifndef CONFIG_8xx  

Would be better to use CONFIG_PPC_8xx

Quoted 5 lines
Quoted 2 lines

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

I had the same comment in https://patchwork.ozlabs.org/patch/700354/
I also suggested to move the relevant declarations inside the switch()

How's this one?

---
 arch/powerpc/xmon/xmon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/powerpc/xmon/xmon.c +6 -4
index f11f65634aab..438fdb0fb142 100644
@@ -1242,14 +1242,16 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
-	const char badaddr[] = "Only kernel addresses are permitted "
-		"for breakpoints\n";
 
 	cmd = inchar();
 	switch (cmd) {
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
+	int mode;
+	const char badaddr[] = "Only kernel addresses are permitted "
+		"for breakpoints\n";
+
 	case 'd':	/* bd - hardware data breakpoint */
 		mode = 7;
 		cmd = inchar();
Signature · 1 line
2.11.0
#9 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

Quoted 29 lines · Nicholas Piggin
Quoted 26 lines · On Thu, 11 May 2017 20:52:56 +0200 christophe leroy <[email protected]>…
Quoted 25 lines · christophe leroy
Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
     int cmd;
     unsigned long a;
-    int mode, i;
+    int i;
     struct bpt *bp;
+#ifndef CONFIG_8xx

Would be better to use CONFIG_PPC_8xx

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

I had the same comment in https://patchwork.ozlabs.org/patch/700354/
I also suggested to move the relevant declarations inside the switch()

How's this one?

Looks good.

Christophe

Quoted 31 lines
---
 arch/powerpc/xmon/xmon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/powerpc/xmon/xmon.c +6 -4
index f11f65634aab..438fdb0fb142 100644
@@ -1242,14 +1242,16 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
-	const char badaddr[] = "Only kernel addresses are permitted "
-		"for breakpoints\n";
 
 	cmd = inchar();
 	switch (cmd) {
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
+	int mode;
+	const char badaddr[] = "Only kernel addresses are permitted "
+		"for breakpoints\n";
+
 	case 'd':	/* bd - hardware data breakpoint */
 		mode = 7;
 		cmd = inchar();
#10 lore raw

Re: [PATCH 3/3] powerpc/8xx: xmon compile fix

In reply to Nicholas Piggin
Quoted 15 lines · Nicholas Piggin
arch/powerpc/xmon/xmon.c +1 -3
index f11f65634aab..438fdb0fb142 100644
@@ -1242,14 +1242,16 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
-	const char badaddr[] =3D "Only kernel addresses are permitted "
-		"for breakpoints\n";

=20=20

arch/powerpc/xmon/xmon.c +0 -0
 	cmd =3D inchar();

arch/powerpc/xmon/xmon.c bpt_cmds(void)

Quoted 10 lines
arch/powerpc/xmon/xmon.c +5 -1
 	switch (cmd) {
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
+	int mode;
+	const char badaddr[] =3D "Only kernel addresses are permitted "
+		"for breakpoints\n";
+
 	case 'd':	/* bd - hardware data breakpoint */
 		mode =3D 7;
 		cmd =3D inchar();

GCC 7 rejects this:

arch/powerpc/xmon/xmon.c: In function =E2=80=98bpt_cmds=E2=80=99:
arch/powerpc/xmon/xmon.c:1252:13: error: statement will never be executed=
[-Werror=3Dswitch-unreachable]

    const char badaddr[] =3D "Only kernel addresses are permitted for break=
points\n";
               ^~~~~~~

I'll go back to the earlier version.

cheers

#11 lore raw

RE: [PATCH 3/3] powerpc/8xx: xmon compile fix

RnJvbTogIE1pY2hhZWwgRWxsZXJtYW4NCj4gU2VudDogMjYgTWF5IDIwMTcgMDg6MjQNCj4gTmlj aG9sYXMgUGlnZ2luIDxucGlnZ2luQGdtYWlsLmNvbT4gd3JpdGVzOg0KPiA+IGRpZmYgLS1naXQg YS9hcmNoL3Bvd2VycGMveG1vbi94bW9uLmMgYi9hcmNoL3Bvd2VycGMveG1vbi94bW9uLmMNCj4g PiBpbmRleCBmMTFmNjU2MzRhYWIuLjQzOGZkYjBmYjE0MiAxMDA2NDQNCj4gPiAtLS0gYS9hcmNo L3Bvd2VycGMveG1vbi94bW9uLmMNCj4gPiArKysgYi9hcmNoL3Bvd2VycGMveG1vbi94bW9uLmMN Cj4gPiBAQCAtMTI0MiwxNCArMTI0MiwxNiBAQCBicHRfY21kcyh2b2lkKQ0KPiA+ICB7DQo+ID4g IAlpbnQgY21kOw0KPiA+ICAJdW5zaWduZWQgbG9uZyBhOw0KPiA+IC0JaW50IG1vZGUsIGk7DQo+ ID4gKwlpbnQgaTsNCj4gPiAgCXN0cnVjdCBicHQgKmJwOw0KPiA+IC0JY29uc3QgY2hhciBiYWRh ZGRyW10gPSAiT25seSBrZXJuZWwgYWRkcmVzc2VzIGFyZSBwZXJtaXR0ZWQgIg0KPiA+IC0JCSJm b3IgYnJlYWtwb2ludHNcbiI7DQo+ID4NCj4gPiAgCWNtZCA9IGluY2hhcigpOw0KPiA+ICAJc3dp dGNoIChjbWQpIHsNCj4gPiAtI2lmbmRlZiBDT05GSUdfOHh4DQo+ID4gKyNpZm5kZWYgQ09ORklH X1BQQ184eHgNCj4gPiArCWludCBtb2RlOw0KPiA+ICsJY29uc3QgY2hhciBiYWRhZGRyW10gPSAi T25seSBrZXJuZWwgYWRkcmVzc2VzIGFyZSBwZXJtaXR0ZWQgIg0KPiA+ICsJCSJmb3IgYnJlYWtw b2ludHNcbiI7DQo+ID4gKw0KPiA+ICAJY2FzZSAnZCc6CS8qIGJkIC0gaGFyZHdhcmUgZGF0YSBi cmVha3BvaW50ICovDQo+ID4gIAkJbW9kZSA9IDc7DQo+ID4gIAkJY21kID0gaW5jaGFyKCk7DQo+ IA0KPiBHQ0MgNyByZWplY3RzIHRoaXM6DQo+IA0KPiAgIGFyY2gvcG93ZXJwYy94bW9uL3htb24u YzogSW4gZnVuY3Rpb24gYnB0X2NtZHM6DQo+ICAgYXJjaC9wb3dlcnBjL3htb24veG1vbi5jOjEy NTI6MTM6IGVycm9yOiBzdGF0ZW1lbnQgd2lsbCBuZXZlciBiZSBleGVjdXRlZCBbLVdlcnJvcj1z d2l0Y2gtDQo+IHVucmVhY2hhYmxlXQ0KPiAgICAgY29uc3QgY2hhciBiYWRhZGRyW10gPSAiT25s eSBrZXJuZWwgYWRkcmVzc2VzIGFyZSBwZXJtaXR0ZWQgZm9yIGJyZWFrcG9pbnRzXG4iOw0KPiAg ICAgICAgICAgICAgICBefn5+fn5+DQoNClRyeSAnc3RhdGljJyA/DQoNCglEYXZpZA0KDQo=

#12 lore raw

RE: [PATCH 3/3] powerpc/8xx: xmon compile fix

Quoted 31 lines · David Laight

From: Michael Ellerman

Quoted 30 lines

Sent: 26 May 2017 08:24

Quoted 15 lines · Nicholas Piggin
arch/powerpc/xmon/xmon.c +1 -3
index f11f65634aab..438fdb0fb142 100644
@@ -1242,14 +1242,16 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
-	const char badaddr[] = "Only kernel addresses are permitted "
-		"for breakpoints\n";
 
 	cmd = inchar();

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1257

Quoted 10 lines
arch/powerpc/xmon/xmon.c +5 -1
 	switch (cmd) {
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
+	int mode;
+	const char badaddr[] = "Only kernel addresses are permitted "
+		"for breakpoints\n";
+
 	case 'd':	/* bd - hardware data breakpoint */
 		mode = 7;
 		cmd = inchar();

GCC 7 rejects this:

Quoted 7 lines
Quoted 5 lines

arch/powerpc/xmon/xmon.c: In function bpt_cmds:
arch/powerpc/xmon/xmon.c:1252:13: error: statement will never be executed [-Werror=switch-
unreachable]

    const char badaddr[] = "Only kernel addresses are permitted for breakpoints\n";
               ^~~~~~~

Try 'static' ?

Yep that works, will rebase this again ... O_o

cheers

#13 lore raw

Re: [3/3] powerpc/8xx: xmon compile fix

In reply to Nicholas Piggin
Quoted 29 lines · Nicholas Piggin
Quoted 26 lines · On Thu, 11 May 2017 20:52:56 +0200 christophe leroy <[email protected]>…
Quoted 25 lines · christophe leroy
Quoted 12 lines · Nicholas Piggin
Cc Scott Wood <[email protected]>
Cc Christophe Leroy <[email protected]>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/xmon/xmon.c +0 -0
index f11f65634aab..ec420b0e6e88 100644

arch/powerpc/xmon/xmon.c bpt_cmds(void) · line 1247

Quoted 7 lines
arch/powerpc/xmon/xmon.c +2 -1
@@ -1242,10 +1242,13 @@ bpt_cmds(void)
 {
     int cmd;
     unsigned long a;
-    int mode, i;
+    int i;
     struct bpt *bp;
+#ifndef CONFIG_8xx  

Would be better to use CONFIG_PPC_8xx

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

As stated in arch/powerpc/platform/Kconfig.cputype, CONFIG_8xx is temp to handle compat with arch/ppc, and we are trying to get rid of it

I had the same comment in https://patchwork.ozlabs.org/patch/700354/
I also suggested to move the relevant declarations inside the switch()

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/09b6c1129f899c72d70b8bea360206

cheers

Acked-by on v1 1/3
#14 lore raw
In reply to Nicholas Piggin

Hi Nick,

Quoted 20 lines · Nicholas Piggin
Fixes a7cd88da97 ("powerpc/powernv: Move CPU-Offline idle state invocation from smp.c to idle.c")
Cc Gautham R. Shenoy <[email protected]>
---
 arch/powerpc/platforms/powernv/idle.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powernv/idle.c +1 -0
index 445f30a2c5ef..0c21747ed7e0 100644
@@ -261,6 +261,7 @@ static u64 pnv_deepest_stop_psscr_val;
 static u64 pnv_deepest_stop_psscr_mask;
 static bool deepest_stop_found;
 
+#ifdef CONFIG_HOTPLUG_CPU
 /*
  * pnv_cpu_offline: A function that puts the CPU into the deepest
  * available platform idle state on a CPU-Offline.

arch/powerpc/platforms/powernv/idle.c unsigned long pnv_cpu_offline(unsigned int cpu) · line 297

Quoted 4 lines
arch/powerpc/platforms/powernv/idle.c +1 -0
@@ -293,6 +294,7 @@ unsigned long pnv_cpu_offline(unsigned int cpu)
 
 	return srr1;
 }
+#endif

Looks like the updated verison of "powerpc/powernv: Move CPU-Offline idle state invocation from smp.c to idle.c"
(https://lkml.org/lkml/2017/3/30/235) wasn't picked.

Thanks for catching this!

Quoted 6 lines
arch/powerpc/platforms/powernv/idle.c +0 -0
 /*
  * Power ISA 3.0 idle initialization.
Signature · 1 line
2.11.0

--
Thanks and Regards
gautham.