From owner-svn-src-stable-7@FreeBSD.ORG Sat Feb 28 10:40:53 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71A8110656C9; Sat, 28 Feb 2009 10:40:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EB748FC08; Sat, 28 Feb 2009 10:40:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1SAeruj006145; Sat, 28 Feb 2009 10:40:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1SAer4K006139; Sat, 28 Feb 2009 10:40:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902281040.n1SAer4K006139@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 28 Feb 2009 10:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189151 - in stable/7/sys: . cam/scsi contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2009 10:40:54 -0000 Author: trasz Date: Sat Feb 28 10:40:52 2009 New Revision: 189151 URL: http://svn.freebsd.org/changeset/base/189151 Log: MFC r187028: Don't call destroy_dev(9) with a mutex held. While here, shuffle things around so the periph destructors look alike. Based on a patch by Jaakko Heinonen. Submitted by: Jaakko Heinonen Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: stable/7/sys/ (props changed) stable/7/sys/cam/scsi/scsi_ch.c stable/7/sys/cam/scsi/scsi_pass.c stable/7/sys/cam/scsi/scsi_pt.c stable/7/sys/cam/scsi/scsi_sa.c stable/7/sys/cam/scsi/scsi_ses.c stable/7/sys/cam/scsi/scsi_sg.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_ch.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_ch.c Sat Feb 28 10:40:52 2009 (r189151) @@ -262,9 +262,11 @@ chcleanup(struct cam_periph *periph) softc = (struct ch_softc *)periph->softc; + xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); + cam_periph_unlock(periph); destroy_dev(softc->dev); - xpt_print(periph->path, "removing device entry\n"); + cam_periph_lock(periph); free(softc, M_DEVBUF); } Modified: stable/7/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_pass.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_pass.c Sat Feb 28 10:40:52 2009 (r189151) @@ -165,13 +165,12 @@ passcleanup(struct cam_periph *periph) softc = (struct pass_softc *)periph->softc; + if (bootverbose) + xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); - + cam_periph_unlock(periph); destroy_dev(softc->dev); - - if (bootverbose) { - xpt_print(periph->path, "removing device entry\n"); - } + cam_periph_lock(periph); free(softc, M_DEVBUF); } Modified: stable/7/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_pt.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_pt.c Sat Feb 28 10:40:52 2009 (r189151) @@ -342,11 +342,11 @@ ptdtor(struct cam_periph *periph) softc = (struct pt_softc *)periph->softc; + xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); - + cam_periph_unlock(periph); destroy_dev(softc->dev); - - xpt_print(periph->path, "removing device entry\n"); + cam_periph_lock(periph); free(softc, M_DEVBUF); } Modified: stable/7/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_sa.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_sa.c Sat Feb 28 10:40:52 2009 (r189151) @@ -1377,17 +1377,16 @@ sacleanup(struct cam_periph *periph) softc = (struct sa_softc *)periph->softc; + xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); - + cam_periph_unlock(periph); destroy_dev(softc->devs.ctl_dev); - for (i = 0; i < SA_NUM_MODES; i++) { destroy_dev(softc->devs.mode_devs[i].r_dev); destroy_dev(softc->devs.mode_devs[i].nr_dev); destroy_dev(softc->devs.mode_devs[i].er_dev); } - - xpt_print(periph->path, "removing device entry\n"); + cam_periph_lock(periph); free(softc, M_SCSISA); } Modified: stable/7/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_ses.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_ses.c Sat Feb 28 10:40:52 2009 (r189151) @@ -227,9 +227,10 @@ sescleanup(struct cam_periph *periph) softc = (struct ses_softc *)periph->softc; - destroy_dev(softc->ses_dev); - xpt_print(periph->path, "removing device entry\n"); + cam_periph_unlock(periph); + destroy_dev(softc->ses_dev); + cam_periph_lock(periph); free(softc, M_SCSISES); } Modified: stable/7/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_sg.c Sat Feb 28 10:40:37 2009 (r189150) +++ stable/7/sys/cam/scsi/scsi_sg.c Sat Feb 28 10:40:52 2009 (r189151) @@ -200,11 +200,12 @@ sgcleanup(struct cam_periph *periph) struct sg_softc *softc; softc = (struct sg_softc *)periph->softc; + if (bootverbose) + xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); + cam_periph_unlock(periph); destroy_dev(softc->dev); - if (bootverbose) { - xpt_print(periph->path, "removing device entry\n"); - } + cam_periph_lock(periph); free(softc, M_DEVBUF); }