From frank@tinker.exit.com  Sun Oct 17 19:34:12 2004
Return-Path: <frank@tinker.exit.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E6F2D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Oct 2004 19:34:12 +0000 (GMT)
Received: from tinker.exit.com (tinker.exit.com [206.223.0.1])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A8A0343D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Oct 2004 19:34:12 +0000 (GMT)
	(envelope-from frank@tinker.exit.com)
Received: from tinker.exit.com (localhost [127.0.0.1])
	by tinker.exit.com (8.13.1/8.12.9) with ESMTP id i9HJaZVR066596
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Oct 2004 12:36:35 -0700 (PDT)
	(envelope-from frank@tinker.exit.com)
Received: (from frank@localhost)
	by tinker.exit.com (8.13.1/8.13.1/Submit) id i9HJaU43066595;
	Sun, 17 Oct 2004 12:36:30 -0700 (PDT)
	(envelope-from frank)
Message-Id: <200410171936.i9HJaU43066595@tinker.exit.com>
Date: Sun, 17 Oct 2004 12:36:30 -0700 (PDT)
From: Frank Mayhar <frank@tinker.exit.com>
Reply-To: Frank Mayhar <frank@exit.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: LOR between NDIS lock and route lock.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72795
>Category:       i386
>Synopsis:       LOR between NDIS lock and route lock.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 17 19:40:28 GMT 2004
>Closed-Date:    Mon Oct 18 21:34:26 GMT 2004
>Last-Modified:  Mon Oct 18 21:34:26 GMT 2004
>Originator:     Frank Mayhar
>Release:        FreeBSD 5.3-BETA7 i386
>Organization:
Exit Consulting
>Environment:
System: FreeBSD lap 5.3-STABLE FreeBSD 5.3-STABLE #3: Sun Oct 17 12:02:39 PDT 2004     frank@lap:/home/obj/usr/src/sys/AUTON  i386


	
	This is the latest and greatest 5.3 on my Inspiron 5160.
>Description:
	I'm using ndis to employ a Dell 1450 dual-band wireless card.  Using
	the single-band card that came with the laptop this didn't happen,
	but when I began using the new one I started seeing near-constant
	panics.

>How-To-Repeat:
	Load the system lightly, then do network stuff (a flood ping works
	perfectly).

>Fix:
	It turns out that the first thing I checked appears to be the problem.
	ndis_start() has a single path that fails to drop the NDIS lock before
	it returns.  I fixed that and the system has survived a flood ping for
	several minutes now.  The diff is appended.

	NOTE:  This should almost certainly get into 5.3-stable.  It's a nasty.


Index: if_ndis.c
===================================================================
RCS file: /cvs/repos/src/sys/dev/if_ndis/if_ndis.c,v
retrieving revision 1.69.2.1
diff -u -r1.69.2.1 if_ndis.c
--- if_ndis.c	9 Oct 2004 15:20:18 -0000	1.69.2.1
+++ if_ndis.c	17 Oct 2004 18:58:52 -0000
@@ -1291,8 +1291,10 @@
 			break;
 	}
 
-	if (pcnt == 0)
+	if (pcnt == 0) {
+		NDIS_UNLOCK(sc);
 		return;
+	}
 
 	if (sc->ndis_txpending == 0)
 		ifp->if_flags |= IFF_OACTIVE;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Mon Oct 18 21:34:14 GMT 2004 
State-Changed-Why:  
Thank you, patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72795 
>Unformatted:
