Check to see if we actually have an interrupt descriptor and an interrupt

thread for each interrupt that comes in.  If we don't, log the event and
return immediately for a hardware interrupt.  For a softinterrupt, panic
instead.

Submitted by:	ben
This commit is contained in:
John Baldwin 2000-09-15 00:27:57 +00:00
parent 32d817d227
commit 518afc0f11
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65871
2 changed files with 42 additions and 0 deletions

View file

@ -92,9 +92,12 @@
#endif
u_long softintrcnt [NSWI];
static u_int straycount[NHWI];
SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr, NULL)
#define MAX_STRAY_LOG 5
/*
* Schedule a heavyweight interrupt process. This function is called
* from the interrupt handlers Xintr<num>.
@ -115,6 +118,24 @@ sched_ithd(void *cookie)
if (irq < NHWI) /* real interrupt, */
atomic_add_long(intr_countp[irq], 1); /* one more for this IRQ */
atomic_add_int(&cnt.v_intr, 1); /* one more global interrupt */
/*
* If we don't have an interrupt resource or an interrupt thread for
* this IRQ, log it as a stray interrupt.
*/
if (ir == NULL || ir->it_proc == NULL) {
if (irq < NHWI) {
if (straycount[irq] < MAX_STRAY_LOG) {
printf("stray irq %d\n", irq);
if (++straycount[irq] == MAX_STRAY_LOG)
printf("got %d stray irq %d's: "
"not logging anymore\n",
MAX_STRAY_LOG, irq);
}
return;
}
panic("sched_ithd: ithds[%d] == NULL", irq);
}
CTR3(KTR_INTR, "sched_ithd pid %d(%s) need=%d",
ir->it_proc->p_pid, ir->it_proc->p_comm, ir->it_need);

View file

@ -92,9 +92,12 @@
#endif
u_long softintrcnt [NSWI];
static u_int straycount[NHWI];
SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr, NULL)
#define MAX_STRAY_LOG 5
/*
* Schedule a heavyweight interrupt process. This function is called
* from the interrupt handlers Xintr<num>.
@ -115,6 +118,24 @@ sched_ithd(void *cookie)
if (irq < NHWI) /* real interrupt, */
atomic_add_long(intr_countp[irq], 1); /* one more for this IRQ */
atomic_add_int(&cnt.v_intr, 1); /* one more global interrupt */
/*
* If we don't have an interrupt resource or an interrupt thread for
* this IRQ, log it as a stray interrupt.
*/
if (ir == NULL || ir->it_proc == NULL) {
if (irq < NHWI) {
if (straycount[irq] < MAX_STRAY_LOG) {
printf("stray irq %d\n", irq);
if (++straycount[irq] == MAX_STRAY_LOG)
printf("got %d stray irq %d's: "
"not logging anymore\n",
MAX_STRAY_LOG, irq);
}
return;
}
panic("sched_ithd: ithds[%d] == NULL", irq);
}
CTR3(KTR_INTR, "sched_ithd pid %d(%s) need=%d",
ir->it_proc->p_pid, ir->it_proc->p_comm, ir->it_need);