From owner-svn-src-all@FreeBSD.ORG Tue Jun 18 13:38:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C366867; Tue, 18 Jun 2013 13:38:11 +0000 (UTC) (envelope-from mav@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 E7FA71A34; Tue, 18 Jun 2013 13:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IDcA17066426; Tue, 18 Jun 2013 13:38:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IDcAfc066424; Tue, 18 Jun 2013 13:38:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306181338.r5IDcAfc066424@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 13:38:10 +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: r251938 - stable/9/sys/dev/twa X-SVN-Group: stable-9 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.14 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: Tue, 18 Jun 2013 13:38:11 -0000 Author: mav Date: Tue Jun 18 13:38:10 2013 New Revision: 251938 URL: http://svnweb.freebsd.org/changeset/base/251938 Log: MFC r248583 (by kib): Fix twa(4) after the r246713. The driver copies data around to satisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCB flag for mapped data, pass the csio->data_ptr in the req->data. Do not put the ccb pointer into req->data ever, ccb is stored in req->orig_req already. Submitted by: Shuichi KITAGUCHI PR: kern/177020 Modified: stable/9/sys/dev/twa/tw_osl_cam.c stable/9/sys/dev/twa/tw_osl_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_cam.c Tue Jun 18 13:36:15 2013 (r251937) +++ stable/9/sys/dev/twa/tw_osl_cam.c Tue Jun 18 13:38:10 2013 (r251938) @@ -273,9 +273,13 @@ tw_osli_execute_scsi(struct tw_osli_req_ xpt_done(ccb); return(1); } - req->data = ccb; - req->length = csio->dxfer_len; - req->flags |= TW_OSLI_REQ_FLAGS_CCB; + if ((ccb_h->flags & CAM_DATA_MASK) == CAM_DATA_VADDR) { + if ((req->length = csio->dxfer_len) != 0) { + req->data = csio->data_ptr; + scsi_req->sgl_entries = 1; + } + } else + req->flags |= TW_OSLI_REQ_FLAGS_CCB; req->deadline = tw_osl_get_local_time() + (ccb_h->timeout / 1000); /* Modified: stable/9/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_freebsd.c Tue Jun 18 13:36:15 2013 (r251937) +++ stable/9/sys/dev/twa/tw_osl_freebsd.c Tue Jun 18 13:38:10 2013 (r251938) @@ -1475,7 +1475,7 @@ tw_osli_map_request(struct tw_osli_req_c mtx_unlock_spin(sc->io_lock); } else if (req->flags & TW_OSLI_REQ_FLAGS_CCB) { error = bus_dmamap_load_ccb(sc->dma_tag, req->dma_map, - req->data, twa_map_load_data_callback, req, + req->orig_req, twa_map_load_data_callback, req, BUS_DMA_WAITOK); } else { /*