From owner-freebsd-current@FreeBSD.ORG Tue Jul 20 09:46:31 2004 Return-Path: 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 3AB5116A4CE for ; Tue, 20 Jul 2004 09:46:31 +0000 (GMT) Received: from max.af.czu.cz (max.af.czu.cz [193.84.41.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70DCB43D5D for ; Tue, 20 Jul 2004 09:46:30 +0000 (GMT) (envelope-from lists@hosting50.cz) Received: (qmail 42369 invoked by uid 89); 20 Jul 2004 10:02:51 -0000 Received: from unknown (HELO ?193.84.40.30?) (ares@max.af.czu.cz@193.84.40.30) by max.af.czu.cz with AES256-SHA encrypted SMTP; 20 Jul 2004 10:02:51 -0000 From: Tomas Randa To: freebsd-current@freebsd.org Content-Type: text/plain Message-Id: <1090316789.788.10.camel@ares.af.czu.cz> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 20 Jul 2004 11:46:29 +0200 Content-Transfer-Encoding: 7bit Subject: sk0 patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 09:46:31 -0000 Hi, is there available a working patch for current "sk" driver? Thanks a lot. Tomas Randa On Sun, 2004-07-11 at 00:34, Bjoern A. Zeeb wrote: > Hi, > > there had been some discussion lately about if_sk and attach locking. > compiled if_sk as module on amd64 and kldloading started a race with > follwoing output: > > --- very short part of console log --- > [some hundred more of the following lines] > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > malloc(M_WAITOK) of "64", forcing M_NOWAIT with the following non-sleepable locks held: > exclusive sleep mutex skc0 (network driver) r = 0 (0xffffff003000b670) locked @ /u1/src/HEAD/src/sys/pci/if_sk.c:1335 > Stack backtrace: > witness_warn() at witness_warn+0x1a7 > uma_zalloc_arg() at uma_zalloc_arg+0x4c > malloc() at malloc+0x9f > scope6_ifattach() at scope6_ifattach+0x20 > in6_domifattach() at in6_domifattach+0x91 > if_attachdomain1() at if_attachdomain1+0xb9 > if_attach() at if_attach+0x465 > ether_ifattach() at ether_ifattach+0x27 > sk_attach() at sk_attach+0x334 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > (null)() at 0 > [some hundred more of these lines] > --- end --- > > > > I solved this problem without further investigation of possible > bad impacts with this patch: > > > Index: if_sk.c > =================================================================== > RCS file: /u2/src/CVS/prefixes/src/sys/pci/if_sk.c,v > retrieving revision 1.83 > diff -u -p -r1.83 if_sk.c > --- if_sk.c 28 Jun 2004 20:07:03 -0000 1.83 > +++ if_sk.c 10 Jul 2004 21:44:53 -0000 > @@ -1332,7 +1332,9 @@ sk_attach(dev) > error = 0; > sc_if = device_get_softc(dev); > sc = device_get_softc(device_get_parent(dev)); > +#if 0 > SK_LOCK(sc); > +#endif > port = *(int *)device_get_ivars(dev); > free(device_get_ivars(dev), M_DEVBUF); > device_set_ivars(dev, NULL); > @@ -1472,7 +1474,9 @@ sk_attach(dev) > } > > fail: > +#if 0 > SK_UNLOCK(sc); > +#endif > if (error) { > /* Access should be ok even though lock has been dropped */ > sc->sk_if[port] = NULL; > --- end --- > > > can someone with some more knowledge about this driver and > general locking of if_* please review this. TIA. -- Tomas Randa -- Tomas Randa