diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-11-28 22:13:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-11-28 22:13:49 +0000 |
commit | dcc6620d2d2765722cd26606f849d7f65b83dd99 (patch) | |
tree | 52a1ed5a15ce7cbfd90c090ed494a064d3a277d6 /sys/dev | |
parent | 993c79b2903263eadf8818d6f8ea2dc1f0fc3d6f (diff) |
Get rid of "forever" loop in the interrupt handler such that we drop out of the
interrupt handler if the "Rx Descriptor Unavailable" bit is set and no new
mbufs are available to populate descriptors. Fixes hangs seen with MCLGETI.
ok sthen@, deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/re.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 24e0d6d6b08..e552ef61f8d 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.131 2010/11/28 22:08:59 kettenis Exp $ */ +/* $OpenBSD: re.c,v 1.132 2010/11/28 22:13:48 kettenis Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1605,21 +1605,17 @@ re_intr(void *arg) return (0); rx = tx = 0; - for (;;) { - - status = CSR_READ_2(sc, RL_ISR); - /* If the card has gone away the read returns 0xffff. */ - if (status == 0xffff) - break; - if (status) - CSR_WRITE_2(sc, RL_ISR, status); - - if (status & RL_ISR_TIMEOUT_EXPIRED) - claimed = 1; + status = CSR_READ_2(sc, RL_ISR); + /* If the card has gone away the read returns 0xffff. */ + if (status == 0xffff) + return (0); + if (status) + CSR_WRITE_2(sc, RL_ISR, status); - if ((status & RL_INTRS_CPLUS) == 0) - break; + if (status & RL_ISR_TIMEOUT_EXPIRED) + claimed = 1; + if (status & RL_INTRS_CPLUS) { if (status & (sc->rl_rx_ack | RL_ISR_RX_ERR)) { rx |= re_rxeof(sc); claimed = 1; |