Re: em0 panic: mutex em0 not owned

From: John Baldwin <jhb_at_freebsd.org>
Date: Tue, 27 Nov 2007 16:42:06 -0500
On Tuesday 27 November 2007 12:25:52 pm Jack Vogel wrote:
> On Nov 27, 2007 8:10 AM, Mark Atkinson <atkin901_at_yahoo.com> wrote:
> 
> >
> > Is this expected after the fix?
> >
> > acquiring duplicate lock of same type: "network driver"
> >  1st em0 _at_ /usr/src/sys/dev/em/if_em.c:1018
> >  2nd em0 _at_ /usr/src/sys/dev/em/if_em.c:1252
> 
> Same type, different lock, I don't see a problem unless
> there's some subtle thing I'm not aware of?

Give them unique names then so witness can track them separately. :)  The 
MTX_NETWORK_LOCK is really there so witness can track all driver locks at the 
same point in the hierarchy it uses to track lock orders.  If you have a 
primary lock for the driver you can leave it as MTX_NETWORK_LOCK but use 
different types for other locks in the driver.  For example:

	mtx_init(&sc->lock, device_get_nameunit(dev), MTX_NETWORK_LOCK,
	    MTX_DEF);
	mtx_init(&sc->tx_ring_lock, device_get_nameunit(dev), "tx ring lock",
	    MTX_DEF);

-- 
John Baldwin
Received on Tue Nov 27 2007 - 20:59:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:23 UTC