summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2007-05-29 06:30:26 +0000
committeryongari <yongari@FreeBSD.org>2007-05-29 06:30:26 +0000
commitf53195d29a8fff7695e0e7ba6e882a43ec827056 (patch)
tree334f9ee040f34f0db530b0d463e04521ea658fb8 /sys/arm
parentcfa8629c4850a5bd7d8ca034dd43c16a6e542ab2 (diff)
downloadFreeBSD-src-f53195d29a8fff7695e0e7ba6e882a43ec827056.zip
FreeBSD-src-f53195d29a8fff7695e0e7ba6e882a43ec827056.tar.gz
Honor maxsegsz of less than a page size in a DMA tag. Previously it
used to return PAGE_SIZE without respect to restrictions of a DMA tag. This affected all of the busdma load functions that use _bus_dmamap_loader_buffer() as their back-end. Reviewed by: scottl
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/busdma_machdep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
index f8d2725..b3ee458 100644
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -799,6 +799,8 @@ bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
* Compute the segment size, and adjust counts.
*/
sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
+ if (sgsize > dmat->maxsegsz)
+ sgsize = dmat->maxsegsz;
if (buflen < sgsize)
sgsize = buflen;
OpenPOWER on IntegriCloud