diff options
author | yongari <yongari@FreeBSD.org> | 2007-05-29 06:30:26 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2007-05-29 06:30:26 +0000 |
commit | f53195d29a8fff7695e0e7ba6e882a43ec827056 (patch) | |
tree | 334f9ee040f34f0db530b0d463e04521ea658fb8 /sys/arm | |
parent | cfa8629c4850a5bd7d8ca034dd43c16a6e542ab2 (diff) | |
download | FreeBSD-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.c | 2 |
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; |