From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 03:34:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CB252FC; Tue, 18 Jun 2013 03:34:08 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74F7A1382; Tue, 18 Jun 2013 03:34:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5I3Y8XF068091; Tue, 18 Jun 2013 03:34:08 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I3Y8tY068090; Tue, 18 Jun 2013 03:34:08 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180334.r5I3Y8tY068090@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 03:34:08 +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: r251888 - stable/9/sys/dev/amd 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: Tue, 18 Jun 2013 03:34:08 -0000 Author: scottl Date: Tue Jun 18 03:34:08 2013 New Revision: 251888 URL: http://svnweb.freebsd.org/changeset/base/251888 Log: Catch up to the changes from r251874. This isn't an MFC because the amd(4) driver no longer exists in FreeBSD 10. Obtained from: Netflix Modified: stable/9/sys/dev/amd/amd.c Modified: stable/9/sys/dev/amd/amd.c ============================================================================== --- stable/9/sys/dev/amd/amd.c Tue Jun 18 02:57:56 2013 (r251887) +++ stable/9/sys/dev/amd/amd.c Tue Jun 18 03:34:08 2013 (r251888) @@ -428,61 +428,22 @@ amd_action(struct cam_sim * psim, union pSRB->ScsiCmdLen = pcsio->cdb_len; bcopy(pcsio->cdb_io.cdb_bytes, pSRB->CmdBlock, pcsio->cdb_len); if ((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - if ((pccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { + int error; + + error - bus_dmamap_load_ccb(amd->buffer_dmat, + pSRB->dmamap, + pccb, + amdexecutesrb, + pSRB, /*flags*/0); + if (error == EINPROGRESS) { /* - * We've been given a pointer - * to a single buffer. + * So as to maintain ordering, + * freeze the controller queue + * until our mapping is + * returned. */ - if ((pccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { - int s; - int error; - - s = splsoftvm(); - error = - bus_dmamap_load(amd->buffer_dmat, - pSRB->dmamap, - pcsio->data_ptr, - pcsio->dxfer_len, - amdexecutesrb, - pSRB, /*flags*/0); - if (error == EINPROGRESS) { - /* - * So as to maintain - * ordering, freeze the - * controller queue - * until our mapping is - * returned. - */ - xpt_freeze_simq(amd->psim, 1); - pccb->ccb_h.status |= - CAM_RELEASE_SIMQ; - } - splx(s); - } else { - struct bus_dma_segment seg; - - /* Pointer to physical buffer */ - seg.ds_addr = - (bus_addr_t)pcsio->data_ptr; - seg.ds_len = pcsio->dxfer_len; - amdexecutesrb(pSRB, &seg, 1, 0); - } - } else { - struct bus_dma_segment *segs; - - if ((pccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0 - || (pccb->ccb_h.flags & CAM_DATA_PHYS) != 0) { - TAILQ_INSERT_HEAD(&amd->free_srbs, - pSRB, links); - pccb->ccb_h.status = CAM_PROVIDE_FAIL; - xpt_done(pccb); - return; - } - - /* Just use the segments provided */ - segs = - (struct bus_dma_segment *)pcsio->data_ptr; - amdexecutesrb(pSRB, segs, pcsio->sglist_cnt, 0); + xpt_freeze_simq(sim, 1); + pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } } else amdexecutesrb(pSRB, NULL, 0, 0);