From owner-svn-src-head@freebsd.org Sun Feb 28 23:35:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC5D5AB8D8D; Sun, 28 Feb 2016 23:35:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8DC0394A; Sun, 28 Feb 2016 23:35:04 +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 u1SNZ3qg012720; Sun, 28 Feb 2016 23:35:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1SNZ3Dr012719; Sun, 28 Feb 2016 23:35:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602282335.u1SNZ3Dr012719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 28 Feb 2016 23:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296169 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2016 23:35:04 -0000 Author: avos Date: Sun Feb 28 23:35:03 2016 New Revision: 296169 URL: https://svnweb.freebsd.org/changeset/base/296169 Log: net80211: fix 'taskqueue_drain with non-sleepable locks held' warning Do not run ieee80211_waitfor_parent() when it's not needed. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5446 Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Feb 28 22:37:59 2016 (r296168) +++ head/sys/net80211/ieee80211_ioctl.c Sun Feb 28 23:35:03 2016 (r296169) @@ -3289,7 +3289,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - int error = 0; + int error = 0, wait = 0; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ @@ -3308,18 +3308,24 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon * then it will automatically be brought up as a * side-effect of bringing ourself up. */ - if (vap->iv_state == IEEE80211_S_INIT) + if (vap->iv_state == IEEE80211_S_INIT) { + if (ic->ic_nrunning == 0) + wait = 1; ieee80211_start_locked(vap); + } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Stop ourself. If we are the last vap to be * marked down the parent will also be taken down. */ + if (ic->ic_nrunning == 1) + wait = 1; ieee80211_stop_locked(vap); } IEEE80211_UNLOCK(ic); /* Wait for parent ioctl handler if it was queued */ - ieee80211_waitfor_parent(ic); + if (wait) + ieee80211_waitfor_parent(ic); break; case SIOCADDMULTI: case SIOCDELMULTI: