From owner-cvs-src@FreeBSD.ORG Thu Mar 2 18:55:40 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5EF6C16A420; Thu, 2 Mar 2006 18:55:40 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3B7443D45; Thu, 2 Mar 2006 18:55:39 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id k22Itbp3026956; Thu, 2 Mar 2006 20:55:37 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ip.net.ua [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 37601-01; Thu, 2 Mar 2006 20:55:10 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id k22It56j026946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Mar 2006 20:55:05 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.4/8.13.4) id k22ItHE6026741; Thu, 2 Mar 2006 20:55:17 +0200 (EET) (envelope-from ru) Date: Thu, 2 Mar 2006 20:55:07 +0200 From: Ruslan Ermilov To: John-Mark Gurney Message-ID: <20060302185507.GM29183@ip.net.ua> References: <200602281958.k1SJwvGL051504@repoman.freebsd.org> <20060301232621.GF29183@ip.net.ua> <20060301233327.GQ840@funkthat.com> <4406334F.7070205@samsco.org> <20060302071849.GH29183@ip.net.ua> <20060302181629.GS840@funkthat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3hAdtgBjtgL7p0NQ" Content-Disposition: inline In-Reply-To: <20060302181629.GS840@funkthat.com> User-Agent: Mutt/1.5.11 X-Virus-Scanned: amavisd-new at ip.net.ua Cc: cvs-src@freebsd.org, Scott Long , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/share/man/man9 bus_dma.9 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2006 18:55:40 -0000 --3hAdtgBjtgL7p0NQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 02, 2006 at 10:16:29AM -0800, John-Mark Gurney wrote: > > Correct. So driver tells a device to "read directly into memory", a > write >=20 > how can you read into something? >=20 The driver tells the disk to READ data and put it into the memory. > > : BUS_DMASYNC_PREREAD Perform any synchronization required > > : prior to an update of host memory by the > > : DMA read operation. > > :=20 > > : BUS_DMASYNC_PREWRITE Perform any synchronization required > > : after an update of host memory by the CPU > > : and prior to DMA write operations. > > :=20 > > : BUS_DMASYNC_POSTREAD Perform any synchronization required > > : after DMA read operations and prior to > > : CPU access to host memory. > > :=20 > > : BUS_DMASYNC_POSTWRITE Perform any synchronization required > > : after DMA write operations. > >=20 OK, so DMA read/write ops are from the device's perspective and dma sync ops are from the host memory's perspective, but then the above descriptions should all be fixed, and the phrase "to be DMA'ed into a device" doesn't make sense. BUS_DMASYNC_PREREAD Perform any synchronization required prior to an update of host memory by t= he DMA read operation. A DMA read by the device of the host memory cannot update it; it's a DMA write that's meant here. BUS_DMASYNC_PREWRITE Perform any synchronization required after an update of host memory by the = CPU and prior to DMA write operations. The device will read host memory for writing/sending purposes, it's a DMA read then. Please review the following patch that fixes these inconsistencies. %%% Index: bus_dma.9 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/share/man/man9/bus_dma.9,v retrieving revision 1.33 diff -u -r1.33 bus_dma.9 --- bus_dma.9 1 Mar 2006 23:56:18 -0000 1.33 +++ bus_dma.9 2 Mar 2006 18:48:46 -0000 @@ -255,8 +255,8 @@ description below for more details on how to use these operations. .Pp All operations specified below are performed from the host memory point of= view, -where a read implies data coming from the device to the host memory, and a= write -implies data going from the host memory to the device. +where a read implies data coming from the device to the host memory (DMA w= rite), +and a write implies data going from the host memory to the device (DMA rea= d). Alternately, the operations can be thought of in terms of driver operation= s, where reading a network packet or storage sector corresponds to a read ope= ration in @@ -264,15 +264,15 @@ .Bl -tag -width BUS_DMASYNC_POSTWRITE .It Dv BUS_DMASYNC_PREREAD Perform any synchronization required prior to an update of host memory by = the -DMA read operation. +DMA write operation. .It Dv BUS_DMASYNC_PREWRITE Perform any synchronization required after an update of host memory by the= CPU -and prior to DMA write operations. +and prior to DMA read operations. .It Dv BUS_DMASYNC_POSTREAD -Perform any synchronization required after DMA read operations and prior to +Perform any synchronization required after DMA write operations and prior = to CPU access to host memory. .It Dv BUS_DMASYNC_POSTWRITE -Perform any synchronization required after DMA write operations. +Perform any synchronization required after DMA read operations. .El .It Vt bus_dma_lock_t Client specified lock/mutex manipulation method. @@ -672,8 +672,8 @@ .Fn bus_dmamap_sync is the method used to ensure that CPU and device DMA access to shared memory is coherent. -For example, the CPU might be used to setup the contents of a buffer -that is to be DMA'ed into a device. +For example, the CPU might be used to set up the contents of a buffer +that is to be DMA read by a device. To ensure that the data are visible via the device's mapping of that memory, the buffer must be loaded and a dma sync operation of .Dv BUS_DMASYNC_PREWRITE %%% Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --3hAdtgBjtgL7p0NQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFEBz+LqRfpzJluFF4RAla5AKCI80xh+o4xTudDX2pZkVvJ9YJiqQCfXTu+ RZB+aPTbLhBHXh1mRr6gkp8= =92fE -----END PGP SIGNATURE----- --3hAdtgBjtgL7p0NQ--