diff options
author | jhb <jhb@FreeBSD.org> | 2007-11-27 17:28:12 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-11-27 17:28:12 +0000 |
commit | 7fe785218b409a5fce43a2ca79739e1599c71591 (patch) | |
tree | f0985e5ee1a2bfe1965388e2711189e15071b712 /sys/arm | |
parent | a32c67c9ab76d6bb3fb57b85250e614484fcd907 (diff) | |
download | FreeBSD-src-7fe785218b409a5fce43a2ca79739e1599c71591.zip FreeBSD-src-7fe785218b409a5fce43a2ca79739e1599c71591.tar.gz |
Remove the 'needbounce' variable from the _bus_dmamap_load_buffer()
routine. It is not needed as the existing tests for segment coalescing
already handle bounced addresses and it prevents legal segment coalescing
in certain edge cases.
MFC after: 1 week
Reviewed by: scottl
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/busdma_machdep.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 2044e2a..6c8195b 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -664,12 +664,11 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) static int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, int flags, int *nb) + bus_size_t buflen, int flags) { vm_offset_t vaddr; vm_offset_t vendaddr; bus_addr_t paddr; - int needbounce = *nb; if ((map->pagesneeded == 0)) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " @@ -687,10 +686,8 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, while (vaddr < vendaddr) { paddr = pmap_kextract(vaddr); if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - run_filter(dmat, paddr) != 0) { - needbounce = 1; + run_filter(dmat, paddr) != 0) map->pagesneeded++; - } vaddr += PAGE_SIZE; } CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); @@ -716,7 +713,6 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, mtx_unlock(&bounce_lock); } - *nb = needbounce; return (0); } @@ -739,14 +735,12 @@ bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs, pd_entry_t *pde; pt_entry_t pte; pt_entry_t *ptep; - int needbounce = 0; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { - error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags, - &needbounce); + error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags); if (error) return (error); } @@ -840,7 +834,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs, * Insert chunk into a segment, coalescing with * the previous segment if possible. */ - if (needbounce == 0 && seg >= 0 && curaddr == lastaddr && + if (seg >= 0 && curaddr == lastaddr && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && (dmat->boundary == 0 || (segs[seg].ds_addr & bmask) == |