Propagate any alignment restriction from the parent tag to a new tag,

keeping the more restrictive of the two values.

Reviewed by:	cognet
This commit is contained in:
Ian Lepore 2014-07-29 02:36:09 +00:00
parent 3de4bbe357
commit befb477022

View File

@ -446,6 +446,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
if (parent != NULL) {
newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr);
newtag->highaddr = MAX(parent->highaddr, newtag->highaddr);
newtag->alignment = MAX(parent->alignment, newtag->alignment);
newtag->flags |= parent->flags & BUS_DMA_COULD_BOUNCE;
if (newtag->boundary == 0)
newtag->boundary = parent->boundary;