From owner-freebsd-hackers Sun Aug 19 6:15: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from enterprise.spock.org (cm-24-29-85-81.nycap.rr.com [24.29.85.81]) by hub.freebsd.org (Postfix) with ESMTP id 9273C37B409; Sun, 19 Aug 2001 06:14:59 -0700 (PDT) (envelope-from jon@enterprise.spock.org) Received: (from jon@localhost) by enterprise.spock.org serial EF600Q3T-B7F; Sun, 19 Aug 2001 09:14:52 -0400 (EDT) (envelope-from jon)$ Date: Sun, 19 Aug 2001 09:14:52 -0400 From: Jonathan Chen To: Sam Habash Cc: freebsd-gnats-submit@FreeBSD.ORG, mobile@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: kern/24854: NEWCARD support for aironet driver an(4) Message-ID: <20010819091452.A86632@enterprise.spock.org> References: <20010817011103.A25841@llama.com> <20010818110728.A20719@enterprise.spock.org> <20010818092654.C28694@llama.com> <20010818124503.A26350@enterprise.spock.org> <20010818212011.A33879@llama.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: telnet/1.1x In-Reply-To: <20010818212011.A33879@llama.com>; from the@llama.com on Sat, Aug 18, 2001 at 09:20:11PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [summary of past events for the benefit of gnats] - original PR filed for Cisco aironet not working under newcard - My LMC342 works just fine, and I though this might be a bug in newcard (as opposed to the an driver as suggested in the pr), suggested Sam to try the updated newcard (http://people.freebsd.org/~jon/newcard.diff.3) - this patch makes an work under newcard without the proposed changes in the pr. > I believe I already tried just uncommenting 'optional ata pccard' > with the -current source, without any luck. Sam, I'm not sure what you mean here. > The first time I tried it (not in X) removal and reinsertion of the > Aironet card was fine. > > The second time (while in X), removal was ok, but card reinsertion caused > a reboot (no panic)... > > Let me know what you want me to do exactly, in terms of what kind of > debugging you need...once I hear back I'll build a debug kernel. Are you sure there is no panic while in X? Your X server might have futzed with the video card so you might not actually see the panic. If you can try to reproduce this in text mode, then the panic message as well as a traceback would be a very good start. But before you do that, I believe I may have found a fix for a possible panic situation. This panic occurs in witness_destroy as a supervisor read page not present error (I presume while trying to dereference lock). This panic can be easily reproduced by running dhclient an0, removing and reinserting the card, then killing dhclient. The fix appears to be shockingly simple: diff -u -r1.8 if_an_pccard.c --- sys/dev/an/if_an_pccard.c 2001/05/26 09:26:58 1.8 +++ sys/dev/an/if_an_pccard.c 2001/08/19 12:57:14 @@ -118,6 +118,7 @@ sc->an_gone = 1; bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); an_release_resources(dev); + mtx_destroy(&sc->an_mtx); return (0); } Here's where I require some guidance from someone in the know. While this patch appears to avoid the problem on my system, does it in fact work? How does the panic occur and how does this fix the problem, if indeed it does? I'm quite clueless as to the implementation of mutex locking on freebsd, and I suppose it's just plain luck that the first thing I tried turned out to have done the trick... -Jon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message