From owner-cvs-src@FreeBSD.ORG Mon Sep 19 05:40:40 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB32716A41F; Mon, 19 Sep 2005 05:40:40 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from mail.ipnet.kiev.ua (cielago.ip.net.ua [82.193.96.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id F16DC43D46; Mon, 19 Sep 2005 05:40:39 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by mail.ipnet.kiev.ua (8.12.11/8.12.11) with ESMTP id j8J5ebWg076093; Mon, 19 Sep 2005 08:40:37 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from mail.ipnet.kiev.ua ([82.193.96.7]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 84512-13; Mon, 19 Sep 2005 08:40:36 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by mail.ipnet.kiev.ua (8.12.11/8.12.11) with ESMTP id j8J5eaC5076090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Sep 2005 08:40:36 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.3/8.13.3) id j8J5eqxo011522; Mon, 19 Sep 2005 08:40:52 +0300 (EEST) (envelope-from ru) Date: Mon, 19 Sep 2005 08:40:51 +0300 From: Ruslan Ermilov To: Warner Losh Message-ID: <20050919054051.GB65954@ip.net.ua> References: <200509182051.j8IKpYGU073493@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v9Ux+11Zm5mwPlX6" Content-Disposition: inline In-Reply-To: <200509182051.j8IKpYGU073493@repoman.freebsd.org> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/ed if_ed.c if_ed_pccard.c if_edvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2005 05:40:40 -0000 --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 18, 2005 at 08:51:34PM +0000, Warner Losh wrote: > o Fix one bug that's common to many drivers. call if_free(ifp) after > we tear down the interrupt. ed_intr() depends on ifp being there and > freeing it while interrupts can still happen is, ummm, bad. > =20 I think this change is a mismerge from some of your work with my work already in CVS. if_free(ifp) is already called in ed_release_resources(), which is used both in the failure case in ed_*_attach() and in ed_detach(). What's now in CVS should cause freeing a NULL pointer on detach. About the commonality... Usually foo_stop() (which is called first in foo_detach() if you were talking about the detach) disables interrupts, so foo_intr() doesn't usually happen. From reading the code, I see the same holds true for ed(4). OTOH, it was shown that on some SMP machines it's possible to get a call to foo_intr() after foo_stop() has been called by foo_shutdown(), which will lead to a panic in most of the drivers. See kern/85005 and kern/62889 for some examples. I think the generic solution to this problem should be to return from foo_intr() quickly if IFF_DRV_RUNNING is not set. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --v9Ux+11Zm5mwPlX6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDLk9jqRfpzJluFF4RAjiwAJ4g+ZQ+VCqRMKK2Mtv8WycLaQFazwCffCrr /VTIcqJvx4g6QkPeb9xJ5d0= =09Ag -----END PGP SIGNATURE----- --v9Ux+11Zm5mwPlX6--