Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2007 16:42:06 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Jack Vogel <jfvogel@gmail.com>, Mark Atkinson <atkin901@yahoo.com>
Subject:   Re: em0 panic: mutex em0 not owned
Message-ID:  <200711271642.07616.jhb@freebsd.org>
In-Reply-To: <2a41acea0711270925w55742526n7ef77b1fcef3016f@mail.gmail.com>
References:  <4744EBA4.7020209@clearchain.com> <fihfhp$7ts$1@ger.gmane.org> <2a41acea0711270925w55742526n7ef77b1fcef3016f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 27 November 2007 12:25:52 pm Jack Vogel wrote:
> On Nov 27, 2007 8:10 AM, Mark Atkinson <atkin901@yahoo.com> wrote:
> 
> >
> > Is this expected after the fix?
> >
> > acquiring duplicate lock of same type: "network driver"
> >  1st em0 @ /usr/src/sys/dev/em/if_em.c:1018
> >  2nd em0 @ /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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711271642.07616.jhb>