From owner-freebsd-stable@FreeBSD.ORG Thu Nov 17 16:04:49 2005 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 373BB16A420; Thu, 17 Nov 2005 16:04:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7085943D4C; Thu, 17 Nov 2005 16:04:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2123119 for multiple; Thu, 17 Nov 2005 11:04:51 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAHG4YTg022588; Thu, 17 Nov 2005 11:04:45 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Thu, 17 Nov 2005 11:03:29 -0500 User-Agent: KMail/1.8.2 References: <200511161623.38494.jhb@freebsd.org> <437C89A7.9040708@freebsd.org> In-Reply-To: <437C89A7.9040708@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511171103.30215.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: stable@freebsd.org, current@freebsd.org Subject: Re: [PATCH] nve(4) locking cleanup X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2005 16:04:49 -0000 On Thursday 17 November 2005 08:46 am, David Xu wrote: > John Baldwin wrote: > >I have a patch for nve(4) which fixes at least one known LOR in the driver > > and generally fixes up the locking. If you have an nve(4) card that > > currently works, please test this patch to make sure it doesn't break > > anything. If you have an nve(4) card that doesn't work, this patch > > probably won't help. > > > >http://www.FreeBSD.org/~jhb/patches/nve_locking.patch > > After this patch is applied, I got: > nve0: port 0xb400-0xb407 mem > 0xec000000-0xec000fff irq 20 at device 5.0 on pci0 > nve0: nve_oslockacquire: normal mutex not held > nve0: nve_oslockrelease: normal mutex not held Ah, I think I messsed up the conditional for this when I added the sc->dead checks. I'll update the patch in a second. These warnings aren't a problem during attach before ether_ifattach() and bus_setup_intr() or after ether_ifdetach() in detach. Here's the relevant diff to the old patch: --- //depot/user/jhb/acpipci/dev/nve/if_nve.c +++ /home/john/work/p4/acpipci/dev/nve/if_nve.c @@ -1726,7 +1726,7 @@ DEBUGOUT(NVE_DEBUG_LOCK, "nve: nve_oslockacquire\n"); - if (!mtx_owned(&sc->mtx) && !device_is_attached(sc->dev) && !sc->dead) + if (!mtx_owned(&sc->mtx) && device_is_attached(sc->dev) && !sc->dead) device_printf(sc->dev, "%s: normal mutex not held\n", __func__); NVE_OSLOCK((struct nve_softc *)lock); @@ -1742,7 +1742,7 @@ DEBUGOUT(NVE_DEBUG_LOCK, "nve: nve_oslockrelease\n"); NVE_OSUNLOCK((struct nve_softc *)lock); - if (!mtx_owned(&sc->mtx) && !device_is_attached(sc->dev) && !sc->dead) + if (!mtx_owned(&sc->mtx) && device_is_attached(sc->dev) && !sc->dead) device_printf(sc->dev, "%s: normal mutex not held\n", __func__); return (1); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org