diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c index 44971671d682..0dc361cf422f 100644 --- a/sys/alpha/alpha/busdma_machdep.c +++ b/sys/alpha/alpha/busdma_machdep.c @@ -229,11 +229,11 @@ 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); - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = MAX(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c index 8ea33e965ede..c10bad3ea092 100644 --- a/sys/amd64/amd64/busdma_machdep.c +++ b/sys/amd64/amd64/busdma_machdep.c @@ -248,11 +248,11 @@ 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); - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = MAX(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 117e808fdffe..2a97646bd306 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -207,12 +207,11 @@ 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); - - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = max(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = min(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 8ea33e965ede..c10bad3ea092 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -248,11 +248,11 @@ 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); - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = MAX(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c index 517aef9f54af..2c190853fc1b 100644 --- a/sys/ia64/ia64/busdma_machdep.c +++ b/sys/ia64/ia64/busdma_machdep.c @@ -247,11 +247,11 @@ 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); - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = MAX(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c index a97c5355052b..f058f5fd1542 100644 --- a/sys/powerpc/powerpc/busdma_machdep.c +++ b/sys/powerpc/powerpc/busdma_machdep.c @@ -167,12 +167,11 @@ 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); - - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->boundary = max(parent->boundary, newtag->boundary); + if (newtag->boundary == 0) + newtag->boundary = parent->boundary; + else if (parent->boundary != 0) + newtag->boundary = MIN(parent->boundary, + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c index d1cdac86157f..47f41839cd63 100644 --- a/sys/sparc64/sparc64/bus_machdep.c +++ b/sys/sparc64/sparc64/bus_machdep.c @@ -255,12 +255,11 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, newtag->dt_lowaddr); newtag->dt_highaddr = ulmax(parent->dt_highaddr, newtag->dt_highaddr); - /* - * XXX Not really correct??? Probably need to honor boundary - * all the way up the inheritence chain. - */ - newtag->dt_boundary = ulmin(parent->dt_boundary, - newtag->dt_boundary); + if (newtag->dt_boundary == 0) + newtag->dt_boundary = parent->dt_boundary; + else if (parent->dt_boundary != 0) + newtag->dt_boundary = ulmin(parent->dt_boundary, + newtag->dt_boundary); atomic_add_int(&parent->dt_ref_count, 1); }