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)
This commit is contained in:
parent
00a304487f
commit
485aebfc80
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user