diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2006-01-29 10:47:36 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2006-01-29 10:47:36 +0000 |
commit | cf92e6837fc34745cc7b36d6da641a4a7dcc9d4e (patch) | |
tree | 737efdccd68c559927f2d763383bd5c0fa53265a /sys | |
parent | 3d76b07b9d92efa127be76a0c31dde39d891a633 (diff) |
Add a alpha_shared_intr_reset_strays() function that resets the stray
interrupt counter for a given shared interrupt descriptor.
When an interrupt is successfully handled, reset the strays counter,
thus preventing a "slow leak" from eventually shutting off the interrupt
vector.
from NetBSD via KUDO Takashi
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/dev/shared_intr.c | 15 | ||||
-rw-r--r-- | sys/arch/alpha/include/intr.h | 4 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_1000.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_1000a.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_550.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_6600.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_eb164.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_eb64plus.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/pci_kn20aa.c | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/sio_pic.c | 4 |
10 files changed, 41 insertions, 17 deletions
diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c index 626231f45ab..685e3e92f28 100644 --- a/sys/arch/alpha/dev/shared_intr.c +++ b/sys/arch/alpha/dev/shared_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shared_intr.c,v 1.13 2004/12/25 23:02:23 miod Exp $ */ +/* $OpenBSD: shared_intr.c,v 1.14 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: shared_intr.c,v 1.13 2000/03/19 01:46:18 thorpej Exp $ */ /* @@ -244,6 +244,19 @@ alpha_shared_intr_set_maxstrays(intr, num, newmaxstrays) } void +alpha_shared_intr_reset_strays(intr, num) + struct alpha_shared_intr *intr; + unsigned int num; +{ + + /* + * Don't bother blocking interrupts; this doesn't have to be + * precise, but it does need to be fast. + */ + intr[num].intr_nstrays = 0; +} + +void alpha_shared_intr_stray(intr, num, basename) struct alpha_shared_intr *intr; unsigned int num; diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h index ca437f2b76f..ea5b7d5c697 100644 --- a/sys/arch/alpha/include/intr.h +++ b/sys/arch/alpha/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.20 2005/04/19 15:29:47 mickey Exp $ */ +/* $OpenBSD: intr.h,v 1.21 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */ /*- @@ -242,6 +242,8 @@ void alpha_shared_intr_set_dfltsharetype(struct alpha_shared_intr *, unsigned int, int); void alpha_shared_intr_set_maxstrays(struct alpha_shared_intr *, unsigned int, int); +void alpha_shared_intr_reset_strays(struct alpha_shared_intr *, + unsigned int); void alpha_shared_intr_stray(struct alpha_shared_intr *, unsigned int, const char *); void alpha_shared_intr_set_private(struct alpha_shared_intr *, diff --git a/sys/arch/alpha/pci/pci_1000.c b/sys/arch/alpha/pci/pci_1000.c index 430aae9421c..86521b635da 100644 --- a/sys/arch/alpha/pci/pci_1000.c +++ b/sys/arch/alpha/pci/pci_1000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_1000.c,v 1.2 2004/06/28 02:28:42 aaron Exp $ */ +/* $OpenBSD: pci_1000.c,v 1.3 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_1000.c,v 1.12 2001/07/27 00:25:20 thorpej Exp $ */ /* @@ -271,7 +271,8 @@ dec_1000_iointr(framep, vec) "dec_1000 irq"); if (ALPHA_SHARED_INTR_DISABLE(dec_1000_pci_intr, irq)) dec_1000_disable_intr(irq); - } + } else + alpha_shared_intr_reset_strays(dec_1000_pci_intr, irq); return; } #if NSIO > 0 || NPCEB > 0 diff --git a/sys/arch/alpha/pci/pci_1000a.c b/sys/arch/alpha/pci/pci_1000a.c index 0579b368bed..3b5abeedf5c 100644 --- a/sys/arch/alpha/pci/pci_1000a.c +++ b/sys/arch/alpha/pci/pci_1000a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_1000a.c,v 1.2 2004/06/28 02:28:42 aaron Exp $ */ +/* $OpenBSD: pci_1000a.c,v 1.3 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_1000a.c,v 1.14 2001/07/27 00:25:20 thorpej Exp $ */ /* @@ -292,7 +292,8 @@ dec_1000a_iointr(framep, vec) "dec_1000a irq"); if (ALPHA_SHARED_INTR_DISABLE(dec_1000a_pci_intr, irq)) dec_1000a_disable_intr(irq); - } + } else + alpha_shared_intr_reset_strays(dec_1000a_pci_intr, irq); return; } #if NSIO > 0 || NPCEB > 0 diff --git a/sys/arch/alpha/pci/pci_550.c b/sys/arch/alpha/pci/pci_550.c index 85eea3737d1..a8a3c9260af 100644 --- a/sys/arch/alpha/pci/pci_550.c +++ b/sys/arch/alpha/pci/pci_550.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_550.c,v 1.13 2005/07/24 14:21:29 miod Exp $ */ +/* $OpenBSD: pci_550.c,v 1.14 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_550.c,v 1.18 2000/06/29 08:58:48 mrg Exp $ */ /*- @@ -414,7 +414,8 @@ dec_550_iointr(framep, vec) "dec 550 irq"); if (ALPHA_SHARED_INTR_DISABLE(dec_550_pci_intr, irq)) dec_550_intr_disable(irq); - } + } else + alpha_shared_intr_reset_strays(dec_550_pci_intr, irq); return; } #if NSIO diff --git a/sys/arch/alpha/pci/pci_6600.c b/sys/arch/alpha/pci/pci_6600.c index aad8df90c2d..2e41594a507 100644 --- a/sys/arch/alpha/pci/pci_6600.c +++ b/sys/arch/alpha/pci/pci_6600.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_6600.c,v 1.12 2004/06/28 17:25:05 deraadt Exp $ */ +/* $OpenBSD: pci_6600.c,v 1.13 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_6600.c,v 1.5 2000/06/06 00:50:15 thorpej Exp $ */ /*- @@ -295,7 +295,8 @@ dec_6600_iointr(framep, vec) irqtype); if (ALPHA_SHARED_INTR_DISABLE(dec_6600_pci_intr, irq)) dec_6600_intr_disable(irq); - } + } else + alpha_shared_intr_reset_strays(dec_6600_pci_intr, irq); return; } #if NSIO diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c index 5aec27d2658..8a631544116 100644 --- a/sys/arch/alpha/pci/pci_eb164.c +++ b/sys/arch/alpha/pci/pci_eb164.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_eb164.c,v 1.16 2004/06/28 02:28:43 aaron Exp $ */ +/* $OpenBSD: pci_eb164.c,v 1.17 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_eb164.c,v 1.27 2000/06/06 00:50:15 thorpej Exp $ */ /*- @@ -366,7 +366,8 @@ eb164_iointr(framep, vec) "eb164 irq"); if (ALPHA_SHARED_INTR_DISABLE(eb164_pci_intr, irq)) eb164_intr_disable(irq); - } + } else + alpha_shared_intr_reset_strays(eb164_pci_intr, irq); return; } #if NSIO diff --git a/sys/arch/alpha/pci/pci_eb64plus.c b/sys/arch/alpha/pci/pci_eb64plus.c index a4857570e98..3f6a485afc1 100644 --- a/sys/arch/alpha/pci/pci_eb64plus.c +++ b/sys/arch/alpha/pci/pci_eb64plus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_eb64plus.c,v 1.6 2004/06/28 02:28:43 aaron Exp $ */ +/* $OpenBSD: pci_eb64plus.c,v 1.7 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_eb64plus.c,v 1.10 2001/07/27 00:25:20 thorpej Exp $ */ /*- @@ -261,7 +261,8 @@ eb64plus_iointr(framep, vec) "eb64+ irq"); if (ALPHA_SHARED_INTR_DISABLE(eb64plus_pci_intr, irq)) eb64plus_intr_disable(irq); - } + } else + alpha_shared_intr_reset_strays(eb64plus_pci_intr, irq); return; } #if NSIO diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c index ba6eb7fd1cc..e9b39642e39 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.c +++ b/sys/arch/alpha/pci/pci_kn20aa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_kn20aa.c,v 1.20 2004/06/28 02:28:43 aaron Exp $ */ +/* $OpenBSD: pci_kn20aa.c,v 1.21 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: pci_kn20aa.c,v 1.21 1996/11/17 02:05:27 cgd Exp $ */ /* @@ -257,7 +257,8 @@ kn20aa_iointr(framep, vec) if (kn20aa_pci_intr[irq].intr_nstrays == kn20aa_pci_intr[irq].intr_maxstrays) kn20aa_disable_intr(irq); - } + } else + alpha_shared_intr_reset_strays(kn20aa_pci_intr, irq); return; } #if NSIO diff --git a/sys/arch/alpha/pci/sio_pic.c b/sys/arch/alpha/pci/sio_pic.c index 84a462cbe0d..afa3299560c 100644 --- a/sys/arch/alpha/pci/sio_pic.c +++ b/sys/arch/alpha/pci/sio_pic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio_pic.c,v 1.24 2004/06/28 02:28:43 aaron Exp $ */ +/* $OpenBSD: sio_pic.c,v 1.25 2006/01/29 10:47:35 martin Exp $ */ /* $NetBSD: sio_pic.c,v 1.28 2000/06/06 03:10:13 thorpej Exp $ */ /*- @@ -533,6 +533,8 @@ sio_iointr(framep, vec) if (!alpha_shared_intr_dispatch(sio_intr, irq)) alpha_shared_intr_stray(sio_intr, irq, "isa irq"); + else + alpha_shared_intr_reset_strays(sio_intr, irq); /* * Some versions of the machines which use the SIO |