From owner-cvs-src@FreeBSD.ORG Sat Jun 14 11:05:59 2003 Return-Path: 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 D51B337B401; Sat, 14 Jun 2003 11:05:59 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5945343FAF; Sat, 14 Jun 2003 11:05:59 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 1C29B2ED411; Sat, 14 Jun 2003 11:05:59 -0700 (PDT) Date: Sat, 14 Jun 2003 20:05:59 +0200 From: Maxime Henrion To: "Justin T. Gibbs" Message-ID: <20030614180559.GQ21011@elvis.mu.org> References: <200306132007.h5DK7nFw084898@repoman.freebsd.org> <113730000.1055611820@caspian.scsiguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <113730000.1055611820@caspian.scsiguy.com> User-Agent: Mutt/1.4.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: 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.1 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: Sat, 14 Jun 2003 18:06:00 -0000 Justin T. Gibbs wrote: > > mux 2003/06/13 13:07:49 PDT > > > > FreeBSD src repository > > > > Modified files: > > share/man/man9 bus_dma.9 > > Log: > > - Document the fact that you can specify several DMA operations to > > bus_dmamap_sync() by OR'ing them together. > > - Don't document what BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE and > > BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE is supposed to do when > > passed to bus_dmamap_sync(). There are other possible combinations > > and the reader just needs to know what the individual flags do and > > that he can combine different DMA operations. > > I purposely documented the only combinations that make sense. This > would also allow us to change back to using an enum in the future > since the combinations are limited just by changing the names of the > operations. It simply does not make sense to combine pre and post sync > ops since doing so implies that you will lose data if your buffers are > being bounced. In other words, any update from the CPU that you expect > your device to see must occur after you have POST'ed any PRE'ed operation > so that the buffer contents updated by the CPU are synced. It sure doesn't make sense to combine PREREAD and POSTREAD or PREWRITE and POSTWRITE, but I don't see what would be wrong with PREREAD|POSTWRITE or POSTREAD|PREWRITE. One can imagine a scenario where the device is DMA'ing some data to memory and where you DMA it back to the device, and thus you would like to do a POSTREAD|PREWRITE. I agree that this sounds unlikely and that it also relies on bus_dmamap_sync() somehow knowing the ordering of things, but it's possible, and wouldn't cause any data loss, whether be buffers are bounced or not. Anyways, whether it's useful or not, I believe it would be more consistent with other manpages to leave things as is and maybe add a comment to tell that some combinations make no sense. Would you be happy with this? Cheers, Maxime