From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 03:51:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FAFC835; Sun, 3 Aug 2014 03:51:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6D6DD2538; Sun, 3 Aug 2014 03:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s733pYNg067052; Sun, 3 Aug 2014 03:51:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s733pYkH067039; Sun, 3 Aug 2014 03:51:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201408030351.s733pYkH067039@svn.freebsd.org> From: Adrian Chadd Date: Sun, 3 Aug 2014 03:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269458 - head/sys/dev/iwn 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.18 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, 03 Aug 2014 03:51:34 -0000 Author: adrian Date: Sun Aug 3 03:51:33 2014 New Revision: 269458 URL: http://svnweb.freebsd.org/changeset/base/269458 Log: Do the iwn(4) panic reinitialisation under IWN_LOCK(). I've checked each of the functions being called and there's either a _locked version or it's supposed to be called with IWN_LOCK() held. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Aug 3 03:27:54 2014 (r269457) +++ head/sys/dev/iwn/if_iwn.c Sun Aug 3 03:51:33 2014 (r269458) @@ -8465,9 +8465,10 @@ iwn_panicked(void *arg0, int pending) device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " "resetting...\n", __func__, vap->iv_state); - iwn_stop(sc); - iwn_init(sc); - iwn_start(sc->sc_ifp); + IWN_LOCK(sc); + + iwn_stop_locked(sc); + iwn_init_locked(sc); if (vap->iv_state >= IEEE80211_S_AUTH && (error = iwn_auth(sc, vap)) != 0) { device_printf(sc->sc_dev, @@ -8478,6 +8479,11 @@ iwn_panicked(void *arg0, int pending) device_printf(sc->sc_dev, "%s: could not move to run state\n", __func__); } + + /* Only run start once the NIC is in a useful state, like associated */ + iwn_start_locked(sc->sc_ifp); + + IWN_UNLOCK(sc); } static void