dma: swiotlb: use KiB in restricted pool allocation log

Update the allocation logs for restricted memory pools to use KiBs
instead of MiBs, to avoid truncation when the size of the memory area is
not a multiple of a MiB.

Without this modification, pools smaller than 1MiB are logged as 0MiB.

The same modification has already been performed for coherent memory
pools [1].

Link: https://lore.kernel.org/all/20260629223759.2637162-1-sharaienko@google.com/ [1]
Signed-off-by: Francesco Valla <francesco@valla.it>
Link: https://lore.kernel.org/r/20261008-swiotlb-size-print-v1-1-374493b5c5a6@valla.it
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
This commit is contained in:
Francesco Valla 2026-10-08 00:05:21 +02:00 committed by Marek Szyprowski
parent 5e3bc6b44c
commit 0875ed8eea

View File

@ -2083,8 +2083,8 @@ static int __init rmem_swiotlb_setup(unsigned long node,
of_get_flat_dt_prop(node, "no-map", NULL))
return -EINVAL;
pr_info("Reserved memory: created restricted DMA pool at %pa, size %ld MiB\n",
&rmem->base, (unsigned long)rmem->size / SZ_1M);
pr_info("Reserved memory: created restricted DMA pool at %pa, size %llu KiB\n",
&rmem->base, (unsigned long long)(rmem->size / SZ_1K));
return 0;
}