svn commit: r188350 - in head/sys: amd64/amd64 arm/arm
dev/usb2/core i386/i386 ia64/ia64 sys
Marcel Moolenaar
xcllnt at mac.com
Mon Feb 9 11:18:36 PST 2009
On Feb 9, 2009, at 10:42 AM, John Baldwin wrote:
>>> The 'align' parameter to bus_dma_tag_create(). If your hardware
>>> needs buffers
>>> to be aligned on a 4-byte boundary and you bus_dmamap_load() a
>>> buffer
>>> where 'addr % 4 != 0', then the buffer is bounced. Since by default
>>> the new
>>> buffer starts on a page boundary, it satifies the 'addr % 4'.
>>
>> But according to the man page, bounce buffering may not
>> be implemented or not be applicable to a platform. It
>> seems to me that you cannot depend on this side-effect
>> in a generic driver. Are you guys talking only in terms
>> of i386 or is this generally applicable?
>
> All of the platforms that do bounce buffering will honor this. If a
> given
> platform doesn't support bounce buffering then I imagine it will fail
> misaligned requests with an error. It would probably make it easier
> to
> support bounce buffering on more platforms if some of the support
> code for
> managing bounce zones could be moved into a subr_busdma.c or the
> like since
> much of it is copy and pasted.
Very much agreed with the unification in subr_busdma.c.
If the shared implementation then grows a IOMMU interface,
then platforms with a IOMMU can avoid bounce buffering
when possible (i.e. no re-alignment is needed or enough
free IOMMU mappings exist to avoid the bounce buffering).
--
Marcel Moolenaar
xcllnt at mac.com
More information about the svn-src-head
mailing list