From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 24 15:14:58 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A5D216A4B3; Wed, 24 Sep 2003 15:14:58 -0700 (PDT) Received: from venus.vincentjardin.net (AVelizy-102-1-1-60.w193-253.abo.wanadoo.fr [193.253.255.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id B904843FAF; Wed, 24 Sep 2003 15:14:54 -0700 (PDT) (envelope-from jardin@venus.vincentjardin.net) Received: from venus.vincentjardin.net (localhost [127.0.0.1]) h8OMEve7043257; Thu, 25 Sep 2003 00:14:57 +0200 (CEST) (envelope-from jardin@venus.vincentjardin.net) Received: by venus.vincentjardin.net (8.12.10/8.12.9/Submit) id h8OMEuOF043256; Thu, 25 Sep 2003 00:14:56 +0200 (CEST) From: Vincent Jardin To: Maxime Henrion Date: Thu, 25 Sep 2003 00:14:53 +0200 User-Agent: KMail/1.5.2 References: <200309242342.55788.vjardin@free.fr> <20030924215448.GF8404@elvis.mu.org> In-Reply-To: <20030924215448.GF8404@elvis.mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200309250014.53816.vjardin@free.fr> cc: hackers@freebsd.org Subject: Re: BUS DMA sync X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 22:14:58 -0000 Thanks, What's about PREREAD ? What kind of CPU synchronization is required prior a= =20 DMA read ? There is no cache during a device to host memory process, isn't = it=20 ? Vincent Le Mercredi 24 Septembre 2003 23:54, Maxime Henrion a =E9crit : > Vincent Jardin wrote: > > Hi, > > > > I try to understand the purpose of the PRE sync (BUS_DMASYNC_PREREAD, > > BUS_DMASYNC_PREWRITE). > > > > I understand POST synchronization (BUS_DMASYNC_POSTREAD, > > BUS_DMASYNC_POSTWRITE) when a device to memory or a memory to device > > transfert needs to be synchronized. However, what does a synchronization > > before a transfert mean ? > > With common architectures where FreeBSD runs on, only BUS_DMASYNC_PREWRITE > and BUS_DMASYNC_POSTREAD are actually meaningful and needed. It's good > style to use the two others where appriopriate though, because some more > exotic architecture might require it some day. > > BUS_DMASYNC_PREWRITE is used to synchronize before there's a DMA tranfer > from host memory to a device. It's needed to ensure the device will > read up-to-date memory, because recent changes to memory might still sit > in a cache, so it actually flushes the memory cache. > > BUS_DMASYNC_POSTREAD is used to synchronize after a DMA transfer from > the device to host memory. It's needed to ensure the software will get > up-to-date memory as written by the device, and not outdated memory sitti= ng > in a cache, so it actually invalidates the memory cache. > > Cheers, > Maxime