Subject: Re: bce(4) and memory > 1GB problem
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 01/10/2007 17:59:53
On Thu, Jan 11, 2007 at 12:24:04AM +0900, Izumi Tsutsui wrote:
> bouyer@antioche.eu.org wrote:
> 
> > > >either way, this will require a bunch of work for each platform to do
> > > >the right thing.  the patch proposed seems to be most of what we need
> > > >for it on x86 so i see little harm in commiting it.
> > > 
> > > ...except to note that the API will almost certainly change.
> > 
> > Yes. Maybe it should be better to add this as a parameter to
> > bus_dmamap_create(), and compute the proper _dm_bounce_thresh at this
> > time.  But this is a big change in the bus_dma API, and require
> > changing a lot of files, unless we keep bus_dmamap_create() as is and
> > intruduce a new function with this extra parameter.
> 
> bus_dmamem_alloc(9) should also be changed to allocate
> DMA safe memory for such devices.

Yes, this info also needs to be passed to bus_dmamem_alloc().

> 
> On some bus controller, it could map any physical memory into
> <1GB range on DMA address space in bus_dmamap_load(9) and
> no need to handle it by bounce buffer in bus_dmamap_sync(9).
> 
> Looks too complicated to design proper MI APIs...

No, it's not. We're already handling this for the bus limitations, and
the property we're talkign about is just an extention of this bus limitations.
We just need to pass this to the functions which care, so they can
handle this in addition to what they have from the bus_dma tag.

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 26 ans d'experience feront toujours la difference
--