]> git.baikalelectronics.ru Git - kernel.git/commit
dma-direct: fix zone selection after an unaddressable CMA allocation
authorChristoph Hellwig <hch@lst.de>
Tue, 20 Aug 2019 02:45:49 +0000 (11:45 +0900)
committerChristoph Hellwig <hch@lst.de>
Tue, 20 Aug 2019 22:14:10 +0000 (07:14 +0900)
commit889978d3804b6be4501cbd4b8118a1a87613f572
tree9ab3713cac2e657fc87fa8108a9dfa2b67f4d439
parentae5413252d8fcfbe4d6cc32f4f3beb83eebdbf48
dma-direct: fix zone selection after an unaddressable CMA allocation

The new dma_alloc_contiguous hides if we allocate CMA or regular
pages, and thus fails to retry a ZONE_NORMAL allocation if the CMA
allocation succeeds but isn't addressable.  That means we either fail
outright or dip into a small zone that might not succeed either.

Thanks to Hillf Danton for debugging this issue.

Fixes: c45133082a28 ("dma-contiguous: add dma_{alloc,free}_contiguous() helpers")
Reported-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
drivers/iommu/dma-iommu.c
include/linux/dma-contiguous.h
kernel/dma/contiguous.c
kernel/dma/direct.c