summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2011-04-24 20:31:27 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2011-04-24 20:31:27 +0000
commitad561e4755a78b67059e6b9cb974fc63735ff9ab (patch)
treeb3b5f809c73ecfcba11667d56dffe21d3ba8231a
parent5a1b2a93cd7448f144e221fa585f2d35f3be3fe6 (diff)
in azalia_intr():
* deal with the possibility of the hardware being detached, as could happen with expresscard. from deraadt@ * only return 1 if an interrupt was actually serviced. fixes "constant interrupts when the device isn't being used" issue reported by oga@.
-rw-r--r--sys/dev/pci/azalia.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index b81b51bdf6d..8dafff76461 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.194 2011/04/10 17:10:08 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.195 2011/04/24 20:31:26 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -649,25 +649,32 @@ azalia_intr(void *v)
{
azalia_t *az = v;
uint32_t intsts;
+ int ret = 0;
intsts = AZ_READ_4(az, INTSTS);
- if (intsts == 0)
- return (0);
+ if (intsts == 0 || intsts == 0xffffffff)
+ return (ret);
AZ_WRITE_4(az, INTSTS, intsts);
- if (intsts & az->pstream.intr_bit)
+ if (intsts & az->pstream.intr_bit) {
azalia_stream_intr(&az->pstream);
+ ret = 1;
+ }
- if (intsts & az->rstream.intr_bit)
+ if (intsts & az->rstream.intr_bit) {
azalia_stream_intr(&az->rstream);
+ ret = 1;
+ }
if ((intsts & HDA_INTSTS_CIS) &&
(AZ_READ_1(az, RIRBCTL) & HDA_RIRBCTL_RINTCTL) &&
- (AZ_READ_1(az, RIRBSTS) & HDA_RIRBSTS_RINTFL))
+ (AZ_READ_1(az, RIRBSTS) & HDA_RIRBSTS_RINTFL)) {
azalia_rirb_intr(az);
+ ret = 1;
+ }
- return (1);
+ return (ret);
}
void