From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 03:16:48 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 021C73A2; Thu, 24 Apr 2014 03:16:48 +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 E2BDD1AF9; Thu, 24 Apr 2014 03:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O3Gl8e093951; Thu, 24 Apr 2014 03:16:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O3GlUl093950; Thu, 24 Apr 2014 03:16:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404240316.s3O3GlUl093950@svn.freebsd.org> From: Kevin Lo Date: Thu, 24 Apr 2014 03:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264864 - head/sys/dev/usb/wlan 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.17 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: Thu, 24 Apr 2014 03:16:48 -0000 Author: kevlo Date: Thu Apr 24 03:16:47 2014 New Revision: 264864 URL: http://svnweb.freebsd.org/changeset/base/264864 Log: Fix panic by adding mtx_assert() to urtwn_init_locked() and urtwn_stop_locked(). Tested by: Anthony Jenkins Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 02:16:23 2014 (r264863) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 03:16:47 2014 (r264864) @@ -2054,6 +2054,7 @@ urtwn_load_firmware(struct urtwn_softc * uint32_t reg; int mlen, ntries, page, error; + URTWN_UNLOCK(sc); /* Read firmware image from the filesystem. */ if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) == URTWN_CHIP_UMC_A_CUT) @@ -2062,6 +2063,7 @@ urtwn_load_firmware(struct urtwn_softc * imagename = "urtwn-rtl8192cfwT"; fw = firmware_get(imagename); + URTWN_LOCK(sc); if (fw == NULL) { device_printf(sc->sc_dev, "failed loadfirmware of file %s\n", imagename); @@ -2816,6 +2818,8 @@ urtwn_init_locked(void *arg) uint32_t reg; int error; + URTWN_ASSERT_LOCKED(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) urtwn_stop_locked(ifp); @@ -2979,6 +2983,8 @@ urtwn_stop_locked(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; + URTWN_ASSERT_LOCKED(sc); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); callout_stop(&sc->sc_watchdog_ch);