From e4793b0edaf216911b7ff37cf7c3917d67c63ede Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Fri, 10 Sep 2004 07:00:28 +0000 Subject: 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. --- sys/sparc64/sparc64/bus_machdep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c index 47f41839cd63..2bdf01c26cc5 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); } -- cgit v1.3