Subject: Re: BUS_DMA_CONTROLDATA flag for bus_dma(9)
To: None <briggs@wasabisystems.com>
From: None <cgd@broadcom.com>
List: tech-kern
Date: 08/15/2003 15:24:38
At Fri, 15 Aug 2003 22:13:50 +0000 (UTC), "Allen Briggs" wrote:
> On Fri, Aug 15, 2003 at 09:30:24PM +0000, Eduardo Horvath wrote:
> > Does this mean we can finally get rid of that BUS_DMA_STREAMING 
> > flag?
> 
> No.  I don't think so.  BUS_DMA_COHERENT is for CPU <-> memory
> coherency where BUS_DMA_STREAMING is for controlling device <->
> memory coherency in certain cases that I know about only from
> the man page.  I don't see how that's changed at all.

Actually, BUS_DMA_COHERENT involves memory as seen by CPU and devices.

With BUS_DMA_COHERENT, devices and the CPU must have a coherent view
of memory.

Reading the STREAMING description, it sounds like it specifically
indicates that non-coherence is OK.  I do wonder whether it should be
considered implied by ! COHERENT.

it seems like:

* if using BUS_DMA_COHERENT, BUS_DMA_STREAMING should not ever be
  honored.

* i dunno if BUS_DMA_STREAMING should "always" (attempt to) be used
  for non-COHERENT transfers, but reading the description in the
  manual page, that might be appropriate.

  I guess the only question is, how does the software know in some
  generic sense whether the device fits all of the constraints needed
  for STREAMING.  Is using STREAMING dangerous in the non-COHERENT
  case, or in the case where the device accesses things "strangely"?



cgd