From 60aa1fe695a26997023ad371c8a7fb6cb12df9c5 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:33:01 +0000 Subject: [PATCH] Disable interrupts in filter in order to avoid interrupt storm and CPU starvation --- sys/dev/smc/if_smc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/dev/smc/if_smc.c b/sys/dev/smc/if_smc.c index 06f6ca0a3c59..f6df3503d168 100644 --- a/sys/dev/smc/if_smc.c +++ b/sys/dev/smc/if_smc.c @@ -807,6 +807,10 @@ smc_intr(void *context) struct smc_softc *sc; sc = (struct smc_softc *)context; + /* + * Block interrupts in order to let smc_task_intr to kick in + */ + smc_write_1(sc, MSK, 0); taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); return (FILTER_HANDLED); } @@ -826,13 +830,6 @@ smc_task_intr(void *context, int pending) smc_select_bank(sc, 2); - /* - * Get the current mask, and then block all interrupts while we're - * working. - */ - if ((ifp->if_capenable & IFCAP_POLLING) == 0) - smc_write_1(sc, MSK, 0); - /* * Find out what interrupts are flagged. */