summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/rt2560.c7
-rw-r--r--sys/dev/ic/rt2661.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 5464bd2d7da..730e02df478 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.54 2010/08/28 18:08:07 deraadt Exp $ */
+/* $OpenBSD: rt2560.c,v 1.55 2010/09/06 18:22:00 kettenis Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1337,7 +1337,10 @@ rt2560_intr(void *arg)
struct ifnet *ifp = &sc->sc_ic.ic_if;
uint32_t r;
- if ((r = RAL_READ(sc, RT2560_CSR7)) == 0)
+ r = RAL_READ(sc, RT2560_CSR7);
+ if (__predict_false(r == 0xffffffff))
+ return 0; /* device likely went away */
+ if (r == 0)
return 0; /* not for us */
/* disable interrupts */
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 */