]> git.baikalelectronics.ru Git - kernel.git/commit
dma-direct: try reallocation with GFP_DMA32 if possible
authorTakashi Iwai <tiwai@suse.de>
Mon, 16 Apr 2018 15:18:19 +0000 (17:18 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 7 May 2018 05:15:41 +0000 (07:15 +0200)
commit69bdb20dd64ca0e3a6945868ea2f6df3766dccfe
tree6789422bd7d69dd961c553d0be990d22dd91400f
parent65c47ae1d8fd3c89c208bd687cfbd0666e296670
dma-direct: try reallocation with GFP_DMA32 if possible

As the recent swiotlb bug revealed, we seem to have given up the direct
DMA allocation too early and felt back to swiotlb allocation.  The reason
is that swiotlb allocator expected that dma_direct_alloc() would try
harder to get pages even below 64bit DMA mask with GFP_DMA32, but the
function doesn't do that but only deals with GFP_DMA case.

This patch adds a similar fallback reallocation with GFP_DMA32 as we've
done with GFP_DMA.  The condition is that the coherent mask is smaller
than 64bit (i.e. some address limitation), and neither GFP_DMA nor
GFP_DMA32 is set beforehand.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
lib/dma-direct.c