From owner-p4-projects@FreeBSD.ORG Thu Mar 8 16:40:59 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2183A16A405; Thu, 8 Mar 2007 16:40:59 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDE7816A400 for ; Thu, 8 Mar 2007 16:40:58 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id DB3ED13C441 for ; Thu, 8 Mar 2007 16:40:58 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l28Gew0k078116 for ; Thu, 8 Mar 2007 16:40:58 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l28GewAQ078096 for perforce@freebsd.org; Thu, 8 Mar 2007 16:40:58 GMT (envelope-from piso@freebsd.org) Date: Thu, 8 Mar 2007 16:40:58 GMT Message-Id: <200703081640.l28GewAQ078096@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 115531 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 16:40:59 -0000 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 */