Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Dec 2012 05:50:17 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244811 - projects/altix2/sys/dev/mpt
Message-ID:  <201212290550.qBT5oH9A085163@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sat Dec 29 05:50:16 2012
New Revision: 244811
URL: http://svnweb.freebsd.org/changeset/base/244811

Log:
  Use busdma_sync_range() for the request and reply buffers.

Modified:
  projects/altix2/sys/dev/mpt/mpt.c

Modified: projects/altix2/sys/dev/mpt/mpt.c
==============================================================================
--- projects/altix2/sys/dev/mpt/mpt.c	Sat Dec 29 03:28:55 2012	(r244810)
+++ projects/altix2/sys/dev/mpt/mpt.c	Sat Dec 29 05:50:16 2012	(r244811)
@@ -806,8 +806,9 @@ mpt_intr(void *arg)
 			    " 0x%x)\n", req_index, reply_desc);
 		}
 
-		busdma_sync(mpt->request_md,
-		    BUSDMA_SYNC_POSTREAD | BUSDMA_SYNC_POSTWRITE);
+		busdma_sync_range(mpt->request_md,
+		    BUSDMA_SYNC_POSTREAD | BUSDMA_SYNC_POSTWRITE,
+		    req->req_pbuf, MPT_REQUEST_AREA);
 		free_rf = mpt_reply_handlers[cb_index](mpt, req,
 		    reply_desc, reply_frame);
 
@@ -846,8 +847,9 @@ mpt_complete_request_chain(struct mpt_so
 		MSG_REQUEST_HEADER *msg_hdr;
 		u_int		    cb_index;
 
-		busdma_sync(mpt->request_md,
-		    BUSDMA_SYNC_POSTREAD | BUSDMA_SYNC_POSTWRITE);
+		busdma_sync_range(mpt->request_md,
+		    BUSDMA_SYNC_POSTREAD | BUSDMA_SYNC_POSTWRITE,
+		    req->req_pbuf, MPT_REQUEST_AREA);
 		msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf;
 		ioc_status_frame.Function = msg_hdr->Function;
 		ioc_status_frame.MsgContext = msg_hdr->MsgContext;
@@ -1235,7 +1237,7 @@ mpt_free_request(struct mpt_softc *mpt, 
 	mpt_send_event_ack(mpt, req, &record->reply, record->context);
 	offset = (uint32_t)((uint8_t *)record - mpt->reply);
 	reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF);
-	busdma_sync_range(mpt->reply_md, BUSDMA_SYNC_PREREAD, offset,
+	busdma_sync_range(mpt->reply_md, BUSDMA_SYNC_PREREAD, reply_baddr,
 	    MPT_REPLY_SIZE);
 	mpt_free_reply(mpt, reply_baddr);
 }
@@ -1276,8 +1278,9 @@ mpt_send_cmd(struct mpt_softc *mpt, requ
 	if (mpt->verbose > MPT_PRT_DEBUG2) {
 		mpt_dump_request(mpt, req);
 	}
-	busdma_sync(mpt->request_md,
-	    BUSDMA_SYNC_PREREAD | BUSDMA_SYNC_PREWRITE);
+	busdma_sync_range(mpt->request_md,
+	    BUSDMA_SYNC_PREREAD | BUSDMA_SYNC_PREWRITE,
+	    req->req_pbuf, MPT_REQUEST_AREA);
 	req->state |= REQ_STATE_QUEUED;
 	KASSERT(mpt_req_on_free_list(mpt, req) == 0,
 	    ("req %p:%u func %x on freelist list in mpt_send_cmd",



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