Date: Mon, 3 May 2010 12:55:38 -0700 From: Pyun YongHyeon <pyunyh@gmail.com> To: Mark Atkinson <atkin901@gmail.com> 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 Message-ID: <20100503195538.GF1231@michelle.cdnetworks.com> In-Reply-To: <hrml0k$lqe$1@dough.gmane.org> References: <hrml0k$lqe$1@dough.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100503195538.GF1231>
