From 86bce7493764753605d5317110ce80b87782b004 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Tue, 17 Jul 2012 03:18:12 +0000 Subject: [PATCH] Move unmask IRQ function call up to nexus device level. FDT-enabled targets were broken after r238043 that relies on device up the hierarchy to properly setup interrupt. nexus device for ARM platforms did job only partially: setting handler but not unmasking interrupt. Unmasking was performed by platform code. Reviewed by: andrew@ --- sys/arm/arm/nexus.c | 8 ++++++-- sys/arm/at91/at91.c | 3 --- sys/arm/econa/econa.c | 2 -- sys/arm/s3c2xx0/s3c24x0.c | 1 - sys/arm/xscale/i8134x/i81342.c | 1 - sys/arm/xscale/pxa/pxa_obio.c | 1 - 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 04cf1bfa8f6f..93643d5cc9e7 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -117,12 +117,16 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { + int irq; if ((rman_get_flags(res) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; - arm_setup_irqhandler(device_get_nameunit(child), - filt, intr, arg, rman_get_start(res), flags, cookiep); + for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { + arm_setup_irqhandler(device_get_nameunit(child), + filt, intr, arg, irq, flags, cookiep); + arm_unmask_irq(irq); + } return (0); } diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c index 4fe6143dc270..deb3c3892d6b 100644 --- a/sys/arm/at91/at91.c +++ b/sys/arm/at91/at91.c @@ -397,7 +397,6 @@ at91_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - struct at91_softc *sc = device_get_softc(dev); int error; if (rman_get_start(ires) == AT91_IRQ_SYSTEM && filt == NULL) @@ -407,8 +406,6 @@ at91_setup_intr(device_t dev, device_t child, if (error) return (error); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IECR, - 1 << rman_get_start(ires)); return (0); } diff --git a/sys/arm/econa/econa.c b/sys/arm/econa/econa.c index f96dfc399ae8..9f29a7f868e5 100644 --- a/sys/arm/econa/econa.c +++ b/sys/arm/econa/econa.c @@ -602,8 +602,6 @@ econa_setup_intr(device_t dev, device_t child, if (error) return (error); - arm_unmask_irq(rman_get_start(ires)); - return (0); } diff --git a/sys/arm/s3c2xx0/s3c24x0.c b/sys/arm/s3c2xx0/s3c24x0.c index cddd435b6132..f90c15dbcbd2 100644 --- a/sys/arm/s3c2xx0/s3c24x0.c +++ b/sys/arm/s3c2xx0/s3c24x0.c @@ -220,7 +220,6 @@ s3c24x0_setup_intr(device_t dev, device_t child, /* Enable the external interrupt pin */ s3c24x0_enable_ext_intr(irq - S3C24X0_EXTIRQ_MIN); } - arm_unmask_irq(irq); } return (0); } diff --git a/sys/arm/xscale/i8134x/i81342.c b/sys/arm/xscale/i8134x/i81342.c index 2bfab78ccc12..bb3795c5aeb2 100644 --- a/sys/arm/xscale/i8134x/i81342.c +++ b/sys/arm/xscale/i8134x/i81342.c @@ -435,7 +435,6 @@ i81342_setup_intr(device_t dev, device_t child, struct resource *ires, filt, intr, arg, cookiep); if (error) return (error); - arm_unmask_irq(rman_get_start(ires)); return (0); } diff --git a/sys/arm/xscale/pxa/pxa_obio.c b/sys/arm/xscale/pxa/pxa_obio.c index 0f7e4a6f2110..5cbb9c38ec2a 100644 --- a/sys/arm/xscale/pxa/pxa_obio.c +++ b/sys/arm/xscale/pxa/pxa_obio.c @@ -181,7 +181,6 @@ pxa_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, filter, ithread, arg, cookiep); if (error) return (error); - arm_unmask_irq(rman_get_start(irq)); return (0); }