From owner-svn-src-all@freebsd.org Thu Mar 23 06:37:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB71D19359; Thu, 23 Mar 2017 06:37:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63437C; Thu, 23 Mar 2017 06:37:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2N6bNSF052238; Thu, 23 Mar 2017 06:37:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2N6bNgd052237; Thu, 23 Mar 2017 06:37:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703230637.v2N6bNgd052237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 23 Mar 2017 06:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r315811 - stable/10/sys/dev/mpt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 06:37:24 -0000 Author: mav Date: Thu Mar 23 06:37:23 2017 New Revision: 315811 URL: https://svnweb.freebsd.org/changeset/base/315811 Log: MFC r308423 (by scottl): Fix the fallout from r308268 (mpt driver causes endless witness warnings in VMWare and elsewhere) with the precision of a dull, rusty butter knife. Modified: stable/10/sys/dev/mpt/mpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpt/mpt.c ============================================================================== --- stable/10/sys/dev/mpt/mpt.c Thu Mar 23 06:36:55 2017 (r315810) +++ stable/10/sys/dev/mpt/mpt.c Thu Mar 23 06:37:23 2017 (r315811) @@ -2695,7 +2695,11 @@ mpt_configure_ioc(struct mpt_softc *mpt, */ mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + /* XXX Lame Locking! */ + MPT_UNLOCK(mpt); error = mpt_dma_buf_alloc(mpt); + MPT_LOCK(mpt); + if (error != 0) { mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); return (EIO); @@ -2745,6 +2749,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, * retrieved, we are responsible for re-downloading * the firmware after any hard-reset. */ + MPT_UNLOCK(mpt); mpt->fw_image_size = mpt->ioc_facts.FWImageSize; error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -2752,6 +2757,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, &mpt->fw_dmat); if (error != 0) { mpt_prt(mpt, "cannot create firmware dma tag\n"); + MPT_LOCK(mpt); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, @@ -2760,6 +2766,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); + MPT_LOCK(mpt); return (ENOMEM); } mi.mpt = mpt; @@ -2768,6 +2775,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image, mpt->fw_image_size, mpt_map_rquest, &mi, 0); mpt->fw_phys = mi.phys; + MPT_LOCK(mpt); error = mpt_upload_fw(mpt); if (error != 0) { mpt_prt(mpt, "firmware upload failed.\n");