Skip to contentSkip to conversation

Consolidating GIC per-cpu interrupts

RFC PATCH Superseded Marc Zyngier 2 participants 21 messages May 27, 2011 – May 30, 2011

Subsystems (8)

v4 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v4 cover Consolidating GIC per-cpu interrupts

The current GIC per-cpu interrupts (aka PPIs) suffer from a number of problems:

- They use a completely separate scheme to handle the interrupts, mostly because the PPI concept doesn't really match the kernel view of an interrupt.
- Some low-level code gets duplicated, as usual...
- PPIs can only be used by the timer code, unless we add more low-level assembly code.
- At least one platform (msm) has started implementing its own alternative scheme.

The proposed solution is to let the GIC code expose the PPIs as something that the kernel can manage. Instead of having a single interrupt number shared on all cores, make the interrupt number be different on each CPU.

This enables the use of the normal kernel API (request_irq() and friends) and the elimination of some low level code. On the other side, it causes quite a bit of churn in the timer code.

This patch set is based on 2.6.39+ as of May 24th. Tested on PB-11MP, Pandaboard and SMDK-V310.

Quoted 1 line

From [email protected] Wed May 25 18:46:03 2011

From: [email protected] ()
Date: Wed, 25 May 2011 22:46:03 -0000
Subject: No subject
Message-ID: <[email protected]>

- Fix yet another CPU_HOTPLUG problem: instead of calling free_irq() on timer halt, just disable the interrupt. On timer restart, detect that the interrupt has been requested already and just enable the interrupt back. This avoid doing a request_irq() with preemption disabled, which triggers an ugly warning. Reported by Stephen Boyd.

Quoted 1 line

From [email protected] Wed May 25 18:46:03 2011

From: [email protected] ()
Date: Wed, 25 May 2011 22:46:03 -0000
Subject: No subject
Message-ID: <[email protected]>

- More MSM fixes
- Dropped MSM interrupt handler removal, as this requires more discussion, and will be addressed in a separate series.
- Moved introduction of percpu_timer_handler to a separate patch

Quoted 1 line

From [email protected] Wed May 25 18:46:03 2011

From: [email protected] ()
Date: Wed, 25 May 2011 22:46:03 -0000
Subject: No subject
Message-ID: <[email protected]>

- Fix crash while hotpluging a CPU
- Use handle_percpu_irq() instead of handle_fasteoi_irq()
- MSM fixes courtesy of Stephen Boyd
- MSM switched to percpu_timer_handler()
- Remove local timer interrupt accounting
- Restructure patches #1 and #2

Marc Zyngier (13):
ARM: gic: add per-cpu interrupt multiplexer
ARM: smp: add interrupt handler for local timers
ARM: smp_twd: add support for remapped PPI interrupts
ARM: omap4: use remapped PPI interrupts for local timer
ARM: versatile: use remapped PPI interrupts for local timer
ARM: shmobile: use remapped PPI interrupts for local timer
ARM: ux500: use remapped PPI interrupts for local timer
ARM: tegra: use remapped PPI interrupts for local timer
ARM: msm: use remapped PPI interrupts for local timer
ARM: exynos4: use remapped PPI interrupts for local timer
ARM: gic: remove previous local timer interrupt handling
ARM: gic: add compute_irqnr macro for exynos4
ARM: SMP: automatically select ARM_GIC_VPPI

 arch/arm/Kconfig                                  |    1 +
 arch/arm/common/Kconfig                           |    5 +
 arch/arm/common/gic.c                             |  143 +++++++++++++++++=
++--
 arch/arm/include/asm/entry-macro-multi.S          |    7 -
 arch/arm/include/asm/hardirq.h                    |    3 -
 arch/arm/include/asm/hardware/entry-macro-gic.S   |   31 ++---
 arch/arm/include/asm/hardware/gic.h               |   12 ++-
 arch/arm/include/asm/localtimer.h                 |    7 +-
 arch/arm/include/asm/smp.h                        |    5 -
 arch/arm/kernel/irq.c                             |   11 +-
 arch/arm/kernel/smp.c                             |   27 +---
 arch/arm/kernel/smp_twd.c                         |   25 +++-
 arch/arm/mach-exynos4/include/mach/entry-macro.S  |   70 +----------
 arch/arm/mach-exynos4/localtimer.c                |    3 +-
 arch/arm/mach-msm/board-msm8x60.c                 |   11 --
 arch/arm/mach-msm/include/mach/entry-macro-qgic.S |   73 +-----------
 arch/arm/mach-msm/timer.c                         |   59 +++++----
 arch/arm/mach-omap2/include/mach/entry-macro.S    |   14 +--
 arch/arm/mach-omap2/timer-mpu.c                   |    3 +-
 arch/arm/mach-shmobile/entry-intc.S               |    3 -
 arch/arm/mach-shmobile/include/mach/entry-macro.S |    3 -
 arch/arm/mach-shmobile/localtimer.c               |    3 +-
 arch/arm/mach-tegra/localtimer.c                  |    3 +-
 arch/arm/mach-ux500/localtimer.c                  |    3 +-
 arch/arm/plat-versatile/localtimer.c              |    3 +-
 25 files changed, 246 insertions(+), 282 deletions(-)
#1 lore raw

RFC PATCH v4 1/13 ARM: gic: add per-cpu interrupt multiplexer

The kernel doesn't handle very well the concept of per-cpu interrupt as implemented by the ARM architecture (the same interrupt level is exposed on each core).

To work around the problem, add another irq_chip to handle PPIs and remap them so that a single interrupt number is only used on a given CPU (for example, IRQ 29 and 30 get exposed as IRQ 128 and 129 on core 0, 130 and 131 on core 1...).

A helper function gic_ppi_to_vppi() is used to convert the PPI number to the per-processor IRQ.

---
 arch/arm/common/Kconfig                         |    5 +
 arch/arm/common/gic.c                           |  133 ++++++++++++++++++++++-
 arch/arm/include/asm/entry-macro-multi.S        |    2 +-
 arch/arm/include/asm/hardware/entry-macro-gic.S |   19 ++--
 arch/arm/include/asm/hardware/gic.h             |   11 ++
 arch/arm/kernel/irq.c                           |    8 ++-
 6 files changed, 165 insertions(+), 13 deletions(-)
arch/arm/common/Kconfig +5 -0
index ea5ee4d..020a531 100644
@@ -1,6 +1,11 @@
 config ARM_GIC
 	bool
 
+config ARM_GIC_VPPI
+	depends on ARM_GIC
+	select SPARSE_IRQ
+        bool
+
 config ARM_VIC
 	bool
 
arch/arm/common/gic.c +129 -4

168 lines not on this page · raw message

arch/arm/include/asm/entry-macro-multi.S +1 -1
index ec0bbf7..c599795 100644
@@ -24,7 +24,7 @@
 	adrne	lr, BSYM(1b)
 	bne	do_IPI
 
-#ifdef CONFIG_LOCAL_TIMERS
+#if defined(CONFIG_LOCAL_TIMERS) && !defined(CONFIG_ARM_GIC_VPPI)
 	test_for_ltirq r0, r6, r5, lr
 	movne	r0, sp
 	adrne	lr, BSYM(1b)
arch/arm/include/asm/hardware/entry-macro-gic.S +12 -7
index c115b82..14a3363 100644
@@ -17,23 +17,26 @@
 	.endm
 #endif
 
+#ifdef CONFIG_ARM_GIC_VPPI
+#define DO_IRQ_BASE	16
+#else
+#define DO_IRQ_BASE	30
+#endif
+
 /*
  * The interrupt numbering scheme is defined in the
  * interrupt controller spec.  To wit:
  *
  * Interrupts 0-15 are IPI
- * 16-28 are reserved
- * 29-31 are local.  We allow 30 to be used for the watchdog.
+ * 16-31 are local.  We allow 30 to be used for the watchdog.
  * 32-1020 are global
  * 1021-1022 are reserved
  * 1023 is "spurious" (no interrupt)
  *
- * For now, we ignore all local interrupts so only return an interrupt if it's
- * between 30 and 1020.  The test_for_ipi routine below will pick up on IPIs.
- *
  * A simple read from the controller will tell us the number of the highest
  * priority enabled interrupt.  We then just need to check whether it is in the
- * valid range for an IRQ (30-1020 inclusive).
+ * valid range for an IRQ (30-1020 inclusive). If CONFIG_ARM_GIC_VPPI is
+ * enabled, local interrupts are handled the same way as global ones.
  */
 
 	.macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
@@ -43,7 +46,7 @@
 
 	ldr	\tmp, =1021
 	bic     \irqnr, \irqstat, #0x1c00
-	cmp     \irqnr, #29
+	cmp     \irqnr, #(DO_IRQ_BASE - 1)
 	cmpcc	\irqnr, \irqnr
 	cmpne	\irqnr, \tmp
 	cmpcs	\irqnr, \irqnr
@@ -63,6 +66,7 @@
 	cmpcs	\irqnr, \irqnr
 	.endm
 
+#ifndef CONFIG_ARM_GIC_VPPI
 /* As above, this assumes that irqstat and base are preserved.. */
 
 	.macro test_for_ltirq, irqnr, irqstat, base, tmp
@@ -73,3 +77,4 @@
 	streq	\irqstat, [\base, #GIC_CPU_EOI]
 	cmp	\tmp, #0
 	.endm
+#endif
arch/arm/include/asm/hardware/gic.h +11 -0
index 0691f9d..9dbffed 100644
@@ -33,6 +33,8 @@
 #define GIC_DIST_SOFTINT		0xf00
 
 #ifndef __ASSEMBLY__
+#include <linux/cpumask.h>
+
 extern void __iomem *gic_cpu_base_addr;
 extern struct irq_chip gic_arch_extn;
 
@@ -41,6 +43,15 @@ void gic_secondary_init(unsigned int);
 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
 void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
 void gic_enable_ppi(unsigned int);
+#ifdef CONFIG_ARM_GIC_VPPI
+unsigned int gic_ppi_to_vppi(unsigned int irq);
+#else
+static inline unsigned int gic_ppi_to_vppi(unsigned int irq)
+{
+	return irq;
+}
+#endif
+
 #endif
 
 #endif
arch/arm/kernel/irq.c +7 -1
index 83bbad0..237959f 100644
@@ -124,8 +124,14 @@ void __init init_IRQ(void)
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
+	int initcnt;
+
 	nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
-	return nr_irqs;
+	initcnt = nr_irqs;
+#ifdef CONFIG_ARM_GIC_VPPI
+	nr_irqs += 16 * 8;	/* 16 PPIs, 8 CPUs */
+#endif
+	return initcnt;
 }
 #endif
 
Signature · 1 line
1.7.0.4
#2 lore raw

RFC PATCH v4 1/13 ARM: gic: add per-cpu interrupt multiplexer

Quoted 9 lines · Marc Zyngier

The kernel doesn't handle very well the concept of per-cpu interrupt as implemented by the ARM architecture (the same interrupt level is exposed on each core).

To work around the problem, add another irq_chip to handle PPIs and remap them so that a single interrupt number is only used on a given CPU (for example, IRQ 29 and 30 get exposed as IRQ 128 and 129 on core 0, 130 and 131 on core 1...).

Quoted 5 lines

A helper function gic_ppi_to_vppi() is used to convert the PPI number to the per-processor IRQ.

arch/arm/common/Kconfig line 8

Quoted 13 lines
arch/arm/common/Kconfig +5 -0
index ea5ee4d..020a531 100644
@@ -1,6 +1,11 @@
 config ARM_GIC
 	bool
 
+config ARM_GIC_VPPI
+	depends on ARM_GIC
+	select SPARSE_IRQ
+        bool
+

Nitpick: bool should be tabbed out instead of with spaces.

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw

RFC PATCH v4 2/13 ARM: smp: add interrupt handler for local timers

In reply to Marc Zyngier

Provide a "normal" interrupt handler for local timers. It is expected that most timer implementations will use this handler unless they have more specific requirements.

---
 arch/arm/include/asm/localtimer.h |    6 ++++++
 arch/arm/kernel/smp.c             |   12 ++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/include/asm/localtimer.h +6 -0
index 080d74f..bef44b3 100644
@@ -10,6 +10,8 @@
 #ifndef __ASM_ARM_LOCALTIMER_H
 #define __ASM_ARM_LOCALTIMER_H
 
+#include <linux/interrupt.h>
+
 struct clock_event_device;
 
 /*
@@ -22,6 +24,10 @@ void percpu_timer_setup(void);
  */
 asmlinkage void do_local_timer(struct pt_regs *);
 
+/*
+ * Per-cpu timer IRQ handler
+ */
+irqreturn_t percpu_timer_handler(int irq, void *dev_id);
 
 #ifdef CONFIG_LOCAL_TIMERS
 
arch/arm/kernel/smp.c +12 -0
index d439a8f..2c85941 100644
@@ -459,6 +459,18 @@ asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs)
 	set_irq_regs(old_regs);
 }
 
+irqreturn_t percpu_timer_handler(int irq, void *dev_id)
+{
+	struct clock_event_device *evt = dev_id;
+
+	if (local_timer_ack()) {
+		evt->event_handler(evt);
+		return IRQ_HANDLED;
+	}
+
+	return IRQ_NONE;
+}
+
 void show_local_irqs(struct seq_file *p, int prec)
 {
 	unsigned int cpu;
Signature · 1 line
1.7.0.4
#4 lore raw

RFC PATCH v4 3/13 ARM: smp_twd: add support for remapped PPI interrupts

In reply to Marc Zyngier

When CONFIG_ARM_GIC_VPPI is enabled, let smp_twd request interrupts the normal way (ie using request_irq()).

This involves letting PPIs go via the same code path as SPIs and having normal interrupt handler for the local timer code.

The previous ad-hoc code is still supported when CONFIG_ARM_GIC_VPPI is not defined.

---
 arch/arm/kernel/smp_twd.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)
arch/arm/kernel/smp_twd.c +27 -1
index 60636f4..773336e 100644
@@ -15,16 +15,18 @@
 #include <linux/smp.h>
 #include <linux/jiffies.h>
 #include <linux/clockchips.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/io.h>
 
 #include <asm/smp_twd.h>
+#include <asm/localtimer.h>
 #include <asm/hardware/gic.h>
 
 /* set up by the platform code */
 void __iomem *twd_base;
 
 static unsigned long twd_timer_rate;
+static DEFINE_PER_CPU(bool, irq_reqd);
 
 static void twd_set_mode(enum clock_event_mode mode,
 			struct clock_event_device *clk)
@@ -43,6 +45,10 @@ static void twd_set_mode(enum clock_event_mode mode,
 		ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT;
 		break;
 	case CLOCK_EVT_MODE_UNUSED:
+#ifdef CONFIG_ARM_GIC_VPPI
+		disable_irq(clk->irq);
+		/* fall through */
+#endif
 	case CLOCK_EVT_MODE_SHUTDOWN:
 	default:
 		ctrl = 0;
@@ -124,6 +130,9 @@ static void __cpuinit twd_calibrate_rate(void)
  */
 void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 {
+	int err;
+	bool *reqd;
+
 	twd_calibrate_rate();
 
 	clk->name = "local_timer";
@@ -137,8 +146,25 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 	clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
 	clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
 
+#ifdef CONFIG_ARM_GIC_VPPI
+	reqd = &__get_cpu_var(irq_reqd);
+	if (!*reqd) {
+		err = request_irq(clk->irq, percpu_timer_handler,
+				  IRQF_PERCPU | IRQF_NOBALANCING | IRQF_TIMER,
+				  clk->name, clk);
+		if (err) {
+			pr_err("%s: can't register interrupt %d on cpu %d (%d)\n",
+			       clk->name, clk->irq, smp_processor_id(), err);
+			return;
+		}
+
+		*reqd = true;
+	} else
+		enable_irq(clk->irq);
+#else
 	/* Make sure our local interrupt controller has this enabled */
 	gic_enable_ppi(clk->irq);
+#endif
 
 	clockevents_register_device(clk);
 }
Signature · 1 line
1.7.0.4
#5 lore raw

RFC PATCH v4 4/13 ARM: omap4: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Tested on a Pandaboard.

---
 arch/arm/mach-omap2/Kconfig                    |    1 +
 arch/arm/mach-omap2/include/mach/entry-macro.S |   14 +-------------
 arch/arm/mach-omap2/timer-mpu.c                |    3 ++-
 3 files changed, 4 insertions(+), 14 deletions(-)
arch/arm/mach-omap2/Kconfig +1 -0
index 19d5891..284694c 100644
@@ -44,6 +44,7 @@ config ARCH_OMAP4
 	depends on ARCH_OMAP2PLUS
 	select CPU_V7
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select LOCAL_TIMERS if SMP
 	select PL310_ERRATA_588369
 	select PL310_ERRATA_727915
arch/arm/mach-omap2/include/mach/entry-macro.S +1 -13
index a48690b..22d86ef 100644
@@ -78,7 +78,7 @@
 4401:		ldr     \irqstat, [\base, #GIC_CPU_INTACK]
 		ldr     \tmp, =1021
 		bic     \irqnr, \irqstat, #0x1c00
-		cmp     \irqnr, #29
+		cmp     \irqnr, #15
 		cmpcc   \irqnr, \irqnr
 		cmpne   \irqnr, \tmp
 		cmpcs   \irqnr, \irqnr
@@ -101,18 +101,6 @@
 		it	cs
 		cmpcs	\irqnr, \irqnr
 		.endm
-
-		/* As above, this assumes that irqstat and base are preserved */
-
-		.macro test_for_ltirq, irqnr, irqstat, base, tmp
-		bic	\irqnr, \irqstat, #0x1c00
-		mov 	\tmp, #0
-		cmp	\irqnr, #29
-		itt	eq
-		moveq	\tmp, #1
-		streq	\irqstat, [\base, #GIC_CPU_EOI]
-		cmp	\tmp, #0
-		.endm
 #endif	/* CONFIG_SMP */
 
 #else	/* MULTI_OMAP2 */
arch/arm/mach-omap2/timer-mpu.c +2 -1
index 31c0ac4..1fd5ca5 100644
@@ -22,6 +22,7 @@
 #include <asm/irq.h>
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 
 /*
  * Setup the local clock events for a CPU.
@@ -32,7 +33,7 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
 	if (omap_rev() == OMAP4430_REV_ES1_0)
 		return -ENXIO;
 
-	evt->irq = OMAP44XX_IRQ_LOCALTIMER;
+	evt->irq = gic_ppi_to_vppi(OMAP44XX_IRQ_LOCALTIMER);
 	twd_timer_setup(evt);
 	return 0;
 }
Signature · 1 line
1.7.0.4
#6 lore raw

RFC PATCH v4 5/13 ARM: versatile: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Tested on VExpress and PB-11MP.

---
 arch/arm/mach-realview/Kconfig       |    2 ++
 arch/arm/mach-vexpress/Kconfig       |    1 +
 arch/arm/plat-versatile/localtimer.c |    3 ++-
 3 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/mach-realview/Kconfig +2 -0
index b9a9805..12c7c56 100644
@@ -38,6 +38,7 @@ config MACH_REALVIEW_PB11MP
 	bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
 	select CPU_V6K
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select HAVE_PATA_PLATFORM
 	select ARCH_HAS_BARRIERS if SMP
 	help
@@ -76,6 +77,7 @@ config MACH_REALVIEW_PBA8
 config MACH_REALVIEW_PBX
 	bool "Support RealView(R) Platform Baseboard Explore"
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select HAVE_PATA_PLATFORM
 	select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
 	select ZONE_DMA if SPARSEMEM
arch/arm/mach-vexpress/Kconfig +1 -0
index 9311484..07a53aa 100644
@@ -5,6 +5,7 @@ config ARCH_VEXPRESS_CA9X4
 	bool "Versatile Express Cortex-A9x4 tile"
 	select CPU_V7
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select ARM_ERRATA_720789
 	select ARM_ERRATA_751472
 	select ARM_ERRATA_753970
arch/arm/plat-versatile/localtimer.c +2 -1
index 0fb3961..a76daf4 100644
@@ -14,6 +14,7 @@
 
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 #include <mach/irqs.h>
 
 /*
@@ -21,7 +22,7 @@
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-	evt->irq = IRQ_LOCALTIMER;
+	evt->irq = gic_ppi_to_vppi(IRQ_LOCALTIMER);
 	twd_timer_setup(evt);
 	return 0;
 }
Signature · 1 line
1.7.0.4
#7 lore raw

RFC PATCH v4 6/13 ARM: shmobile: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Cc Paul Mundt <[email protected]>
Cc Magnus Damm <[email protected]>
---
 arch/arm/mach-shmobile/Kconfig                    |    1 +
 arch/arm/mach-shmobile/entry-intc.S               |    3 ---
 arch/arm/mach-shmobile/include/mach/entry-macro.S |    3 ---
 arch/arm/mach-shmobile/localtimer.c               |    3 ++-
 4 files changed, 3 insertions(+), 7 deletions(-)
arch/arm/mach-shmobile/Kconfig +1 -0
index 0c8f6cf..ddcf28c 100644
@@ -26,6 +26,7 @@ config ARCH_SH73A0
 	select SH_CLK_CPG
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_GIC
+	select ARM_GIC_VPPI
 
 comment "SH-Mobile Board Type"
 
arch/arm/mach-shmobile/entry-intc.S +0 -3
index cac0a7a..1a1c00c 100644
@@ -51,7 +51,4 @@
 	.macro  test_for_ipi, irqnr, irqstat, base, tmp
 	.endm
 
-	.macro  test_for_ltirq, irqnr, irqstat, base, tmp
-	.endm
-
 	arch_irq_handler shmobile_handle_irq_intc
arch/arm/mach-shmobile/include/mach/entry-macro.S +0 -3
index d791f10..8d4a416 100644
@@ -27,8 +27,5 @@
 	.macro  test_for_ipi, irqnr, irqstat, base, tmp
 	.endm
 
-	.macro  test_for_ltirq, irqnr, irqstat, base, tmp
-	.endm
-
 	.macro  arch_ret_to_user, tmp1, tmp2
 	.endm
arch/arm/mach-shmobile/localtimer.c +2 -1
index ad9ccc9..8a67b1c 100644
@@ -14,13 +14,14 @@
 #include <linux/clockchips.h>
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 
 /*
  * Setup the local clock events for a CPU.
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-	evt->irq = 29;
+	evt->irq = gic_ppi_to_vppi(29);
 	twd_timer_setup(evt);
 	return 0;
 }
Signature · 1 line
1.7.0.4
#8 lore raw

RFC PATCH v4 7/13 ARM: ux500: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Cc Srinidhi Kasagar <[email protected]>
Cc Linus Walleij <[email protected]>
---
 arch/arm/mach-ux500/Kconfig      |    1 +
 arch/arm/mach-ux500/localtimer.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/Kconfig +1 -0
index 54429d0..545c4bc 100644
@@ -4,6 +4,7 @@ config UX500_SOC_COMMON
 	bool
 	default y
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select HAS_MTU
 	select NOMADIK_GPIO
 	select ARM_ERRATA_753970
arch/arm/mach-ux500/localtimer.c +2 -1
index 5ba1133..f027cef 100644
@@ -17,13 +17,14 @@
 #include <asm/irq.h>
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 
 /*
  * Setup the local clock events for a CPU.
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-	evt->irq = IRQ_LOCALTIMER;
+	evt->irq = gic_ppi_to_vppi(IRQ_LOCALTIMER);
 	twd_timer_setup(evt);
 	return 0;
 }
Signature · 1 line
1.7.0.4
#9 lore raw

RFC PATCH v4 8/13 ARM: tegra: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Cc Colin Cross <[email protected]>
Cc Erik Gilling <[email protected]>
Cc Olof Johansson <[email protected]>
---
 arch/arm/mach-tegra/Kconfig      |    1 +
 arch/arm/mach-tegra/localtimer.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-tegra/Kconfig +1 -0
index 5ec1846..eabdd90 100644
@@ -9,6 +9,7 @@ config ARCH_TEGRA_2x_SOC
 	bool "Tegra 2 family"
 	select CPU_V7
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select ARCH_REQUIRE_GPIOLIB
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 	select USB_ULPI if USB_SUPPORT
arch/arm/mach-tegra/localtimer.c +2 -1
index e91d681..97cd0a9 100644
@@ -14,13 +14,14 @@
 #include <asm/irq.h>
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 
 /*
  * Setup the local clock events for a CPU.
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-	evt->irq = IRQ_LOCALTIMER;
+	evt->irq = gic_ppi_to_vppi(IRQ_LOCALTIMER);
 	twd_timer_setup(evt);
 	return 0;
 }
Signature · 1 line
1.7.0.4
#10 lore raw

RFC PATCH v4 9/13 ARM: msm: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

MSM already had a very similar scheme, though still mixing both GIC-specific and generic APIs.

Fixes and ideas courtesy of Stephen Boyd.

Cc David Brown <[email protected]>
Cc Daniel Walker <[email protected]>
Cc Bryan Huntsman <[email protected]>
Cc Stephen Boyd <[email protected]>
---
 arch/arm/mach-msm/Kconfig                         |    2 +
 arch/arm/mach-msm/board-msm8x60.c                 |   11 ---
 arch/arm/mach-msm/include/mach/entry-macro-qgic.S |   73 +--------------------
 arch/arm/mach-msm/timer.c                         |   59 +++++++++--------
 4 files changed, 33 insertions(+), 112 deletions(-)
arch/arm/mach-msm/Kconfig +2 -0
index 1516896..1ea7d6f 100644
@@ -42,6 +42,7 @@ config ARCH_MSM8X60
 				  && !MACH_MSM8X60_FFA)
 	select ARCH_MSM_SCORPIONMP
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select CPU_V7
 	select MSM_V2_TLMM
 	select MSM_GPIOMUX
@@ -52,6 +53,7 @@ config ARCH_MSM8960
 	select ARCH_MSM_SCORPIONMP
 	select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3)
 	select ARM_GIC
+	select ARM_GIC_VPPI
 	select CPU_V7
 	select MSM_V2_TLMM
 	select MSM_GPIOMUX
arch/arm/mach-msm/board-msm8x60.c +0 -11
index 1163b6f..d70a2f6 100644
@@ -36,8 +36,6 @@ static void __init msm8x60_map_io(void)
 
 static void __init msm8x60_init_irq(void)
 {
-	unsigned int i;
-
 	gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
 		 (void *)MSM_QGIC_CPU_BASE);
 
@@ -49,15 +47,6 @@ static void __init msm8x60_init_irq(void)
 	 */
 	if (!machine_is_msm8x60_sim())
 		writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
-
-	/* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
-	 * as they are configured as level, which does not play nice with
-	 * handle_percpu_irq.
-	 */
-	for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
-		if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
-			irq_set_handler(i, handle_percpu_irq);
-	}
 }
 
 static void __init msm8x60_init(void)
arch/arm/mach-msm/include/mach/entry-macro-qgic.S +1 -72

82 lines not on this page · raw message

arch/arm/mach-msm/timer.c +30 -29

125 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#11 lore raw

RFC PATCH v4 9/13 ARM: msm: use remapped PPI interrupts for local timer

Quoted 11 lines · Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

MSM already had a very similar scheme, though still mixing both GIC-specific and generic APIs.

Fixes and ideas courtesy of Stephen Boyd.

Cc David Brown <[email protected]>
Cc Daniel Walker <[email protected]>
Cc Bryan Huntsman <[email protected]>
Reviewed-and-Tested-by Stephen Boyd <[email protected]>
Quoted 2 lines

+static bool local_timer_inited;

Except this is unused if SMP=n. Here's a fix:

---8<----

arch/arm/mach-msm/timer.c +1 -1
index 186abdf..a242b89 100644
@@ -84,7 +84,6 @@ enum {
 
 
 static struct msm_clock msm_clocks[];
-static bool local_timer_inited;
 
 static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
 {
@@ -259,6 +258,7 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
        struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
        int res;
+       static bool local_timer_inited;
 
        /* Use existing clock_event for cpu 0 */
        if (!smp_processor_id())

---

But now I really want to know. Why can't we use system_state == SYSTEM_BOOTING? Perhaps I'm thinking ahead too much, but I'm concerned that if we have more than two cores we're going to have to make a percpu variable here just to avoid requesting the irq again. It would be simpler to just accept the fact that we can't boot a secondary core for the first time after kernel init due to the way the code is written. If/when we decide to allow such a thing we can revisit this code and make it into a percpu variable.

Or another idea is to pass a "first_boot" flag or something to local_timer_setup() to indicate this is the first boot. Then we could extend the percpu_clockevent variable in the localtimer core to have this flag.

Either way it seems like something we should centralize.

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#12 lore raw

RFC PATCH v4 9/13 ARM: msm: use remapped PPI interrupts for local timer

Quoted 7 lines · Stephen Boyd
Quoted 6 lines · Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

MSM already had a very similar scheme, though still mixing both GIC-specific and generic APIs.

Quoted 7 lines
Quoted 5 lines

Fixes and ideas courtesy of Stephen Boyd.

Cc David Brown <[email protected]>
Cc Daniel Walker <[email protected]>
Cc Bryan Huntsman <[email protected]>
Reviewed-and-Tested-by Stephen Boyd <[email protected]>

Thanks Stephen.

Quoted 4 lines
Quoted 2 lines

+static bool local_timer_inited;

Except this is unused if SMP=n. Here's a fix:

Thanks, will apply.

Quoted 26 lines

---8<----

arch/arm/mach-msm/timer.c +1 -1
index 186abdf..a242b89 100644
@@ -84,7 +84,6 @@ enum {
 
 
 static struct msm_clock msm_clocks[];
-static bool local_timer_inited;
 
 static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
 {
@@ -259,6 +258,7 @@ int __cpuinit local_timer_setup(struct
 clock_event_device *evt)
 {
        struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
        int res;
+       static bool local_timer_inited;
 
        /* Use existing clock_event for cpu 0 */
        if (!smp_processor_id())
Quoted 4 lines

---

But now I really want to know. Why can't we use system_state == SYSTEM_BOOTING? Perhaps I'm thinking ahead too much, but I'm concerned

I thought of that. Except that system_state is really what it means, an indication of the state of the system as a whole. On startup, memory allocation can hardly fail, even when in atomic context. On cpu hotplug, anything can fail (as far as memory allocation is concerned).

Quoted 6 lines

that if we have more than two cores we're going to have to make a percpu variable here just to avoid requesting the irq again. It would be simpler to just accept the fact that we can't boot a secondary core for the first time after kernel init due to the way the code is written. If/when we decide to allow such a thing we can revisit this code and make it into a percpu variable.

This is actually what I've done for TWD. And frankly, I hate it.

Quoted 6 lines

Or another idea is to pass a "first_boot" flag or something to local_timer_setup() to indicate this is the first boot. Then we could extend the percpu_clockevent variable in the localtimer core to have this flag.

Either way it seems like something we should centralize.

Agreed. If this patch series goes in, I plan to keep track of the state at the core level. Or at least as a generic feature of the ARM implementation (I already have a bunch of patches to go on top of this). There are other code paths that may need to may need to track this as well (I have a pair of ugly hacks in the A15 code...).

Cheers,

        M.
Signature · 1 line
Fast, cheap, reliable. Pick two.
#13 lore raw

RFC PATCH v4 10/13 ARM: exynos4: use remapped PPI interrupts for local timer

In reply to Marc Zyngier

Use the normal interrupt scheme for the local timers by using a remapped PPI interrupt.

Tested on a SMDK-S5PV310 board.

---
 arch/arm/mach-exynos4/include/mach/entry-macro.S |   12 +-----------
 arch/arm/mach-exynos4/localtimer.c               |    3 ++-
 arch/arm/plat-s5p/Kconfig                        |    1 +
 3 files changed, 4 insertions(+), 12 deletions(-)
arch/arm/mach-exynos4/include/mach/entry-macro.S +1 -11
index d8f38c2..f007168 100644
@@ -50,7 +50,7 @@
 
 		bic     \irqnr, \irqstat, #0x1c00
 
-		cmp     \irqnr, #29
+		cmp     \irqnr, #15
 		cmpcc	\irqnr, \irqnr
 		cmpne	\irqnr, \tmp
 		cmpcs	\irqnr, \irqnr
@@ -72,13 +72,3 @@
 		cmpcs	\irqnr, \irqnr
 		.endm
 
-		/* As above, this assumes that irqstat and base are preserved.. */
-
-		.macro test_for_ltirq, irqnr, irqstat, base, tmp
-		bic	\irqnr, \irqstat, #0x1c00
-		mov	\tmp, #0
-		cmp	\irqnr, #29
-		moveq	\tmp, #1
-		streq	\irqstat, [\base, #GIC_CPU_EOI]
-		cmp	\tmp, #0
-		.endm
arch/arm/mach-exynos4/localtimer.c +2 -1
index 6bf3d0a..315de6f 100644
@@ -14,13 +14,14 @@
 
 #include <asm/irq.h>
 #include <asm/localtimer.h>
+#include <asm/hardware/gic.h>
 
 /*
  * Setup the local clock events for a CPU.
  */
 int __cpuinit local_timer_setup(struct clock_event_device *evt)
 {
-	evt->irq = IRQ_LOCALTIMER;
+	evt->irq = gic_ppi_to_vppi(IRQ_LOCALTIMER);
 	twd_timer_setup(evt);
 	return 0;
 }
arch/arm/plat-s5p/Kconfig +1 -0
index 6751bcf..0e30e25 100644
@@ -11,6 +11,7 @@ config PLAT_S5P
 	default y
 	select ARM_VIC if !ARCH_EXYNOS4
 	select ARM_GIC if ARCH_EXYNOS4
+	select ARM_GIC_VPPI if ARCH_EXYNOS4
 	select NO_IOPORT
 	select ARCH_REQUIRE_GPIOLIB
 	select S3C_GPIO_TRACK
Signature · 1 line
1.7.0.4
#14 lore raw

RFC PATCH v4 11/13 ARM: gic: remove previous local timer interrupt handling

In reply to Marc Zyngier

Now that all users of local timers are using CONFIG_ARM_GIC_VPPI, the now unused local timer infrastructure can be safely removed.

---
 arch/arm/common/gic.c                           |   10 --------
 arch/arm/include/asm/entry-macro-multi.S        |    7 -----
 arch/arm/include/asm/hardirq.h                  |    3 --
 arch/arm/include/asm/hardware/entry-macro-gic.S |   13 ----------
 arch/arm/include/asm/hardware/gic.h             |    1 -
 arch/arm/include/asm/localtimer.h               |    5 ----
 arch/arm/include/asm/smp.h                      |    5 ----
 arch/arm/kernel/irq.c                           |    3 --
 arch/arm/kernel/smp.c                           |   29 -----------------------
 arch/arm/kernel/smp_twd.c                       |    7 -----
 10 files changed, 0 insertions(+), 83 deletions(-)
arch/arm/common/gic.c +0 -10
index 2146d5e..2f36979 100644
@@ -501,16 +501,6 @@ void __cpuinit gic_secondary_init(unsigned int gic_nr)
 	gic_cpu_init(&gic_data[gic_nr]);
 }
 
-void __cpuinit gic_enable_ppi(unsigned int irq)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	irq_set_status_flags(irq, IRQ_NOPROBE);
-	gic_unmask_irq(irq_get_irq_data(irq));
-	local_irq_restore(flags);
-}
-
 #ifdef CONFIG_SMP
 void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
 {
arch/arm/include/asm/entry-macro-multi.S +0 -7
index c599795..4ef27af 100644
@@ -23,13 +23,6 @@
 	movne	r1, sp
 	adrne	lr, BSYM(1b)
 	bne	do_IPI
-
-#if defined(CONFIG_LOCAL_TIMERS) && !defined(CONFIG_ARM_GIC_VPPI)
-	test_for_ltirq r0, r6, r5, lr
-	movne	r0, sp
-	adrne	lr, BSYM(1b)
-	bne	do_local_timer
-#endif
 #endif
 9997:
 	.endm
arch/arm/include/asm/hardirq.h +0 -3
index 89ad180..ddf07a9 100644
@@ -9,9 +9,6 @@
 
 typedef struct {
 	unsigned int __softirq_pending;
-#ifdef CONFIG_LOCAL_TIMERS
-	unsigned int local_timer_irqs;
-#endif
 #ifdef CONFIG_SMP
 	unsigned int ipi_irqs[NR_IPI];
 #endif
arch/arm/include/asm/hardware/entry-macro-gic.S +0 -13
index 14a3363..db83287 100644
@@ -65,16 +65,3 @@
 	strcc	\irqstat, [\base, #GIC_CPU_EOI]
 	cmpcs	\irqnr, \irqnr
 	.endm
-
-#ifndef CONFIG_ARM_GIC_VPPI
-/* As above, this assumes that irqstat and base are preserved.. */
-
-	.macro test_for_ltirq, irqnr, irqstat, base, tmp
-	bic	\irqnr, \irqstat, #0x1c00
-	mov 	\tmp, #0
-	cmp	\irqnr, #29
-	moveq	\tmp, #1
-	streq	\irqstat, [\base, #GIC_CPU_EOI]
-	cmp	\tmp, #0
-	.endm
-#endif
arch/arm/include/asm/hardware/gic.h +0 -1
index 9dbffed..069d4c0 100644
@@ -42,7 +42,6 @@ void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
 void gic_secondary_init(unsigned int);
 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
 void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
-void gic_enable_ppi(unsigned int);
 #ifdef CONFIG_ARM_GIC_VPPI
 unsigned int gic_ppi_to_vppi(unsigned int irq);
 #else
arch/arm/include/asm/localtimer.h +0 -5
index bef44b3..5c8acb4 100644
@@ -20,11 +20,6 @@ struct clock_event_device;
 void percpu_timer_setup(void);
 
 /*
- * Called from assembly, this is the local timer IRQ handler
- */
-asmlinkage void do_local_timer(struct pt_regs *);
-
-/*
  * Per-cpu timer IRQ handler
  */
 irqreturn_t percpu_timer_handler(int irq, void *dev_id);
arch/arm/include/asm/smp.h +0 -5
index d2b514f..4cc7d83 100644
@@ -87,9 +87,4 @@ extern void platform_cpu_enable(unsigned int cpu);
 extern void arch_send_call_function_single_ipi(int cpu);
 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
 
-/*
- * show local interrupt info
- */
-extern void show_local_irqs(struct seq_file *, int);
-
 #endif /* ifndef __ASM_ARM_SMP_H */
arch/arm/kernel/irq.c +0 -3
index 237959f..9f3e427 100644
@@ -59,9 +59,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
 #ifdef CONFIG_SMP
 	show_ipi_list(p, prec);
 #endif
-#ifdef CONFIG_LOCAL_TIMERS
-	show_local_irqs(p, prec);
-#endif
 	seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
 	return 0;
 }
arch/arm/kernel/smp.c +0 -29
index 2c85941..203b38c 100644
@@ -425,10 +425,6 @@ u64 smp_irq_stat_cpu(unsigned int cpu)
 	for (i = 0; i < NR_IPI; i++)
 		sum += __get_irq_stat(cpu, ipi_irqs[i]);
 
-#ifdef CONFIG_LOCAL_TIMERS
-	sum += __get_irq_stat(cpu, local_timer_irqs);
-#endif
-
 	return sum;
 }
 
@@ -446,19 +442,6 @@ static void ipi_timer(void)
 }
 
 #ifdef CONFIG_LOCAL_TIMERS
-asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs)
-{
-	struct pt_regs *old_regs = set_irq_regs(regs);
-	int cpu = smp_processor_id();
-
-	if (local_timer_ack()) {
-		__inc_irq_stat(cpu, local_timer_irqs);
-		ipi_timer();
-	}
-
-	set_irq_regs(old_regs);
-}
-
 irqreturn_t percpu_timer_handler(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = dev_id;
@@ -470,18 +453,6 @@ irqreturn_t percpu_timer_handler(int irq, void *dev_id)
 
 	return IRQ_NONE;
 }
-
-void show_local_irqs(struct seq_file *p, int prec)
-{
-	unsigned int cpu;
-
-	seq_printf(p, "%*s: ", prec, "LOC");
-
-	for_each_present_cpu(cpu)
-		seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs));
-
-	seq_printf(p, " Local timer interrupts\n");
-}
 #endif
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
arch/arm/kernel/smp_twd.c +0 -7
index 773336e..aa99656 100644
@@ -45,10 +45,8 @@ static void twd_set_mode(enum clock_event_mode mode,
 		ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT;
 		break;
 	case CLOCK_EVT_MODE_UNUSED:
-#ifdef CONFIG_ARM_GIC_VPPI
 		disable_irq(clk->irq);
 		/* fall through */
-#endif
 	case CLOCK_EVT_MODE_SHUTDOWN:
 	default:
 		ctrl = 0;
@@ -146,7 +144,6 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 	clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
 	clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
 
-#ifdef CONFIG_ARM_GIC_VPPI
 	reqd = &__get_cpu_var(irq_reqd);
 	if (!*reqd) {
 		err = request_irq(clk->irq, percpu_timer_handler,
@@ -161,10 +158,6 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 		*reqd = true;
 	} else
 		enable_irq(clk->irq);
-#else
-	/* Make sure our local interrupt controller has this enabled */
-	gic_enable_ppi(clk->irq);
-#endif
 
 	clockevents_register_device(clk);
 }
Signature · 1 line
1.7.0.4
#15 lore raw

RFC PATCH v4 11/13 ARM: gic: remove previous local timer interrupt handling

Quoted 6 lines · Marc Zyngier

Now that all users of local timers are using CONFIG_ARM_GIC_VPPI, the now unused local timer infrastructure can be safely removed.

---

Can you also remove local_timer_ack() from MSM in this patch? If you do, feel free to add an

to this patch.

---8<----

arch/arm/mach-msm/timer.c +0 -6
index 186abdf..9c08b1c 100644
@@ -298,12 +298,6 @@ int __cpuinit local_timer_setup(struct clock_event_device *evt)
        clockevents_register_device(evt);
        return 0;
 }
-
-inline int local_timer_ack(void)
-{
-       return 1;
-}
-
 #endif
 
 struct sys_timer msm_timer = {
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#16 lore raw

RFC PATCH v4 11/13 ARM: gic: remove previous local timer interrupt handling

Quoted 8 lines · On Fri, 27 May 2011 12:30:22 -0700 Stephen Boyd <[email protected]> wrote:
Quoted 6 lines · Marc Zyngier

Now that all users of local timers are using CONFIG_ARM_GIC_VPPI, the now unused local timer infrastructure can be safely removed.

---

Quoted 6 lines

Can you also remove local_timer_ack() from MSM in this patch? If you do, feel free to add an

to this patch.

This patch breaks the kernel link when building for SMP. I'll add a weak version of local_timer_ack() for the time being.

	M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
#17 lore raw

RFC PATCH v4 11/13 ARM: gic: remove previous local timer interrupt handling

Quoted 14 lines · On Mon, 30 May 2011 09:08:05 +0100 Marc Zyngier <[email protected]> wrote:
Quoted 11 lines · On Fri, 27 May 2011 12:30:22 -0700 Stephen Boyd <[email protected]> wrote:
Quoted 6 lines · Marc Zyngier

Now that all users of local timers are using CONFIG_ARM_GIC_VPPI, the now unused local timer infrastructure can be safely removed.

---

Can you also remove local_timer_ack() from MSM in this patch? If you do, feel free to add an

Quoted 6 lines
Quoted 3 lines

to this patch.

This patch breaks the kernel link when building for SMP. I'll add a weak version of local_timer_ack() for the time being.

Actually, this is worse. Having a weak version of local_timer_ack() in smp.c clashes badly with this symbol being a #define with TWD is selected...

Let's drop that bit for now, and I'll address it in the timer series.

	M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
#18 lore raw

RFC PATCH v4 11/13 ARM: gic: remove previous local timer interrupt handling

Quoted 18 lines · Marc Zyngier
Quoted 15 lines · On Mon, 30 May 2011 09:08:05 +0100 Marc Zyngier <[email protected]> wrote:
Quoted 12 lines · On Fri, 27 May 2011 12:30:22 -0700 Stephen Boyd <[email protected]> wrote:
Quoted 6 lines · Marc Zyngier

Now that all users of local timers are using CONFIG_ARM_GIC_VPPI, the now unused local timer infrastructure can be safely removed.

---

Can you also remove local_timer_ack() from MSM in this patch? If you do, feel free to add an

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

to this patch.

This patch breaks the kernel link when building for SMP. I'll add a weak version of local_timer_ack() for the time being.

Actually, this is worse. Having a weak version of local_timer_ack() in smp.c clashes badly with this symbol being a #define with TWD is selected...

Let's drop that bit for now, and I'll address it in the timer series.

Sure. Let's punt for now. Feel free to add my Acked-by still.

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#19 lore raw

RFC PATCH v4 12/13 ARM: gic: add compute_irqnr macro for exynos4

In reply to Marc Zyngier

exynos4 has a full copy of entry-macro-gic.S, just for the sake of an offset added to the IRQ number read from the GIC.

Add a compute_irqnr macro to entry-macro-gic.S so that any platform can add it's own hook without having to copy the whole file again.

---
 arch/arm/include/asm/hardware/entry-macro-gic.S  |    3 +
 arch/arm/mach-exynos4/include/mach/entry-macro.S |   60 ++--------------------
 2 files changed, 8 insertions(+), 55 deletions(-)
arch/arm/include/asm/hardware/entry-macro-gic.S +3 -0
index db83287..a01dc80 100644
@@ -50,6 +50,9 @@
 	cmpcc	\irqnr, \irqnr
 	cmpne	\irqnr, \tmp
 	cmpcs	\irqnr, \irqnr
+#ifdef HAVE_GIC_BASE_OFFSET
+	compute_irqnr	\irqnr, \tmp
+#endif
 	.endm
 
 /* We assume that irqstat (the raw value of the IRQ acknowledge
arch/arm/mach-exynos4/include/mach/entry-macro.S +5 -55

71 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#20 lore raw

RFC PATCH v4 13/13 ARM: SMP: automatically select ARM_GIC_VPPI

In reply to Marc Zyngier

All SMP platforms are selecting ARM_GIC_VPPI.
Instead, make SMP select ARM_GIC_VPPI and remove select statements from the platform code.

---
 arch/arm/Kconfig               |    1 +
 arch/arm/mach-msm/Kconfig      |    2 --
 arch/arm/mach-omap2/Kconfig    |    1 -
 arch/arm/mach-realview/Kconfig |    2 --
 arch/arm/mach-shmobile/Kconfig |    1 -
 arch/arm/mach-tegra/Kconfig    |    1 -
 arch/arm/mach-ux500/Kconfig    |    1 -
 arch/arm/mach-vexpress/Kconfig |    1 -
 arch/arm/plat-s5p/Kconfig      |    1 -
 9 files changed, 1 insertions(+), 10 deletions(-)
arch/arm/Kconfig +1 -0
index 7275009..4780a71 100644
@@ -1323,6 +1323,7 @@ config SMP
 		 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
 		 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE
 	select USE_GENERIC_SMP_HELPERS
+	select ARM_GIC_VPPI
 	select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
 	help
 	  This enables support for systems with more than one CPU. If you have
arch/arm/mach-msm/Kconfig +0 -2
index 1ea7d6f..1516896 100644
@@ -42,7 +42,6 @@ config ARCH_MSM8X60
 				  && !MACH_MSM8X60_FFA)
 	select ARCH_MSM_SCORPIONMP
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select CPU_V7
 	select MSM_V2_TLMM
 	select MSM_GPIOMUX
@@ -53,7 +52,6 @@ config ARCH_MSM8960
 	select ARCH_MSM_SCORPIONMP
 	select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3)
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select CPU_V7
 	select MSM_V2_TLMM
 	select MSM_GPIOMUX
arch/arm/mach-omap2/Kconfig +0 -1
index 284694c..19d5891 100644
@@ -44,7 +44,6 @@ config ARCH_OMAP4
 	depends on ARCH_OMAP2PLUS
 	select CPU_V7
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select LOCAL_TIMERS if SMP
 	select PL310_ERRATA_588369
 	select PL310_ERRATA_727915
arch/arm/mach-realview/Kconfig +0 -2
index 12c7c56..b9a9805 100644
@@ -38,7 +38,6 @@ config MACH_REALVIEW_PB11MP
 	bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
 	select CPU_V6K
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select HAVE_PATA_PLATFORM
 	select ARCH_HAS_BARRIERS if SMP
 	help
@@ -77,7 +76,6 @@ config MACH_REALVIEW_PBA8
 config MACH_REALVIEW_PBX
 	bool "Support RealView(R) Platform Baseboard Explore"
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select HAVE_PATA_PLATFORM
 	select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
 	select ZONE_DMA if SPARSEMEM
arch/arm/mach-shmobile/Kconfig +0 -1
index ddcf28c..0c8f6cf 100644
@@ -26,7 +26,6 @@ config ARCH_SH73A0
 	select SH_CLK_CPG
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARM_GIC
-	select ARM_GIC_VPPI
 
 comment "SH-Mobile Board Type"
 
arch/arm/mach-tegra/Kconfig +0 -1
index eabdd90..5ec1846 100644
@@ -9,7 +9,6 @@ config ARCH_TEGRA_2x_SOC
 	bool "Tegra 2 family"
 	select CPU_V7
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select ARCH_REQUIRE_GPIOLIB
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 	select USB_ULPI if USB_SUPPORT
arch/arm/mach-ux500/Kconfig +0 -1
index 545c4bc..54429d0 100644
@@ -4,7 +4,6 @@ config UX500_SOC_COMMON
 	bool
 	default y
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select HAS_MTU
 	select NOMADIK_GPIO
 	select ARM_ERRATA_753970
arch/arm/mach-vexpress/Kconfig +0 -1
index 07a53aa..9311484 100644
@@ -5,7 +5,6 @@ config ARCH_VEXPRESS_CA9X4
 	bool "Versatile Express Cortex-A9x4 tile"
 	select CPU_V7
 	select ARM_GIC
-	select ARM_GIC_VPPI
 	select ARM_ERRATA_720789
 	select ARM_ERRATA_751472
 	select ARM_ERRATA_753970
arch/arm/plat-s5p/Kconfig +0 -1
index 0e30e25..6751bcf 100644
@@ -11,7 +11,6 @@ config PLAT_S5P
 	default y
 	select ARM_VIC if !ARCH_EXYNOS4
 	select ARM_GIC if ARCH_EXYNOS4
-	select ARM_GIC_VPPI if ARCH_EXYNOS4
 	select NO_IOPORT
 	select ARCH_REQUIRE_GPIOLIB
 	select S3C_GPIO_TRACK
Signature · 1 line
1.7.0.4