summaryrefslogtreecommitdiff
path: root/sys/dev/ic/rt2661.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-09-06 18:22:03 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-09-06 18:22:03 +0000
commit0b0772671e9f15d9fe3cdd186251e3cd00543acf (patch)
tree7900c3a43433458d260e97e521139da82178b0b2 /sys/dev/ic/rt2661.c
parent9a6052c92f82f7e67d5eaf76b114d786abbbe3be (diff)
Make the interrupt handler bail out early if the device wen away. Fixes
freezes that occur when removing CardBus cards when the interface is up. ok deraadt@
Diffstat (limited to 'sys/dev/ic/rt2661.c')
-rw-r--r--sys/dev/ic/rt2661.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index ca017d0892b..fffb8a640a7 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.60 2010/08/28 18:08:07 deraadt Exp $ */
+/* $OpenBSD: rt2661.c,v 1.61 2010/09/06 18:22:02 kettenis Exp $ */
/*-
* Copyright (c) 2006
@@ -1247,6 +1247,8 @@ rt2661_intr(void *arg)
r1 = RAL_READ(sc, RT2661_INT_SOURCE_CSR);
r2 = RAL_READ(sc, RT2661_MCU_INT_SOURCE_CSR);
+ if (__predict_false(r1 == 0xffffffff && r2 == 0xffffffff))
+ return 0; /* device likely went away */
if (r1 == 0 && r2 == 0)
return 0; /* not for us */