From owner-freebsd-current@FreeBSD.ORG Tue May 4 16:39:21 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A3A3106566B; Tue, 4 May 2010 16:39:21 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 108CD8FC0C; Tue, 4 May 2010 16:39:20 +0000 (UTC) Received: by pvc30 with SMTP id 30so348221pvc.13 for ; Tue, 04 May 2010 09:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=NlRu1e42LqzGvehuvP4z648MO05ZMRmbyJwkEVmBdBA=; b=l3Uu94AaRAWa2AIEWR6K1byM/tgmdP+Zg0m0DRPWjNgY8ik/D2JjuJ8ebS32jor1os 1oxDf5THUwHU9zSqfLqtxAu4mA2BaMUK6wOPItCpdKY9xqJqT3Rj03/man+x3ugdsud8 SEC9/UIE4/0jeKRmdyq3CXfX2BmV5WKhph5Q4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=bX4GA/harWAyjcVs4bUg6XFrWMJVpnvBJ8K4XCEbf3ddrwEenSXA7kFdApQfVSOq8U M6gXzYR3wp4KI9ZQgxQFubhMz0b7shvNqj9caDR4tfsyoVenKkVXRXrjb+FqpfD6YrFv WUGlcES8Jqe6knXa6nFZhdIdit0N+82JZR/to= Received: by 10.115.37.28 with SMTP id p28mr818044waj.218.1272991155690; Tue, 04 May 2010 09:39:15 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id c14sm30269062waa.1.2010.05.04.09.39.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 May 2010 09:39:13 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 4 May 2010 09:39:06 -0700 From: Pyun YongHyeon Date: Tue, 4 May 2010 09:39:06 -0700 To: John Baldwin Message-ID: <20100504163906.GH1231@michelle.cdnetworks.com> References: <20100503195538.GF1231@michelle.cdnetworks.com> <201005040939.36906.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201005040939.36906.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org, Mark Atkinson Subject: Re: exclusive sleep mutex mskc0 (network driver) r = 0 (0xc32c3690) locked @ /usr/src/sys/dev/msk/if_msk.c:3589 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2010 16:39:21 -0000 On Tue, May 04, 2010 at 09:39:36AM -0400, John Baldwin wrote: > On Monday 03 May 2010 3:55:38 pm Pyun YongHyeon wrote: > > On Mon, May 03, 2010 at 07:01:56AM -0700, Mark Atkinson wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > > Hash: SHA1 > > > > > > I updated to current yesterday and got the following 'witness_warn' > > > panic upon executing 'reboot': > > > > > > suspending ithread with the following locks held: > > > exclusive sleep mutex mskc0 (network driver) r = 0 (0xc32c3690) locked @ > > > /usr/src/sys/dev/msk/if_msk.c:3589 > > > panic: witness_warn > > > cpuid = 0 > > > KDB: enter: panic > > > Physical memory: 495 MB > > > Dumping 80 MB: 65 49 33 17 1 > > > > > > > > > 3579 static void > > > 3580 msk_intr(void *xsc) > > > 3581 { > > > 3582 struct msk_softc *sc; > > > 3583 struct msk_if_softc *sc_if0, *sc_if1; > > > 3584 struct ifnet *ifp0, *ifp1; > > > 3585 uint32_t status; > > > 3586 int domore; > > > 3587 > > > 3588 sc = xsc; > > > 3589 MSK_LOCK(sc); > > > > It seems msk(4) didn't honor IFF_DRV_RUNNING in status block update > > check so it continued to process received packets. > > Would you try attached patch? > > Actually, this panic looks like a leaked lock. I think this might fix it: > > Index: if_msk.c > =================================================================== > --- if_msk.c (revision 207329) > +++ if_msk.c (working copy) > @@ -3580,6 +3580,7 @@ > (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || > (status & sc->msk_intrmask) == 0) { > CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); > + MSK_UNLOCK(sc); > return; > } Nice catch! I guess I made mistake when I removed taskqueue based interrupt handler. Thanks!