From c1836835aae8fc52cfd2674aa4ab57786592f5b7 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 7 May 2006 03:56:26 +0000 Subject: - Return if there is nothing to do in the interrupt handler. - Check for IFF_RUNNING in the interrupt loop. --- sys/dev/ic/dc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index ecbfdb9591a..a50371210fa 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.93 2006/04/23 19:44:31 kettenis Exp $ */ +/* $OpenBSD: dc.c,v 1.94 2006/05/07 03:56:25 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2542,6 +2542,9 @@ dc_intr(arg) ifp = &sc->sc_arpcom.ac_if; + if ((CSR_READ_4(sc, DC_ISR) & DC_INTRS) == 0) + return (claimed); + /* Suppress unwanted interrupts */ if (!(ifp->if_flags & IFF_UP)) { if (CSR_READ_4(sc, DC_ISR) & DC_INTRS) @@ -2552,8 +2555,9 @@ dc_intr(arg) /* Disable interrupts. */ CSR_WRITE_4(sc, DC_IMR, 0x00000000); - while(((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) && - status != 0xFFFFFFFF) { + while (((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) && + status != 0xFFFFFFFF && + (ifp->if_flags & IFF_RUNNING)) { claimed = 1; CSR_WRITE_4(sc, DC_ISR, status); -- cgit v1.2.3