summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2009-11-03 06:00:41 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2009-11-03 06:00:41 +0000
commitd5cfa73708ba1b25a275f4a89bec02317b750b6a (patch)
tree22efb8d786697a97a06bf2b06bd1b19979535ad2 /sys/dev/pci
parent2d9df90bb88e78f72cc5932777d19237b73c6605 (diff)
Simplify and remove debug cruft from interrupt handler. Original diff from
James Giannoules. Some KNF from me.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/mpii.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index c9c7b4280ca..f9f9c9bd4e9 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.1 2009/10/27 11:19:04 dlg Exp $ */
+/* $OpenBSD: mpii.c,v 1.2 2009/11/03 06:00:40 marco Exp $ */
/*
* Copyright (c) James Giannoules
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -2094,41 +2094,16 @@ int
mpii_intr(void *arg)
{
struct mpii_softc *sc = arg;
- int rv = 0, count = 0;
- int max_processed_replies = 0;
-#ifdef MPII_DEBUG
- int disable_interrupt = 0;
- u_int32_t db;
-
- if (disable_interrupt)
+ if (mpii_reply(sc) < 0)
return (0);
- db = mpii_read_db(sc);
- if ((db & MPII_DOORBELL_STATE) != MPII_DOORBELL_STATE_OPER) {
- printf("db not operational\n");
- disable_interrupt = 1;
- return (0);
- }
-#endif
- while (mpii_reply(sc) >= 0) {
- rv = 1;
- if (count++ == 100) {
- /* disable interrupts */
- mpii_write(sc, MPII_INTR_MASK,
- MPII_INTR_MASK_RESET | MPII_INTR_MASK_REPLY
- | MPII_INTR_MASK_DOORBELL);
- mpii_write_reply_post(sc, sc->sc_reply_post_host_index);
- return (0);
- }
- }
+ while (mpii_reply(sc) >= 0)
+ ;
mpii_write_reply_post(sc, sc->sc_reply_post_host_index);
- if (count > max_processed_replies)
- max_processed_replies = count;
-
- return (rv);
+ return (1);
}
void