From owner-cvs-all@FreeBSD.ORG Mon Mar 31 09:29:45 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 045D437B401; Mon, 31 Mar 2003 09:29:45 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8215943FBD; Mon, 31 Mar 2003 09:29:44 -0800 (PST) (envelope-from njl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h2VHTi0U095145; Mon, 31 Mar 2003 09:29:44 -0800 (PST) (envelope-from njl@repoman.freebsd.org) Received: (from njl@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h2VHTi9k095144; Mon, 31 Mar 2003 09:29:44 -0800 (PST) Message-Id: <200303311729.h2VHTi9k095144@repoman.freebsd.org> From: Nate Lawson Date: Mon, 31 Mar 2003 09:29:44 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/pci if_dc.c if_pcn.c if_rl.c if_sf.c if_sis.c if_sk.c if_ste.c if_ti.c if_tl.c if_vr.c if_wb.c if_xl.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2003 17:29:46 -0000 njl 2003/03/31 09:29:44 PST FreeBSD src repository Modified files: sys/pci if_dc.c if_pcn.c if_rl.c if_sf.c if_sis.c if_sk.c if_ste.c if_ti.c if_tl.c if_vr.c if_wb.c if_xl.c Log: Clean up locking and resource management for pci/if_* - Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer. Reviewed by: imp, mdodd Revision Changes Path 1.97 +32 -33 src/sys/pci/if_dc.c 1.36 +29 -33 src/sys/pci/if_pcn.c 1.91 +34 -34 src/sys/pci/if_rl.c 1.50 +28 -33 src/sys/pci/if_sf.c 1.67 +102 -86 src/sys/pci/if_sis.c 1.55 +59 -60 src/sys/pci/if_sk.c 1.46 +30 -38 src/sys/pci/if_ste.c 1.72 +32 -50 src/sys/pci/if_ti.c 1.75 +28 -34 src/sys/pci/if_tl.c 1.64 +28 -35 src/sys/pci/if_vr.c 1.54 +27 -33 src/sys/pci/if_wb.c 1.135 +103 -113 src/sys/pci/if_xl.c