Subject: Re: lack of pciide transfer alignment checking causes crash
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 06/26/2005 20:19:08
On Sun, Jun 26, 2005 at 01:11:44PM -0500, Eric Haszlakiewicz wrote:
> On Sun, Jun 26, 2005 at 12:41:11PM +0200, Martin Husemann wrote:
> > On Sat, Jun 25, 2005 at 03:31:57PM -0700, Jason Thorpe wrote:
> > > We could add this sort of capability, I guess... but it would require  
> > > all of the back-ends to implement all of the bounce buffering  
> > > capability... and for what?  For a single broken device?
> > 
> > If we could lazy-implement them, I guess we'd be done with i386 and maybe
> > amd64 for quite some time.
> > 
> > Like, say, have a few __BUSDMA_HAS.... macros in ctypes.h and make drivers
> > that need those features #error with a good message if they are compiled on
> > an arch that doesn't have it.
> 
> 	That's overly restrictive.  If the machine you're running on has
> less memory than the cutoff point for that device then it should still
> work even without bounce buffers.  A better option might be to have
> the driver check at attach time if any busdma memory it got allocated
> is within the right range.

But the memory is has to DMA from/to isn't allocated by the driver, it's
comming from upper layers, or possibly from a user process.

So we need support for this type of constraint in both bus_dmamem_alloc() and
bus_dmamap_create(). If you have less memory than the limit, bus_dma() won't
use bounce buffers anyway.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--