svn commit: r248583 - head/sys/dev/twa

Konstantin Belousov kib at FreeBSD.org
Thu Mar 21 13:06:29 UTC 2013


Author: kib
Date: Thu Mar 21 13:06:28 2013
New Revision: 248583
URL: http://svnweb.freebsd.org/changeset/base/248583

Log:
  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 at hh.iij4u.or.jp>
  PR:	kern/177020

Modified:
  head/sys/dev/twa/tw_osl_cam.c
  head/sys/dev/twa/tw_osl_freebsd.c

Modified: head/sys/dev/twa/tw_osl_cam.c
==============================================================================
--- head/sys/dev/twa/tw_osl_cam.c	Thu Mar 21 13:02:43 2013	(r248582)
+++ head/sys/dev/twa/tw_osl_cam.c	Thu Mar 21 13:06:28 2013	(r248583)
@@ -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: head/sys/dev/twa/tw_osl_freebsd.c
==============================================================================
--- head/sys/dev/twa/tw_osl_freebsd.c	Thu Mar 21 13:02:43 2013	(r248582)
+++ head/sys/dev/twa/tw_osl_freebsd.c	Thu Mar 21 13:06:28 2013	(r248583)
@@ -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 {
 			/*


More information about the svn-src-all mailing list