From fceb240d6bda038df75576bf31c1ded1dafb4ae5 Mon Sep 17 00:00:00 2001 From: Elliott Mitchell Date: Tue, 11 Jun 2024 13:37:35 -0700 Subject: [PATCH] intrng: split intr_isrc_assign_cpu() intr_isrc_assign_cpu() failed to split the intr_event functionality from the assignment functionality. The actual assignment is a PIC-level operation and as such should be separate. --- sys/kern/subr_intr.c | 21 ++++++++++++++------- sys/sys/intr.h | 1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index da290ec2192b76..16251561002c27 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -635,14 +635,10 @@ intr_isrc_post_filter(void *arg) PIC_POST_FILTER(isrc->isrc_dev, isrc); } -/* - * Interrupt source assign_cpu method for MI interrupt framework. - */ -static int -intr_isrc_assign_cpu(void *arg, int cpu) +int +intr_assign_irq(struct intr_irqsrc *isrc, int cpu, bool do_assignment) { #ifdef SMP - struct intr_irqsrc *isrc = arg; int error; mtx_lock(&isrc_table_lock); @@ -660,7 +656,7 @@ intr_isrc_assign_cpu(void *arg, int cpu) * PIC is expected to change isrc_cpu appropriately to keep us well * informed if the call is successful. */ - if (irq_assign_cpu) { + if (do_assignment) { error = PIC_BIND_INTR(isrc->isrc_dev, isrc); if (error) { CPU_ZERO(&isrc->isrc_cpu); @@ -675,6 +671,17 @@ intr_isrc_assign_cpu(void *arg, int cpu) #endif } +/* + * Interrupt source assign_cpu method for MI interrupt framework. + */ +static int +intr_isrc_assign_cpu(void *arg, int cpu) +{ + struct intr_irqsrc *isrc = arg; + + return (intr_assign_irq(isrc, cpu, irq_assign_cpu)); +} + /* * Create interrupt event for interrupt source. */ diff --git a/sys/sys/intr.h b/sys/sys/intr.h index 5b092b3447383d..b3717f86df7851 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -103,6 +103,7 @@ int intr_isrc_deregister(struct intr_irqsrc *); int intr_isrc_register(struct intr_irqsrc *, device_t, u_int, const char *, ...) __printflike(4, 5); +int intr_assign_irq(struct intr_irqsrc *isrc, int cpu, bool do_assignment); int intr_add_handler(struct intr_irqsrc *, const char *, driver_filter_t, driver_intr_t, void *, enum intr_type, void **); int intr_describe(struct intr_irqsrc *isrc, void *cookie, const char *descr);