From owner-freebsd-current@FreeBSD.ORG Mon May 3 19:55:56 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 3E9D11065674 for ; Mon, 3 May 2010 19:55:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0E88FC20 for ; Mon, 3 May 2010 19:55:55 +0000 (UTC) Received: by pxi11 with SMTP id 11so419845pxi.13 for ; Mon, 03 May 2010 12:55:49 -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=GtW9E5pfEAQhKZ+A+g1kzoDp+NFxQ/O6t2sEdXMMLMc=; b=LyareKtiCa5WtwvhdAqchD2G/pPZL11EmtAFBKbwyI6M9BLUTJC+L+G++B5SED6/gz +ckgXlq4xzFmCLTRC51/BrmeH8HPx4Oujlh7HD3rCZLE84yIY2gBdiqS9wTB92vRVdcf xKrdndgkgEQQoZYbeOMnuz0tJyEbkJIS3CB6M= 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=GSQAWBwLZAiDAfBST98MrJze0fhHZScaS5C+XTwJ+/K5bZ5hIMegNbBVbq5gZNmOL3 u2qnbAo3cN/svfiMFyOxdrFZzfYeSmtrk8mC5ZKuo0eKHgdRU8KTmEuyQVvoiTw8UkgA 3eNVUOzjVT8UezBiVj24Y7WlC9BCBZIeSA+xg= Received: by 10.142.151.9 with SMTP id y9mr7015989wfd.123.1272916548868; Mon, 03 May 2010 12:55:48 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 22sm4896395pzk.5.2010.05.03.12.55.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 May 2010 12:55:46 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 3 May 2010 12:55:38 -0700 From: Pyun YongHyeon Date: Mon, 3 May 2010 12:55:38 -0700 To: Mark Atkinson Message-ID: <20100503195538.GF1231@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org 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: Mon, 03 May 2010 19:55:56 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? --fUYQa+Pmc3FrFX/N Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="msk.rx.patch" Index: sys/dev/msk/if_msk.c =================================================================== --- sys/dev/msk/if_msk.c (revision 207572) +++ sys/dev/msk/if_msk.c (working copy) @@ -2904,20 +2904,15 @@ sc = device_get_softc(dev); MSK_LOCK(sc); for (i = 0; i < sc->msk_num_port; i++) { - if (sc->msk_if[i] != NULL) + if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && + ((sc->msk_if[i]->msk_ifp->if_drv_flags & + IFF_DRV_RUNNING) != 0)) msk_stop(sc->msk_if[i]); } + MSK_UNLOCK(sc); - /* Disable all interrupts. */ - CSR_WRITE_4(sc, B0_IMSK, 0); - CSR_READ_4(sc, B0_IMSK); - CSR_WRITE_4(sc, B0_HWE_IMSK, 0); - CSR_READ_4(sc, B0_HWE_IMSK); - /* Put hardware reset. */ CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - - MSK_UNLOCK(sc); return (0); } @@ -3525,6 +3520,8 @@ sc_if->msk_csum = status; break; case OP_RXSTAT: + if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING)) + break; if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) msk_jumbo_rxeof(sc_if, status, control, len); --fUYQa+Pmc3FrFX/N--