Skip to contentSkip to conversation

enable the coreint for the mpc85xx 64bit boards

PATCH In review Kevin Hao 4 participants 8 messages Apr 11, 2013 – Aug 27, 2013

Subsystems (2)
lore
Share & tools
lore

Kevin Hao

author
#0 lore raw

cover enable the coreint for the mpc85xx 64bit boards

Hi,

With the rework of the lazy EE, it seems that 64bit kernel works pretty well on mpc85xx 64bit boards with lazy EE enabled. So this patch series tries to enable the coreint for these boards by default. This passed the ltp test on a t4240qds board and is based on Kumar's next branch.

---
Kevin Hao (2):
powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE powerpc/85xx: enable coreint for all the 64bit boards

 arch/powerpc/include/asm/hw_irq.h       | 1 -
 arch/powerpc/kernel/exceptions-64e.S    | 1 -
 arch/powerpc/kernel/irq.c               | 8 --------
 arch/powerpc/platforms/85xx/p5020_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/p5040_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/t4240_qds.c | 5 -----
 6 files changed, 25 deletions(-)
Signature · 4 lines
1.8.1.4

Thanks,
Kevin
author
#4 lore raw

PATCH 2/2 powerpc/85xx: enable coreint for all the 64bit boards

With the patch 7230c564 (powerpc: Rework lazy-interrupt handling), it seems that the coreint works pretty well on the 85xx 64bit kernel. So use the coreint by default for these boards.

---
 arch/powerpc/platforms/85xx/p5020_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/p5040_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/t4240_qds.c | 5 -----
 3 files changed, 15 deletions(-)
arch/powerpc/platforms/85xx/p5020_ds.c +0 -5
index 753a42c..39cfa40 100644
@@ -75,12 +75,7 @@ define_machine(p5020_ds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
arch/powerpc/platforms/85xx/p5040_ds.c +0 -5
index 1138185..f70e74c 100644
@@ -66,12 +66,7 @@ define_machine(p5040_ds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
arch/powerpc/platforms/85xx/t4240_qds.c +0 -5
index 5998e9f..91ead6b 100644
@@ -75,12 +75,7 @@ define_machine(t4240_qds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
Signature · 1 line
1.8.1.4
author
#1 lore raw

PATCH 1/2 powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE

In reply to Kevin Hao

In order to support the Book3E external proxy, the flag PACA_IRQ_EE_EDGE was introduced in patch 7230c564 (powerpc: Rework lazy-interrupt handling). But it turns out that this is not needed. And it is also not used by any code in the current kernel. According to the PowerISA 2.0.6, the content of EPR (External Proxy Register) is valid until MSR[EE] is set to 1. Since we never enable the hard irq before replaying a external interrupt. That means we still can get the valid interrupt vector from EPR when replaying irq.

---
 arch/powerpc/include/asm/hw_irq.h    | 1 -
 arch/powerpc/kernel/exceptions-64e.S | 1 -
 arch/powerpc/kernel/irq.c            | 8 --------
 3 files changed, 10 deletions(-)
arch/powerpc/include/asm/hw_irq.h +0 -1
index e45c494..8bf0789 100644
@@ -24,7 +24,6 @@
 #define PACA_IRQ_DBELL		0x02
 #define PACA_IRQ_EE		0x04
 #define PACA_IRQ_DEC		0x08 /* Or FIT */
-#define PACA_IRQ_EE_EDGE	0x10 /* BookE only */
 
 #endif /* CONFIG_PPC64 */
 
arch/powerpc/kernel/exceptions-64e.S +0 -1
index 42a756e..64f2fbd 100644
@@ -701,7 +701,6 @@ kernel_dbg_exc:
 .endm
 
 masked_interrupt_book3e_0x500:
-	// XXX When adding support for EPR, use PACA_IRQ_EE_EDGE
 	masked_interrupt_book3e PACA_IRQ_EE 1
 
 masked_interrupt_book3e_0x900:
arch/powerpc/kernel/irq.c +0 -8
index 4f97fe3..dbc1c05 100644
@@ -171,14 +171,6 @@ notrace unsigned int __check_irq_replay(void)
 		return 0x500;
 
 #ifdef CONFIG_PPC_BOOK3E
-	/* Finally check if an EPR external interrupt happened
-	 * this bit is typically set if we need to handle another
-	 * "edge" interrupt from within the MPIC "EPR" handler
-	 */
-	local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE;
-	if (happened & PACA_IRQ_EE_EDGE)
-		return 0x500;
-
 	local_paca->irq_happened &= ~PACA_IRQ_DBELL;
 	if (happened & PACA_IRQ_DBELL)
 		return 0x280;
Signature · 1 line
1.8.1.4
#6 lore raw
In reply to Kevin Hao
Quoted 12 lines · Kevin Hao

Hi,

With the rework of the lazy EE, it seems that 64bit kernel works pretty well on mpc85xx 64bit boards with lazy EE enabled. So this patch series tries to enable the coreint for these boards by default. This passed the ltp test on a t4240qds board and is based on Kumar's next branch.

---
Kevin Hao (2):
powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE powerpc/85xx: enable coreint for all the 64bit boards

Quoted 7 lines
arch/powerpc/include/asm/hw_irq.h       | 1 -
arch/powerpc/kernel/exceptions-64e.S    | 1 -
arch/powerpc/kernel/irq.c               | 8 --------
arch/powerpc/platforms/85xx/p5020_ds.c  | 5 -----
arch/powerpc/platforms/85xx/p5040_ds.c  | 5 -----
arch/powerpc/platforms/85xx/t4240_qds.c | 5 -----
6 files changed, 25 deletions(-)

Scott,

I'd appreciate your review and ack on this change.

thanks

- k

#7 lore raw
Quoted 25 lines · Kumar Gala

=20
On Apr 10, 2013, at 8:32 PM, Kevin Hao wrote:
=20

Quoted 3 lines

Hi,

With the rework of the lazy EE, it seems that 64bit kernel works =20

pretty

Quoted 1 line

well on mpc85xx 64bit boards with lazy EE enabled. So this patch =20

series

Quoted 2 lines

tries to enable the coreint for these boards by default. This passed the ltp test on a t4240qds board and is based on Kumar's next =20

branch.

Quoted 6 lines

---
Kevin Hao (2):
powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE powerpc/85xx: enable coreint for all the 64bit boards

Quoted 7 lines
arch/powerpc/include/asm/hw_irq.h       | 1 -
arch/powerpc/kernel/exceptions-64e.S    | 1 -
arch/powerpc/kernel/irq.c               | 8 --------
arch/powerpc/platforms/85xx/p5020_ds.c  | 5 -----
arch/powerpc/platforms/85xx/p5040_ds.c  | 5 -----
arch/powerpc/platforms/85xx/t4240_qds.c | 5 -----
6 files changed, 25 deletions(-)
Quoted 4 lines

=20
Scott,
=20
I'd appreciate your review and ack on this change.

ACK

-Scott=

author
#5 lore raw

Re: [PATCH 2/2] powerpc/85xx: enable coreint for all the 64bit boards

In reply to Kevin Hao
Quoted 3 lines · Kevin Hao

With the patch 7230c564 (powerpc: Rework lazy-interrupt handling), it seems that the coreint works pretty well on the 85xx 64bit kernel. So use the coreint by default for these boards.

Hi Kumar,

Since the external proxy works pretty well with the lazy EE without any change to the current kernel, could you please pick this patch up? This has already been acked by Scott. I also think I got a implicit ack from Benjamin. I will try to use the PACA_IRQ_EE_EDGE to make the support for external proxy more better a little later as suggested by Benjamin.

Thanks,
Kevin

Quoted 66 lines
---
 arch/powerpc/platforms/85xx/p5020_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/p5040_ds.c  | 5 -----
 arch/powerpc/platforms/85xx/t4240_qds.c | 5 -----
 3 files changed, 15 deletions(-)
arch/powerpc/platforms/85xx/p5020_ds.c +0 -5
index 753a42c..39cfa40 100644
@@ -75,12 +75,7 @@ define_machine(p5020_ds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
arch/powerpc/platforms/85xx/p5040_ds.c +0 -5
index 1138185..f70e74c 100644
@@ -66,12 +66,7 @@ define_machine(p5040_ds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
arch/powerpc/platforms/85xx/t4240_qds.c +0 -5
index 5998e9f..91ead6b 100644
@@ -75,12 +75,7 @@ define_machine(t4240_qds) {
 #ifdef CONFIG_PCI
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 #endif
-/* coreint doesn't play nice with lazy EE, use legacy mpic for now */
-#ifdef CONFIG_PPC64
-	.get_irq		= mpic_get_irq,
-#else
 	.get_irq		= mpic_get_coreint_irq,
-#endif
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
 	.progress		= udbg_progress,
Signature · 6 lines
1.8.1.4

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
#2 lore raw

Re: [PATCH 1/2] powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE

In reply to Kevin Hao
Quoted 8 lines · Kevin Hao

In order to support the Book3E external proxy, the flag PACA_IRQ_EE_EDGE was introduced in patch 7230c564 (powerpc: Rework lazy-interrupt handling). But it turns out that this is not needed. And it is also not used by any code in the current kernel. According to the PowerISA 2.0.6, the content of EPR (External Proxy Register) is valid until MSR[EE] is set to 1. Since we never enable the hard irq before replaying a external interrupt. That means we still can get the valid interrupt vector from EPR when replaying irq.

I assume you understand why that patch is broken and this is superseeded by your more recent series to actually make use of PACA_IRQ_EE_EDGE right ? :-)

(Just making sure I can take that one out of patchwork).

Quoted 50 lines
---
 arch/powerpc/include/asm/hw_irq.h    | 1 -
 arch/powerpc/kernel/exceptions-64e.S | 1 -
 arch/powerpc/kernel/irq.c            | 8 --------
 3 files changed, 10 deletions(-)
arch/powerpc/include/asm/hw_irq.h +0 -1
index e45c494..8bf0789 100644
@@ -24,7 +24,6 @@
 #define PACA_IRQ_DBELL		0x02
 #define PACA_IRQ_EE		0x04
 #define PACA_IRQ_DEC		0x08 /* Or FIT */
-#define PACA_IRQ_EE_EDGE	0x10 /* BookE only */
 
 #endif /* CONFIG_PPC64 */
 
arch/powerpc/kernel/exceptions-64e.S +0 -1
index 42a756e..64f2fbd 100644
@@ -701,7 +701,6 @@ kernel_dbg_exc:
 .endm
 
 masked_interrupt_book3e_0x500:
-	// XXX When adding support for EPR, use PACA_IRQ_EE_EDGE
 	masked_interrupt_book3e PACA_IRQ_EE 1
 
 masked_interrupt_book3e_0x900:
arch/powerpc/kernel/irq.c +0 -8
index 4f97fe3..dbc1c05 100644
@@ -171,14 +171,6 @@ notrace unsigned int __check_irq_replay(void)
 		return 0x500;
 
 #ifdef CONFIG_PPC_BOOK3E
-	/* Finally check if an EPR external interrupt happened
-	 * this bit is typically set if we need to handle another
-	 * "edge" interrupt from within the MPIC "EPR" handler
-	 */
-	local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE;
-	if (happened & PACA_IRQ_EE_EDGE)
-		return 0x500;
-
 	local_paca->irq_happened &= ~PACA_IRQ_DBELL;
 	if (happened & PACA_IRQ_DBELL)
 		return 0x280;
author
#3 lore raw

Re: [PATCH 1/2] powerpc/irq: remove the unneeded flag PACA_IRQ_EE_EDGE

Quoted 10 lines · Benjamin Herrenschmidt
Quoted 8 lines · Kevin Hao

In order to support the Book3E external proxy, the flag PACA_IRQ_EE_EDGE was introduced in patch 7230c564 (powerpc: Rework lazy-interrupt handling). But it turns out that this is not needed. And it is also not used by any code in the current kernel. According to the PowerISA 2.0.6, the content of EPR (External Proxy Register) is valid until MSR[EE] is set to 1. Since we never enable the hard irq before replaying a external interrupt. That means we still can get the valid interrupt vector from EPR when replaying irq.

Quoted 3 lines

I assume you understand why that patch is broken and this is superseeded by your more recent series to actually make use of PACA_IRQ_EE_EDGE right ? :-)

Yes.

Quoted 2 lines

(Just making sure I can take that one out of patchwork).

Definitely.

Thanks,
Kevin