diff options
author | Luiz Otavio O Souza <loos@FreeBSD.org> | 2015-04-17 22:17:22 +0000 |
---|---|---|
committer | Luiz Otavio O Souza <loos@FreeBSD.org> | 2015-04-17 22:17:22 +0000 |
commit | 8e64cb895d76528a2a8bc2e3a6350b907dc5eb84 (patch) | |
tree | fb0071b73f7e664da3ec9a3b3d1f19fe824454ae /sys | |
parent | 384f656a1a43eda0ac5ae1d715d9ca789dd0b64d (diff) | |
download | src-8e64cb895d76528a2a8bc2e3a6350b907dc5eb84.tar.gz src-8e64cb895d76528a2a8bc2e3a6350b907dc5eb84.zip |
Remove unnecessary checks and fix an issue where the interrupt handler
could return with lock held.
Notes
Notes:
svn path=/head/; revision=281669
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/allwinner/if_emac.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c index d43f301fa690..ec3c32324880 100644 --- a/sys/arm/allwinner/if_emac.c +++ b/sys/arm/allwinner/if_emac.c @@ -662,9 +662,6 @@ emac_intr(void *arg) sc = (struct emac_softc *)arg; EMAC_LOCK(sc); - ifp = sc->emac_ifp; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; /* Disable all interrupts */ EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); @@ -678,18 +675,17 @@ emac_intr(void *arg) emac_rxeof(sc, sc->emac_rx_process_limit); /* Transmit Interrupt check */ - if (reg_val & EMAC_INT_STA_TX){ + if (reg_val & EMAC_INT_STA_TX) { emac_txeof(sc); + ifp = sc->emac_ifp; if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) emac_start_locked(ifp); } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - /* Re-enable interrupt mask */ - reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); - reg_val |= EMAC_INT_EN; - EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); - } + /* Re-enable interrupt mask */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); + reg_val |= EMAC_INT_EN; + EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); EMAC_UNLOCK(sc); } |