Revert r291142.
The not quite consistent logic for bounce pages allocation is utilizited by re(4) interface which can hang now. Approved by: kib (mentor)
This commit is contained in:
parent
3e6deb330e
commit
eae22c4430
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291193
@ -654,8 +654,8 @@ allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t mapp)
|
||||
maxpages = MAX_BPAGES;
|
||||
else
|
||||
maxpages = 2 * bz->map_count;
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 ||
|
||||
(bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
int pages;
|
||||
|
||||
pages = atop(roundup2(dmat->maxsize, PAGE_SIZE)) + 1;
|
||||
|
@ -569,8 +569,8 @@ allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t map)
|
||||
* basis up to a sane limit.
|
||||
*/
|
||||
maxpages = MAX_BPAGES;
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0
|
||||
|| (bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
int pages;
|
||||
|
||||
pages = MAX(atop(dmat->maxsize), 1);
|
||||
|
@ -304,8 +304,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
|
||||
else
|
||||
maxpages = MIN(MAX_BPAGES, Maxmem -
|
||||
atop(dmat->common.lowaddr));
|
||||
if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 ||
|
||||
(bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
pages = MAX(atop(dmat->common.maxsize), 1);
|
||||
pages = MIN(maxpages - bz->total_bpages, pages);
|
||||
pages = MAX(pages, 1);
|
||||
|
@ -560,8 +560,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
|
||||
* basis up to a sane limit.
|
||||
*/
|
||||
maxpages = MAX_BPAGES;
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0
|
||||
|| (bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
int pages;
|
||||
|
||||
pages = MAX(atop(dmat->maxsize), 1);
|
||||
|
@ -423,8 +423,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
|
||||
maxpages = MAX_BPAGES;
|
||||
else
|
||||
maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr));
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0
|
||||
|| (bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
int pages;
|
||||
|
||||
pages = MAX(atop(dmat->maxsize), 1);
|
||||
|
@ -308,8 +308,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
|
||||
else
|
||||
maxpages = MIN(MAX_BPAGES, Maxmem -
|
||||
atop(dmat->common.lowaddr));
|
||||
if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 &&
|
||||
bz->map_count > 0 && bz->total_bpages < maxpages) {
|
||||
if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 ||
|
||||
(bz->map_count > 0 && bz->total_bpages < maxpages)) {
|
||||
pages = MAX(atop(dmat->common.maxsize), 1);
|
||||
pages = MIN(maxpages - bz->total_bpages, pages);
|
||||
pages = MAX(pages, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user