arm: gic: Change GIC_DEBUG_SPURIOUS to TUNABLE

On armv6 default to 1 if INVARIANTS is set
On arm64 always default to 0

Discussed with: andrew, ian, mmel
This commit is contained in:
Emmanuel Vadot 2017-07-03 18:01:58 +00:00
parent a94fab67bb
commit c33f3f1e31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320606
2 changed files with 14 additions and 12 deletions

View File

@ -145,6 +145,14 @@ static struct resource_spec arm_gic_spec[] = {
{ -1, 0 }
};
#if defined(__arm__) && defined(INVARIANTS)
static int gic_debug_spurious = 1;
#else
static int gic_debug_spurious = 0;
#endif
TUNABLE_INT("hw.gic.debug_spurious", &gic_debug_spurious);
static u_int arm_gic_map[MAXCPU];
static struct arm_gic_softc *gic_sc = NULL;
@ -671,11 +679,10 @@ arm_gic_intr(void *arg)
*/
if (irq >= sc->nirqs) {
#ifdef GIC_DEBUG_SPURIOUS
device_printf(sc->gic_dev,
"Spurious interrupt detected: last irq: %d on CPU%d\n",
sc->last_irq[PCPU_GET(cpuid)], PCPU_GET(cpuid));
#endif
if (gic_debug_spurious)
device_printf(sc->gic_dev,
"Spurious interrupt detected: last irq: %d on CPU%d\n",
sc->last_irq[PCPU_GET(cpuid)], PCPU_GET(cpuid));
return (FILTER_HANDLED);
}
@ -700,9 +707,8 @@ arm_gic_intr(void *arg)
#endif
}
#ifdef GIC_DEBUG_SPURIOUS
sc->last_irq[PCPU_GET(cpuid)] = irq;
#endif
if (gic_debug_spurious)
sc->last_irq[PCPU_GET(cpuid)] = irq;
if ((gi->gi_flags & GI_FLAG_EARLY_EOI) == GI_FLAG_EARLY_EOI)
gic_c_write_4(sc, GICC_EOIR, irq_active_reg);

View File

@ -39,8 +39,6 @@
#ifndef _ARM_GIC_H_
#define _ARM_GIC_H_
#define GIC_DEBUG_SPURIOUS
#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */
#define GIC_LAST_SGI 15
#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */
@ -70,9 +68,7 @@ struct arm_gic_softc {
struct mtx mutex;
uint32_t nirqs;
uint32_t typer;
#ifdef GIC_DEBUG_SPURIOUS
uint32_t last_irq[MAXCPU];
#endif
#ifdef INTRNG
uint32_t gic_iidr;