[PATCH] nve(4) locking cleanup

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] nve(4) locking cleanup

John Baldwin
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

--
John Baldwin <[hidden email]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] nve(4) locking cleanup

alan bryan-2
--- John Baldwin <[hidden email]> 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.

Is this supposed to solve the "device timeout (64)"
messages?  

My nve (builtin on Shuttle SN25P - FreeBSD 6.0 i386)
works for a while but then eventually gives device
timeout (64) messages.  They sort of count up in
number until hitting 64 although it's sometimes jumps
straight up to 64.  For example, 1,2,3,34,64 and then
it stops working.  I've found that it's triggered a
lot faster when I have Kmail running and goes straight
to 64 when my internet access drops out.

Thanks,
Alan


               
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] nve(4) locking cleanup

David Xu-2
In reply to this post by John Baldwin
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
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: Ethernet address 00:04:61:fe:fb:7f
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
miibus0: <MII bus> on nve0
ciphy0: <Cicada CS8201 10/100/1000TX PHY> on miibus0
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
nve0: nve_oslockacquire: normal mutex not held
nve0: nve_oslockrelease: normal mutex not held
ciphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,
1000baseT-FDX, auto
nve0: Ethernet address: 00:04:61:fe:fb:7f

of course, it does not work, it had never worked.

David Xu

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] nve(4) locking cleanup

John Baldwin
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 <[hidden email]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[hidden email]"