Date: Thu, 8 Mar 2007 16:40:58 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 115531 for review Message-ID: <200703081640.l28GewAQ078096@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115531 Change 115531 by piso@piso_newluxor on 2007/03/08 16:40:44 Axe MD interrupt stray code for arm, ia64, ppc, sparc64 and sun4v. Affected files ... .. //depot/projects/soc2006/intr_filter/arm/arm/intr.c#21 edit .. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#23 edit .. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#29 edit .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#23 edit .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/intr_machdep.c#8 edit Differences ... ==== //depot/projects/soc2006/intr_filter/arm/arm/intr.c#21 (text+ko) ==== @@ -57,11 +57,8 @@ static int intrcnt_index = 0; static int last_printed = 0; -extern struct callout stray_callout_handle; - void arm_handler_execute(struct trapframe *, int); -void intr_callout_reset(void); static void intr_disab_eoi_src(void *arg); extern struct bus_space i80321_bs_tag; @@ -108,22 +105,6 @@ { } -/* Stray detection MD code */ -static struct intr_event * -walk_intrs_events(void) -{ - struct intr_event *ie; - static int i = 0; - - while (i < NIRQ) { - ie = intr_events[i++]; - if (ie != NULL) - return (ie); - } - i = 0; - return (NULL); -} - static void intr_disab_eoi_src(void *arg) { @@ -146,13 +127,3 @@ intr_event_handle(event, frame); } } - -void -intr_callout_reset(void) -{ - - return; - // XXX missing callout_init_mtx(&stray_callout_handle, ...); - callout_reset(&stray_callout_handle, hz, - &stray_detection, &walk_intrs_events); -} ==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#23 (text+ko) ==== @@ -261,10 +261,6 @@ static struct mtx ia64_intrs_lock; static struct ia64_intr *ia64_intrs[IA64_NUMI]; -extern struct callout stray_callout_handle; - -void intr_callout_reset(void); - extern struct sapic *ia64_sapics[]; extern int ia64_sapic_count; @@ -273,7 +269,6 @@ { mtx_init(&ia64_intrs_lock, "intr table", NULL, MTX_SPIN); - callout_init(&stray_callout_handle, 1); } SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL); @@ -356,32 +351,6 @@ return (intr_event_remove_handler(cookie)); } -/* Stray detection MD code */ -static struct intr_event * -walk_intr_ia64(void) -{ - struct ia64_intr *ia64_i; - static int i = 0; - - while (i < IA64_NUMI) { - mtx_lock_spin(&ia64_intrs_lock); - ia64_i = ia64_intrs[i++]; - mtx_unlock_spin(&ia64_intrs_lock); - if (ia64_i != NULL && ia64_i->event != NULL) - return (ia64_i->event); - } - i = 0; - return (NULL); -} - -void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, - &stray_detection, &walk_intr_ia64); -} - static void intr_eoi_src(void *arg) { ==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#29 (text+ko) ==== @@ -97,8 +97,6 @@ static void (*irq_enable)(uintptr_t); static void intr_eoi_src(void *arg); -extern struct callout stray_callout_handle; -void intr_callout_reset(void); static void intrcnt_setname(const char *name, int index) @@ -123,7 +121,6 @@ panic("intr_init: unable to allocate interrupt handler array"); mtx_init(&ppc_intrs_lock, "intr table", NULL, MTX_SPIN); - callout_init(&stray_callout_handle, 1); irq_enable = irq_e; @@ -197,64 +194,6 @@ return (intr_event_remove_handler(cookie)); } -#if 0 -void -intr_handle_old(u_int irq) -{ - struct ppc_intr *i; - struct intr_event *ie; - struct intr_handler *ih; - int error, sched; - - i = ppc_intrs[irq]; - if (i == NULL) - goto stray; - - atomic_add_long(i->cntp, 1); - - ie = i->event; - KASSERT(ie != NULL, ("%s: interrupt without an event", __func__)); - - if (TAILQ_EMPTY(&ie->ie_handlers)) - goto stray; - - /* - * Execute all fast interrupt handlers directly without Giant. Note - * that this means that any fast interrupt handler must be MP safe. - */ - sched = 0; - critical_enter(); - TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (ih->ih_filter == NULL) { - sched = 1; - continue; - } - CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_filter, ih->ih_argument, ih->ih_name); - ih->ih_filter(ih->ih_argument); - } - critical_exit(); - - if (sched) { - error = intr_event_schedule_thread(ie); - KASSERT(error == 0, ("%s: impossible stray interrupt", - __func__)); - } else - irq_enable(irq); - return; - -stray: - atomic_add_long(&intrcnt[0], 1); - if (intrcnt[0] <= MAX_STRAY_LOG) { - printf("stray irq %d\n", irq); - if (intrcnt[0] >= MAX_STRAY_LOG) { - printf("got %d stray interrupts, not logging anymore\n", - MAX_STRAY_LOG); - } - } -} -#endif - static void stray_int(u_int irq) { @@ -278,31 +217,6 @@ irq_enable(nb); } -static struct intr_event * -walk_intr_ppc(void) -{ - struct ppc_intr *intr; - static int i = 0; - - while (i < ppc_nintrs) { - mtx_lock_spin(&ppc_intrs_lock); - intr = ppc_intrs[i++]; - mtx_unlock_spin(&ppc_intrs_lock); - if (intr != NULL && intr->event != NULL) - return (intr->event); - } - i = 0; - return (NULL); -} - -void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, &stray_detection, - &walk_intr_ppc); -} - void intr_handle(u_int irq) { ==== //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#23 (text+ko) ==== @@ -105,10 +105,6 @@ /* protect the intr_vectors table */ static struct mtx intr_table_lock; -extern struct callout stray_callout_handle; - -void intr_callout_reset(void); - static void intr_execute_handlers(void *); static void intr_stray_level(struct trapframe *); static void intr_stray_vector(void *); @@ -234,31 +230,6 @@ { mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN); - callout_init(&stray_callout_handle, 1); -} - -/* Stray detection MD code */ -static struct intr_event * -walk_intr_sparc64(void) -{ - struct intr_vector *iv; - static int i = 0; - - while (i < IV_MAX) { - iv = &intr_vectors[i++]; - if (iv != NULL && iv->iv_event != NULL) - return (iv->iv_event); - } - i = 0; - return (NULL); -} - -void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, - &stray_detection, &walk_intr_sparc64); } static void ==== //depot/projects/soc2006/intr_filter/sun4v/sun4v/intr_machdep.c#8 (text+ko) ==== @@ -143,9 +143,6 @@ /* protect the intr_vectors table */ static struct mtx intr_table_lock; -extern struct callout stray_callout_handle; -void intr_callout_reset(void); - static void intr_execute_handlers(void *); static void intr_stray_level(struct trapframe *); static void intr_stray_vector(void *); @@ -153,30 +150,6 @@ static void intrcnt_updatename(int, const char *, int); static void cpu_intrq_alloc(void); -/* Stray detection MD code */ -static struct intr_event * -walk_intr_sun4v(void) -{ - struct intr_vector *iv; - static int i = 0; - - while (i < IV_MAX) { - iv = &intr_vectors[i++]; - if (iv != NULL && iv->iv_event != NULL) - return (iv->iv_event); - } - i = 0; - return (NULL); -} - -void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, - &stray_detection, &walk_intr_sun4v); -} - /* * not MPSAFE */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703081640.l28GewAQ078096>