summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2004-09-08 04:54:19 +0000
committerscottl <scottl@FreeBSD.org>2004-09-08 04:54:19 +0000
commite23092c9a97f1b039a77c6653725aa3ee0ef2053 (patch)
treeb4a52ac7a4f3b9428196e77949cd5fcfe552b0ab /sys/sparc64
parent143d77da28b1eae3998141ecdbf493f35562a44e (diff)
downloadFreeBSD-src-e23092c9a97f1b039a77c6653725aa3ee0ef2053.zip
FreeBSD-src-e23092c9a97f1b039a77c6653725aa3ee0ef2053.tar.gz
Fix a problem with tag->boundary inheritence that has existed since day one
and was propagated to nearly every platform. The boundary of the child needs to consider the boundary of the parent and pick the minimum of the two, not the maximum. However, if either is 0 then pick the appropriate one. This bug was exposed by a recent change to ATA, which should now be fixed by this change. The alignment and maxsegsz tag attributes likely also need a similar review in the near future. This is a MT5 candidate. Reviewed by: marcel Submitted by: sos (in part)
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/bus_machdep.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c
index d1cdac8..47f4183 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);
}
OpenPOWER on IntegriCloud