diff options
author | Pyun YongHyeon <yongari@FreeBSD.org> | 2007-06-22 03:54:53 +0000 |
---|---|---|
committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2007-06-22 03:54:53 +0000 |
commit | 485aebfc80640ba578a9184c722389623e0798fb (patch) | |
tree | 1b24829e87506972dc552f0304f038561ccccadc /sys/powerpc | |
parent | 00a304487f0d8b8f679ff8cb2007c26ec5c97b39 (diff) | |
download | src-485aebfc80640ba578a9184c722389623e0798fb.tar.gz src-485aebfc80640ba578a9184c722389623e0798fb.zip |
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 (long a ago)
Approved by: re (hrs)
Notes
Notes:
svn path=/head/; revision=170978
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/powerpc/busdma_machdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c index 802b2105b546..ba27713a7008 100644 --- a/sys/powerpc/powerpc/busdma_machdep.c +++ b/sys/powerpc/powerpc/busdma_machdep.c @@ -418,6 +418,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; |