Bug 53271 - bus_dma(9) fails to document alignment restrictions
Summary: bus_dma(9) fails to document alignment restrictions
Status: Closed Overcome By Events
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-13 10:00 UTC by Hartmut Brandt
Modified: 2018-04-13 23:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hartmut Brandt freebsd_committer freebsd_triage 2003-06-13 10:00:30 UTC
While it is possible to specify an alignment to the bus_dma_tag_create
function this alignment is ignored in many (if not most cases). For i386
it is only effective if the tag is used to allocate memory via
bus_dmamem_alloc() and that memory is larger than PAGE_SIZE. For sparc64
the minimum alignment that may be specified seems to be a IO_PAGE_SIZE.
Other architectures probably have equivalent restrictions.

Many io devices need buffers that are aligned to 4-byte or other boundaries.
In these cases specifying an alignment does NOT help.

This should be documented as an implementation limitation, because it can
cause driver developers much grief searching for the problem.

Fix: 

Add something like the following to either the paragraph about
bus_dma_tag_create or into a BUGS or IMPLEMENTATION NOTES section:

The alignment argument to bus_dma_tag_create cannot be used to enforce
alignments that are lesser than a PAGE_SIZE. Generally it should be assumed that
the argument is ignored by the bus_dma code.
How-To-Repeat: 
look at sys/i386/i386/bus_machdep.c, sys/sparc64/sparc64/{bus_machdep,iommu}.c
Comment 1 Hiten Pandya freebsd_committer freebsd_triage 2003-06-13 19:47:37 UTC
Responsible Changed
From-To: freebsd-doc->hmp

Hmm, interesting. 
I will take care of this issue after discussing it with Justin.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2018-04-13 23:31:09 UTC
The original report is no longer true. alignment argument is not ignored by bus_dma_tag_create and it can be less than PAGE_SIZE