From owner-freebsd-current Mon Feb 10 8: 9:11 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30A4437B401 for ; Mon, 10 Feb 2003 08:09:10 -0800 (PST) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BF3F43F75 for ; Mon, 10 Feb 2003 08:09:09 -0800 (PST) (envelope-from winter@jurai.net) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by sasami.jurai.net (8.12.6/8.12.5) with ESMTP id h1AG98vA041979; Mon, 10 Feb 2003 11:09:08 -0500 (EST) (envelope-from winter@jurai.net) Date: Mon, 10 Feb 2003 11:09:08 -0500 (EST) From: "Matthew N. Dodd" To: Nate Lawson Cc: current@FreeBSD.ORG Subject: Re: bus_setup_intr() vs. ether_ifattach() race In-Reply-To: Message-ID: <20030210110700.J15295@sasami.jurai.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 9 Feb 2003, Nate Lawson wrote: > Which is the correct order to do these two functions? If the irq is > enabled before the device is attached, it seems a response cannot be > sent if a packet arrives before the attach. The right way seems to be > to attach the device before setting up an irq but does this have side > effects? The interrupt handler should be checking IFF_UP. The driver shouldn't enable card interrupts until if_init() has been run and should disable them in it foo_stop() routine (or when the interface is brought down, detached etc.) -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | For Great Justice! | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message