From owner-svn-src-all@freebsd.org Mon Feb 11 00:31:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A4D14E2F24; Mon, 11 Feb 2019 00:31:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45ABE74236; Mon, 11 Feb 2019 00:31:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DF2B20307; Mon, 11 Feb 2019 00:31:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1B0VwpU056124; Mon, 11 Feb 2019 00:31:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1B0Vwtn056123; Mon, 11 Feb 2019 00:31:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902110031.x1B0Vwtn056123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 11 Feb 2019 00:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r343992 - in stable: 11/sys/dev/iwn 12/sys/dev/iwn X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/sys/dev/iwn 12/sys/dev/iwn X-SVN-Commit-Revision: 343992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45ABE74236 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2019 00:31:59 -0000 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/11/sys/dev/iwn/if_iwn.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/iwn/if_iwn.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/11/sys/dev/iwn/if_iwn.c Mon Feb 11 00:11:02 2019 (r343991) +++ stable/11/sys/dev/iwn/if_iwn.c Mon Feb 11 00:31:58 2019 (r343992) @@ -3801,6 +3801,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); @@ -3832,6 +3833,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: @@ -3874,6 +3880,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; @@ -3950,6 +3961,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: