diff --git a/sys/contrib/ncsw/inc/xx_ext.h b/sys/contrib/ncsw/inc/xx_ext.h index 32e0c39d3634..14e9426a18d2 100644 --- a/sys/contrib/ncsw/inc/xx_ext.h +++ b/sys/contrib/ncsw/inc/xx_ext.h @@ -205,7 +205,7 @@ uint32_t XX_DisableAllIntr(void); void XX_RestoreAllIntr(uint32_t flags); -t_Error XX_PreallocAndBindIntr(uintptr_t irq, unsigned int cpu); +t_Error XX_PreallocAndBindIntr(device_t dev, uintptr_t irq, unsigned int cpu); t_Error XX_DeallocIntr(uintptr_t irq); /**************************************************************************//** diff --git a/sys/contrib/ncsw/user/env/xx.c b/sys/contrib/ncsw/user/env/xx.c index 4cf78d52f9eb..afaeb562b8e4 100644 --- a/sys/contrib/ncsw/user/env/xx.c +++ b/sys/contrib/ncsw/user/env/xx.c @@ -95,8 +95,7 @@ MTX_SYSINIT(XX_MallocTrackLockInit, &XX_MallocTrackLock, /* Interrupt info */ #define XX_INTR_FLAG_PREALLOCATED (1 << 0) -#define XX_INTR_FLAG_BOUND (1 << 1) -#define XX_INTR_FLAG_FMAN_FIX (1 << 2) +#define XX_INTR_FLAG_FMAN_FIX (1 << 1) struct XX_IntrInfo { driver_intr_t *handler; @@ -320,16 +319,6 @@ XX_Dispatch(void *arg) info = arg; - /* Bind this thread to proper CPU when SMP has been already started. */ - if ((info->flags & XX_INTR_FLAG_BOUND) == 0 && smp_started && - info->cpu >= 0) { - thread_lock(curthread); - sched_bind(curthread, info->cpu); - thread_unlock(curthread); - - info->flags |= XX_INTR_FLAG_BOUND; - } - if (info->handler == NULL) { printf("%s(): IRQ handler is NULL!\n", __func__); return; @@ -339,7 +328,7 @@ XX_Dispatch(void *arg) } t_Error -XX_PreallocAndBindIntr(uintptr_t irq, unsigned int cpu) +XX_PreallocAndBindIntr(device_t dev, uintptr_t irq, unsigned int cpu) { struct resource *r; unsigned int inum; @@ -352,6 +341,10 @@ XX_PreallocAndBindIntr(uintptr_t irq, unsigned int cpu) if (error != 0) return (error); + error = bus_bind_intr(dev, r, cpu); + if (error != 0) + return (error); + XX_IntrInfo[inum].flags = XX_INTR_FLAG_PREALLOCATED; XX_IntrInfo[inum].cpu = cpu; diff --git a/sys/dev/dpaa/portals_common.c b/sys/dev/dpaa/portals_common.c index 02729f2fcb7d..971dd5793972 100644 --- a/sys/dev/dpaa/portals_common.c +++ b/sys/dev/dpaa/portals_common.c @@ -120,8 +120,7 @@ dpaa_portal_alloc_res(device_t dev, struct dpaa_portals_devinfo *di, int cpu) device_printf(dev, "Could not allocate irq.\n"); return (ENXIO); } - - err = XX_PreallocAndBindIntr((uintptr_t)sc->sc_dp[cpu].dp_ires, cpu); + err = XX_PreallocAndBindIntr(dev, (uintptr_t)sc->sc_dp[cpu].dp_ires, cpu); if (err != E_OK) { device_printf(dev, "Could not prealloc and bind interrupt\n");