From owner-freebsd-current Sun Feb 16 21:52:39 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 C224A37B401; Sun, 16 Feb 2003 21:52:38 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADB0343F3F; Sun, 16 Feb 2003 21:52:37 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h1H5qa3Y027037; Sun, 16 Feb 2003 22:52:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 16 Feb 2003 22:51:54 -0700 (MST) Message-Id: <20030216.225154.128867002.imp@bsdimp.com> To: winter@jurai.net Cc: nate@root.org, current@FreeBSD.ORG, wpaul@FreeBSD.ORG Subject: Re: sys/pci/if* fixes From: "M. Warner Losh" In-Reply-To: <20030215092452.E73971@sasami.jurai.net> References: <20030215092452.E73971@sasami.jurai.net> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 In message: <20030215092452.E73971@sasami.jurai.net> "Matthew N. Dodd" writes: : On Fri, 14 Feb 2003, Nate Lawson wrote: : > Also, except for xl, all drivers have a common cleanup on error in : > attach that backs out allocated resources with no assumptions about the : > order they were allocated in. : : Please see if_pcn.c for the correct approach to freeing resources; its not : necessary to wrap evrything in 'if (sc && error != 0) {}'. If execution : reaches the 'fail' label then you assume that is what happened. : : I also think you should just drop and reaquire locks around the : bus_setup_intr() rather than moving code around. I don't think that's reasonable. The reason that the lock is there is so that the ISR can't interrupt the attach routine if interrupts are enabled. Also, you can't hold the driver lock when you call the network if attach routines because then you get lock order reversals in the watchdog routine.... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message