diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 7655c594976..782b790a3a0 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1389,6 +1389,7 @@ ath_intr(void *arg) } } if (status & HAL_INT_RXEOL) { + int imask = sc->sc_imask; /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1398,10 +1399,22 @@ ath_intr(void *arg) /* * Disable RXEOL/RXORN - prevent an interrupt * storm until the PCU logic can be reset. + * In case the interface is reset some other + * way before "sc_kickpcu" is called, don't + * modify sc_imask - that way if it is reset + * by a call to ath_reset() somehow, the + * interrupt mask will be correctly reprogrammed. */ - sc->sc_imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); - ath_hal_intrset(ah, sc->sc_imask); + imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); + ath_hal_intrset(ah, imask); + /* + * Enqueue an RX proc, to handled whatever + * is in the RX queue. + * This will then kick the PCU. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); sc->sc_rxlink = NULL; + sc->sc_kickpcu = 1; } if (status & HAL_INT_TXURN) { sc->sc_stats.ast_txurn++; @@ -3776,6 +3789,25 @@ rx_next: if (ath_dfs_tasklet_needed(sc, sc->sc_curchan)) taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); + /* + * Now that all the RX frames were handled that + * need to be handled, kick the PCU if there's + * been an RXEOL condition. + */ + if (sc->sc_kickpcu) { + sc->sc_kickpcu = 0; + ath_stoprecv(sc); + sc->sc_imask |= (HAL_INT_RXEOL | HAL_INT_RXORN); + if (ath_startrecv(sc) != 0) { + if_printf(ifp, + "%s: couldn't restart RX after RXEOL; resetting\n", + __func__); + ath_reset(ifp); + return; + } + ath_hal_intrset(ah, sc->sc_imask); + } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 6b148c316ca..ce370f73d44 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -254,7 +254,8 @@ struct ath_softc { sc_tdma : 1,/* TDMA in use */ sc_setcca : 1,/* set/clr CCA with TDMA */ sc_resetcal : 1,/* reset cal state next trip */ - sc_rxslink : 1;/* do self-linked final descriptor */ + sc_rxslink : 1,/* do self-linked final descriptor */ + sc_kickpcu : 1;/* kick PCU RX on next RX proc */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */