linux/kernel/dma
Geert Uytterhoeven 3ee06a6d53 dma-pool: fix too large DMA pools on medium memory size systems
On systems with at least 32 MiB, but less than 32 GiB of RAM, the DMA
memory pools are much larger than intended (e.g. 2 MiB instead of 128
KiB on a 256 MiB system).

Fix this by correcting the calculation of the number of GiBs of RAM in
the system.  Invert the order of the min/max operations, to keep on
calculating in pages until the last step, which aids readability.

Fixes: 1d659236fb ("dma-pool: scale the default DMA coherent pool size with memory capacity")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-06-09 15:25:52 +02:00
..
coherent.c dma-coherent: fix integer overflow in the reserved-memory dma allocation 2020-03-16 10:43:02 +01:00
contiguous.c dma-contiguous: fix comment for dma_release_from_contiguous 2020-04-25 13:17:06 +02:00
debug.c dma-debug: make __dma_entry_alloc_check_leak() static 2020-04-20 12:05:18 +02:00
direct.c dma-direct: atomic allocations must come from atomic coherent pools 2020-04-25 13:17:05 +02:00
dummy.c dma-mapping: factor out dummy DMA ops 2018-12-13 21:06:12 +01:00
Kconfig dma-remap: separate DMA atomic pools from direct remap code 2020-04-20 12:08:45 +02:00
Makefile dma-remap: separate DMA atomic pools from direct remap code 2020-04-20 12:08:45 +02:00
mapping.c dma-mapping: Fix dma_pgprot() for unencrypted coherent pages 2020-03-17 11:52:58 +01:00
pool.c dma-pool: fix too large DMA pools on medium memory size systems 2020-06-09 15:25:52 +02:00
remap.c dma-mapping updates for 5.8, part 1 2020-06-06 11:43:23 -07:00
swiotlb.c dma-direct: improve swiotlb error reporting 2020-02-05 18:53:05 +01:00
virt.c dma-mapping: zero memory returned from dma_alloc_* 2018-12-20 08:13:52 +01:00