Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jun 2013 13:38:10 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
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
Message-ID:  <201306181338.r5IDcAfc066424@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <ki@hh.iij4u.or.jp>
  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 {
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306181338.r5IDcAfc066424>