diff options
| author | martin <martin@NetBSD.org> | 2003-12-23 13:46:18 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2003-12-23 13:46:18 +0000 |
| commit | d11a3aeebbc4d3c8d06caff344f1c03aa77b9be4 (patch) | |
| tree | 8b2bc3b718bb0ed9df3d9eb9a91065d78d71bc24 /sys/dev | |
| parent | 041503b9d5ca44b8cdf7cab5b863c562f0e502a3 (diff) | |
Only ACK pending interrupts (instead of all possible). Log interrupts we
probably should have handled but didn't. Minor cleanup.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/sbus/stp4020.c | 18 | ||||
| -rw-r--r-- | sys/dev/sbus/stp4020reg.h | 3 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index 4dd6cbbaddf..dbc502fc7bf 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $NetBSD: stp4020.c,v 1.34 2003/01/07 20:39:19 martin Exp $ */ +/* $NetBSD: stp4020.c,v 1.35 2003/12/23 13:46:18 martin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.34 2003/01/07 20:39:19 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.35 2003/12/23 13:46:18 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -102,7 +102,6 @@ struct stp4020_socket { struct stp4020_softc *sc; /* Back link */ int flags; #define STP4020_SOCKET_BUSY 0x0001 -#define STP4020_SOCKET_SHUTDOWN 0x0002 int sock; /* Socket number (0 or 1) */ int sbus_intno; /* Do we use first (0) or second (1) interrupt? */ @@ -546,8 +545,10 @@ stp4020_attach_socket(h, speed) : STP4020_ICR0_SCILVL_SB0); stp4020_wr_sockctl(h, STP4020_ICR0_IDX, v); - /* Get live status bits from ISR0 */ + /* Get live status bits from ISR0 and clear pending interrupts */ v = stp4020_rd_sockctl(h, STP4020_ISR0_IDX); + stp4020_wr_sockctl(h, STP4020_ISR0_IDX, v); + if ((v & (STP4020_ISR0_CD1ST|STP4020_ISR0_CD2ST)) == 0) return; @@ -679,8 +680,7 @@ stp4020_intr(arg) v = stp4020_rd_sockctl(h, STP4020_ISR0_IDX); /* Ack all interrupts at once. */ - stp4020_wr_sockctl(h, STP4020_ISR0_IDX, - STP4020_ISR0_ALL_STATUS_IRQ); + stp4020_wr_sockctl(h, STP4020_ISR0_IDX, v); #ifdef STP4020_DEBUG if (stp4020_debug != 0) { @@ -768,6 +768,9 @@ stp4020_intr(arg) r = 1; } + if ((v & ~STP4020_ISR0_LIVE) && r == 0) + printf("stp4020[%d]: unhandled interrupt: 0x%x\n", h->sock, v); + } splx(s); @@ -1011,7 +1014,6 @@ stp4020_chip_socket_enable(pch) /* * Check the card type. * Enable socket I/O interrupts for IO cards. - * We use level SB_INT[0] for I/O interrupts. */ if (pcmcia_card_gettype(h->pcmcia) == PCMCIA_IFTYPE_IO) { v &= ~(STP4020_ICR0_IOILVL|STP4020_ICR0_IFTYPE); @@ -1026,6 +1028,8 @@ stp4020_chip_socket_enable(pch) v &= ~(STP4020_ICR0_IOILVL|STP4020_ICR0_IFTYPE |STP4020_ICR0_SPKREN); v |= STP4020_ICR0_IFTYPE_MEM; + h->int_enable = h->int_disable = v; + DPRINTF(("%s: configuring card for IO useage\n", h->sc->sc_dev.dv_xname)); DPRINTF(("%s: configuring card for MEM ONLY useage\n", h->sc->sc_dev.dv_xname)); } stp4020_wr_sockctl(h, STP4020_ICR0_IDX, v); diff --git a/sys/dev/sbus/stp4020reg.h b/sys/dev/sbus/stp4020reg.h index ba8c8563aa2..9541095f7b8 100644 --- a/sys/dev/sbus/stp4020reg.h +++ b/sys/dev/sbus/stp4020reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: stp4020reg.h,v 1.1 1998/11/22 22:14:35 pk Exp $ */ +/* $NetBSD: stp4020reg.h,v 1.2 2003/12/23 13:46:18 martin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -165,7 +165,6 @@ #define STP4020_ISR0_RDYCHG 0x0400 /* ready/busy status change */ #define STP4020_ISR0_WPCHG 0x0200 /* write protect status change */ #define STP4020_ISR0_PCTO 0x0100 /* PC card access timeout */ -#define STP4020_ISR0_ALL_STATUS_IRQ 0x7f00 #define STP4020_ISR0_LIVE 0x00ff /* live status bit mask */ #define STP4020_ISR0_CD2ST 0x0080 /* card detect 2 live status */ |
