From owner-freebsd-current Fri Feb 14 16:20:36 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 16C1F37B405 for ; Fri, 14 Feb 2003 16:20:35 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id C2C5A43FD7 for ; Fri, 14 Feb 2003 16:20:32 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 39243 invoked by uid 1000); 15 Feb 2003 00:20:31 -0000 Date: Fri, 14 Feb 2003 16:20:31 -0800 (PST) From: Nate Lawson To: current@freebsd.org Cc: wpaul@freebsd.org Subject: sys/pci/if* fixes Message-ID: 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 I have been working on a set of patches to fix locking in attach as well as fix memory leaks on failure/detach. The general approach is to remove all locking in attach and instead defer interrupt allocation to right before ifattach. 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. This is help against potential future problems. A couple errors were fixed by this along the way including one resource being freed twice and several not being freed. Before these fixes are complete, I have a few questions: * Does each device that uses miibus need to explicitly call device_delete_child when it is detaching? Should it do it also in its attach routine if it encounters an error? I assume all drivers need to do this after a successful mii_phy_probe(). * Does it need to call bus_generic_detach on itself? * Is it ok to return other errors (ENOMEM) from a device_attach method? Please review/test a patch if you have one of these: http://www.root.org/~nate/freebsd/sf.diff http://www.root.org/~nate/freebsd/sk.diff http://www.root.org/~nate/freebsd/ti.diff http://www.root.org/~nate/freebsd/tl.diff http://www.root.org/~nate/freebsd/vr.diff http://www.root.org/~nate/freebsd/wb.diff http://www.root.org/~nate/freebsd/xl.diff http://www.root.org/~nate/freebsd/pcn.diff http://www.root.org/~nate/freebsd/sis.diff http://www.root.org/~nate/freebsd/ste.diff http://www.root.org/~nate/freebsd/dc.diff http://www.root.org/~nate/freebsd/rl.diff Thanks, -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message