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
This commit is contained in:
parent
95f0e983b6
commit
590f73f72e
@ -649,6 +649,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
* 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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -674,6 +674,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
* 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;
|
||||
|
||||
|
@ -578,6 +578,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
* 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;
|
||||
|
||||
|
@ -372,6 +372,8 @@ _nexus_dmamap_load_buffer(bus_dma_tag_t dmat, void *buf, bus_size_t buflen,
|
||||
* Compute the segment size, and adjust counts.
|
||||
*/
|
||||
sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
|
||||
if (sgsize > dmat->dt_maxsegsz)
|
||||
sgsize = dmat->dt_maxsegsz;
|
||||
if (buflen < sgsize)
|
||||
sgsize = buflen;
|
||||
|
||||
|
@ -381,6 +381,8 @@ _nexus_dmamap_load_buffer(bus_dma_tag_t dmat, void *buf, bus_size_t buflen,
|
||||
* Compute the segment size, and adjust counts.
|
||||
*/
|
||||
sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
|
||||
if (sgsize > dmat->dt_maxsegsz)
|
||||
sgsize = dmat->dt_maxsegsz;
|
||||
if (buflen < sgsize)
|
||||
sgsize = buflen;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user