Date: Thu, 17 Nov 2005 11:03:29 -0500 From: John Baldwin <jhb@freebsd.org> To: David Xu <davidxu@freebsd.org> Cc: stable@freebsd.org, current@freebsd.org Subject: Re: [PATCH] nve(4) locking cleanup Message-ID: <200511171103.30215.jhb@freebsd.org> In-Reply-To: <437C89A7.9040708@freebsd.org> References: <200511161623.38494.jhb@freebsd.org> <437C89A7.9040708@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <NVIDIA nForce MCP7 Networking Adapter> 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 <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511171103.30215.jhb>