From owner-freebsd-current Thu Mar 13 0:16:35 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C98A937B401; Thu, 13 Mar 2003 00:16:32 -0800 (PST) Received: from mail.distalzou.net (203.141.139.231.user.ad.il24.net [203.141.139.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id C10C243FCB; Thu, 13 Mar 2003 00:16:31 -0800 (PST) (envelope-from devin@spamcop.net) Received: from localhost ([127.0.0.1]) by mail.distalzou.net with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 3.36 #1) id 18tNt6-000LaO-00; Thu, 13 Mar 2003 17:16:28 +0900 Date: Thu, 13 Mar 2003 17:16:27 +0900 (JST) From: Tod McQuillin X-X-Sender: devin@glass.pun-pun.prv To: John Baldwin Cc: freebsd-current@freebsd.org Subject: RE: lock order reversal? current with tl ethernet In-Reply-To: Message-ID: <20030313092358.Y61843@glass.pun-pun.prv> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 12 Mar 2003, John Baldwin wrote: > It's holding the lock across bus_setup_intr(). You can try the > following patch: > > Index: if_tl.c > =================================================================== > RCS file: /usr/cvs/src/sys/pci/if_tl.c,v > retrieving revision 1.74 > diff -u -r1.74 if_tl.c > --- if_tl.c 19 Feb 2003 05:47:41 -0000 1.74 > +++ if_tl.c 12 Mar 2003 15:20:47 -0000 > @@ -1138,12 +1138,11 @@ > > if (t->tl_name == NULL) { > device_printf(dev, "unknown device!?\n"); > - goto fail; > device_printf(dev, "unknown device!?\n"); > - goto fail; > RCS file: /usr/cvs/src/sys/pci/if_tl.c,v > retrieving revision 1.74 > diff -u -r1.74 if_tl.c > --- if_tl.c 19 Feb 2003 05:47:41 -0000 1.74 > +++ if_tl.c 12 Mar 2003 15:20:47 -0000 > @@ -1138,12 +1138,11 @@ > > if (t->tl_name == NULL) { > device_printf(dev, "unknown device!?\n"); > - goto fail; > + return (ENXIO); > } > > mtx_init(&sc->tl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, > MTX_DEF | MTX_RECURSE); > - TL_LOCK(sc); > > /* > * Map control/status registers. > @@ -1348,12 +1347,12 @@ > /* > * Call MI attach routine. > */ Thanks John -- This patch looks a little bit mangled to me. It has two sections talking about line 1138 of if_tl.c (with two different changes) and a section talking about line 1348 (with no changes). I assumed cut and paste error and proceeded along the same lines with this patch instead: Index: if_tl.c =================================================================== RCS file: /usr/src/cvs-repo/src/sys/pci/if_tl.c,v retrieving revision 1.74 diff -u -r1.74 if_tl.c --- if_tl.c 19 Feb 2003 05:47:41 -0000 1.74 +++ if_tl.c 13 Mar 2003 00:26:20 -0000 @@ -1138,12 +1138,11 @@ if (t->tl_name == NULL) { device_printf(dev, "unknown device!?\n"); - goto fail; + return (ENXIO); } mtx_init(&sc->tl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF | MTX_RECURSE); - TL_LOCK(sc); /* * Map control/status registers. @@ -1349,11 +1348,9 @@ * Call MI attach routine. */ ether_ifattach(ifp, sc->arpcom.ac_enaddr); - TL_UNLOCK(sc); return(0); fail: - TL_UNLOCK(sc); mtx_destroy(&sc->tl_mtx); return(error); } This has made the messages go away -- thanks for that! If this is a correct fix, should I submit a PR to have it committed? -- Tod McQuillin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message