diff options
author | 2018-04-25 11:48:09 -0700 | |
---|---|---|
committer | 2018-04-25 11:48:09 -0700 | |
commit | 26ed24e429d89e045e5eb2d2b75215244347b7f2 (patch) | |
tree | ebceef87144204fb10a6d7fc4ebb7be4718655de /lib | |
parent | Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace (diff) | |
parent | dma-mapping: postpone cpu addr translation on mmap (diff) | |
download | linux-dev-26ed24e429d89e045e5eb2d2b75215244347b7f2.tar.xz linux-dev-26ed24e429d89e045e5eb2d2b75215244347b7f2.zip |
Merge tag 'dma-mapping-4.17-3' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fixes from Christoph Hellwig:
"A few small dma-mapping fixes for Linux 4.17-rc3:
- don't loop to try GFP_DMA allocations if ZONE_DMA is not actually
enabled (regression in 4.16)
- don't try to do virt_to_page before we know we actuall have a valid
page in dma_common_mmap
- a comment fixup related to the above fix"
* tag 'dma-mapping-4.17-3' of git://git.infradead.org/users/hch/dma-mapping:
dma-mapping: postpone cpu addr translation on mmap
dma-coherent: clarify dma_mmap_from_dev_coherent documentation
dma-direct: don't retry allocation for no-op GFP_DMA
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dma-direct.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dma-direct.c b/lib/dma-direct.c index c0bba30fef0a..bbfb229aa067 100644 --- a/lib/dma-direct.c +++ b/lib/dma-direct.c @@ -84,7 +84,8 @@ again: __free_pages(page, page_order); page = NULL; - if (dev->coherent_dma_mask < DMA_BIT_MASK(32) && + if (IS_ENABLED(CONFIG_ZONE_DMA) && + dev->coherent_dma_mask < DMA_BIT_MASK(32) && !(gfp & GFP_DMA)) { gfp = (gfp & ~GFP_DMA32) | GFP_DMA; goto again; |