Date: Mon, 19 Sep 2005 08:40:51 +0300 From: Ruslan Ermilov <ru@freebsd.org> To: Warner Losh <imp@freebsd.org> 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 Message-ID: <20050919054051.GB65954@ip.net.ua> In-Reply-To: <200509182051.j8IKpYGU073493@repoman.freebsd.org> References: <200509182051.j8IKpYGU073493@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050919054051.GB65954>