From owner-svn-src-stable-9@FreeBSD.ORG Fri Sep 20 21:51:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 991DF8BC; Fri, 20 Sep 2013 21:51:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84FC32497; Fri, 20 Sep 2013 21:51:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8KLpd3n004112; Fri, 20 Sep 2013 21:51:39 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8KLpdC1004111; Fri, 20 Sep 2013 21:51:39 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201309202151.r8KLpdC1004111@svn.freebsd.org> From: Mark Johnston Date: Fri, 20 Sep 2013 21:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255740 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2013 21:51:39 -0000 Author: markj Date: Fri Sep 20 21:51:38 2013 New Revision: 255740 URL: http://svnweb.freebsd.org/changeset/base/255740 Log: MFC r254742: Hold mfi_io_lock across calls to xpt_rescan() and xpt_alloc_ccb_nowait(). xpt_rescan() expects the SIM lock to be held, and we trip a mtx_assert if the driver initiates multiple rescans in quick succession. Modified: stable/9/sys/dev/mfi/mfi_cam.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_cam.c Fri Sep 20 21:26:51 2013 (r255739) +++ stable/9/sys/dev/mfi/mfi_cam.c Fri Sep 20 21:51:38 2013 (r255740) @@ -307,17 +307,16 @@ mfip_cam_rescan(struct mfi_softc *sc, ui return; } camsc->state = MFIP_STATE_RESCAN; - mtx_unlock(&sc->mfi_io_lock); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { + mtx_unlock(&sc->mfi_io_lock); device_printf(sc->mfi_dev, "Cannot allocate ccb for bus rescan.\n"); return; } sim = camsc->sim; - mtx_lock(&sc->mfi_io_lock); if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -326,11 +325,8 @@ mfip_cam_rescan(struct mfi_softc *sc, ui "Cannot create path for bus rescan.\n"); return; } - mtx_unlock(&sc->mfi_io_lock); - xpt_rescan(ccb); - mtx_lock(&sc->mfi_io_lock); camsc->state = MFIP_STATE_NONE; mtx_unlock(&sc->mfi_io_lock); }