summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2011-04-24 20:31:26 +0000
committerjakemsr <jakemsr@openbsd.org>2011-04-24 20:31:26 +0000
commitf993c5a7e770558125ea23b34ce20c850622847c (patch)
tree382d9e21ef280fdea1e7d42793318dedcb34c50e
parentA first attempt at merging our local changes and fixes into the 2.17 codebase. (diff)
downloadwireguard-openbsd-f993c5a7e770558125ea23b34ce20c850622847c.tar.xz
wireguard-openbsd-f993c5a7e770558125ea23b34ce20c850622847c.zip
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