Subject: Re: lack of pciide transfer alignment checking causes crash
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Richard Earnshaw <Richard.Earnshaw@buzzard.freeserve.co.uk>
List: tech-kern
Date: 06/28/2005 22:53:11
On Sun, 26 Jun 2005 21:53:51 +0200, Manuel Bouyer wrote:
> On Sun, Jun 26, 2005 at 07:04:52AM +1000, matthew green wrote:
> >
> >
> > i have a similar problem with BCM4401 ethernet -- it can only address
> > 1GB of physical ram and i need to introduce bounce buffers into the
> > driver itself, as i've as yet been unable to figure out how to make
> > bus_dma(9) do this for me.
> >
> > is there a way for bus_dma(9) to properly handle this sort of device?
> > some audio chipsets have the same issue, so, a more general solution
> > than bounce buffers in the driver would seem best.
>
> Right now, bus_dma(9) because it only knows the limitations of the bus
> (e.g. the 16MB limit for ISA, or 4GB limit for 32bit PCI).
> The bus_dma interface would need to be extended to be able to specify
> a range of allowed physical addresses. I think this information needs to
> be passed to bus_dmamap_create() and bus_dmamem_alloc() (it's the same kind
> of information as alignment and boundary).
> If several devices need this, and it's not something limited to one or two
> i386-only device, it probably make sense to extend bus_dma in this direction.
> For platforms already using bounce buffer, it would not be hard to add this.
> For platforms using an IOMMU, this should not be too difficult to add either.
> As a temporary measure, other platforms could return EINVAL for out of range
> requests (or maybe at bus_dmamap_create() time. bus_dmamem_alloc() is easier)
> .
Some of the CPU boards that can be fitted to the ARM Integrator/AP
development boards have on-board memory that can't be used for DMA (it's
not mapped into the PCI address space). This memory is at least 4 times
faster than the normal memory sticks that are available (twice the clock
frequency, twice the bus width), but currently I can't use this memory
with NetBSD because it doesn't do bounces properly.
R.