Date: Tue, 4 May 2010 09:39:06 -0700 From: Pyun YongHyeon <pyunyh@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-current@freebsd.org, Mark Atkinson <atkin901@gmail.com> Subject: Re: exclusive sleep mutex mskc0 (network driver) r = 0 (0xc32c3690) locked @ /usr/src/sys/dev/msk/if_msk.c:3589 Message-ID: <20100504163906.GH1231@michelle.cdnetworks.com> In-Reply-To: <201005040939.36906.jhb@freebsd.org> References: <hrml0k$lqe$1@dough.gmane.org> <20100503195538.GF1231@michelle.cdnetworks.com> <201005040939.36906.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100504163906.GH1231>
