summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/sparc64/bus_machdep.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-09-10 07:00:28 +0000
committermarcel <marcel@FreeBSD.org>2004-09-10 07:00:28 +0000
commit04fc0c1ce75dcd7984155fda32f09cf760d60aae (patch)
tree649f472f54f5038182411b9d66ff143b1362ab11 /sys/sparc64/sparc64/bus_machdep.c
parent1cc09608683a2e94552f699893e87ae03f679560 (diff)
downloadFreeBSD-src-04fc0c1ce75dcd7984155fda32f09cf760d60aae.zip
FreeBSD-src-04fc0c1ce75dcd7984155fda32f09cf760d60aae.tar.gz
Better fix the busdma problem exposed by ATA. With the CMD 646 for
example the maximum segment size is 64K while the boundary is set to 8K due to controller limitations. It is impossible to NOT cross the boundary for any segment size that's larger than the boundary. So, once we inherited the boundary from the parent tag, make sure to reduce the maximum segment size to the boundary if it was larger. MT5 candidate.
Diffstat (limited to 'sys/sparc64/sparc64/bus_machdep.c')
-rw-r--r--sys/sparc64/sparc64/bus_machdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c
index 47f4183..2bdf01c 100644
--- a/sys/sparc64/sparc64/bus_machdep.c
+++ b/sys/sparc64/sparc64/bus_machdep.c
@@ -246,7 +246,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
newtag->dt_lockfunc = dflt_lock;
newtag->dt_lockfuncarg = NULL;
}
-
+
newtag->dt_segments = NULL;
/* Take into account any restrictions imposed by our parent tag */
@@ -263,6 +263,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
atomic_add_int(&parent->dt_ref_count, 1);
}
+ if (newtag->dt_boundary > 0)
+ newtag->dt_maxsegsz = ulmin(newtag->dt_maxsegsz,
+ newtag->dt_boundary);
+
*dmat = newtag;
return (0);
}
OpenPOWER on IntegriCloud