dma-pool: introduce dma_guess_pool()
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tue, 14 Jul 2020 12:39:27 +0000 (14:39 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 14 Jul 2020 13:42:30 +0000 (15:42 +0200)
commit48b6703858dd5526c82d8ff2dbac59acab3a9dda
treea6a70cedc8e1b8e36e6d663df373d36dccd918da
parent23e469be6239d9cf3d921fc3e38545491df56534
dma-pool: introduce dma_guess_pool()

dma-pool's dev_to_pool() creates the false impression that there is a
way to grantee a mapping between a device's DMA constraints and an
atomic pool. It tuns out it's just a guess, and the device might need to
use an atomic pool containing memory from a 'safer' (or lower) memory
zone.

To help mitigate this, introduce dma_guess_pool() which can be fed a
device's DMA constraints and atomic pools already known to be faulty, in
order for it to provide an better guess on which pool to use.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
kernel/dma/pool.c