Date: Fri, 14 Feb 2003 16:20:31 -0800 (PST) From: Nate Lawson <nate@root.org> To: current@freebsd.org Cc: wpaul@freebsd.org Subject: sys/pci/if* fixes Message-ID: <Pine.BSF.4.21.0302141503110.39134-100000@root.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0302141503110.39134-100000>