svn commit: r343992 - in stable: 11/sys/dev/iwn 12/sys/dev/iwn
Andriy Voskoboinyk
avos at FreeBSD.org
Mon Feb 11 00:32:00 UTC 2019
Author: avos
Date: Mon Feb 11 00:31:58 2019
New Revision: 343992
URL: https://svnweb.freebsd.org/changeset/base/343992
Log:
MFC r343815:
iwn(4): plug initialization path vs interrupt handler races
There are few places in interrupt handler where the driver
lock is dropped; ensure that device is still running before
processing remaining ring entries.
PR: 192641
Modified:
stable/12/sys/dev/iwn/if_iwn.c
Directory Properties:
stable/12/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/11/sys/dev/iwn/if_iwn.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/12/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/12/sys/dev/iwn/if_iwn.c Mon Feb 11 00:11:02 2019 (r343991)
+++ stable/12/sys/dev/iwn/if_iwn.c Mon Feb 11 00:31:58 2019 (r343992)
@@ -3814,6 +3814,7 @@ iwn_notif_intr(struct iwn_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
uint16_t hw;
+ int is_stopped;
bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map,
BUS_DMASYNC_POSTREAD);
@@ -3845,6 +3846,11 @@ iwn_notif_intr(struct iwn_softc *sc)
case IWN_MPDU_RX_DONE:
/* An 802.11 frame has been received. */
iwn_rx_done(sc, desc, data);
+
+ is_stopped = (sc->sc_flags & IWN_FLAG_RUNNING) == 0;
+ if (__predict_false(is_stopped))
+ return;
+
break;
case IWN_RX_COMPRESSED_BA:
@@ -3885,6 +3891,11 @@ iwn_notif_intr(struct iwn_softc *sc)
IWN_UNLOCK(sc);
ieee80211_beacon_miss(ic);
IWN_LOCK(sc);
+
+ is_stopped = (sc->sc_flags &
+ IWN_FLAG_RUNNING) == 0;
+ if (__predict_false(is_stopped))
+ return;
}
}
break;
@@ -3951,6 +3962,11 @@ iwn_notif_intr(struct iwn_softc *sc)
IWN_UNLOCK(sc);
ieee80211_scan_next(vap);
IWN_LOCK(sc);
+
+ is_stopped = (sc->sc_flags & IWN_FLAG_RUNNING) == 0;
+ if (__predict_false(is_stopped))
+ return;
+
break;
}
case IWN5000_CALIBRATION_RESULT:
More information about the svn-src-all
mailing list