aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
commitc46262f8109e20617deddebd81374e3e6a219512 (patch)
treee713155b460f197fcda0ae6a9784ec82b6f9a6f0 /sys
parent21f97e938d91d7b80e853b536d4347a365536982 (diff)
downloadsrc-c46262f8109e20617deddebd81374e3e6a219512.tar.gz
src-c46262f8109e20617deddebd81374e3e6a219512.zip
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
Notes
Notes: svn path=/head/; revision=248583
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/twa/tw_osl_cam.c10
-rw-r--r--sys/dev/twa/tw_osl_freebsd.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c
index 9c4de23b02e9..67fcae30569c 100644
--- a/sys/dev/twa/tw_osl_cam.c
+++ b/sys/dev/twa/tw_osl_cam.c
@@ -273,9 +273,13 @@ tw_osli_execute_scsi(struct tw_osli_req_context *req, union ccb *ccb)
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);
/*
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c
index 2956df6f0fb8..b2284f898920 100644
--- a/sys/dev/twa/tw_osl_freebsd.c
+++ b/sys/dev/twa/tw_osl_freebsd.c
@@ -1475,7 +1475,7 @@ tw_osli_map_request(struct tw_osli_req_context *req)
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 {
/*