mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dma: swiotlb: use KiB in restricted pool allocation log
@ 2026-10-07 22:05 ` Francesco Valla
  2026-10-08 10:08   ` Marek Szyprowski
  0 siblings, 1 reply; 2+ messages in thread
From: Francesco Valla @ 2026-10-07 22:05 UTC (permalink / raw)
  To: Marek Szyprowski, Robin Murphy; +Cc: iommu, linux-kernel, Francesco Valla

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>
---
 kernel/dma/swiotlb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index aa2f1c4588b9..3bfab8142f5b 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -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;
 }
 

---
base-commit: 7b63ef2d55f24519e7e9e5f4d15dbea03f126e40
change-id: 20261007-swiotlb-size-print-99d2b2f55bc2

Best regards,
--  
Francesco Valla <francesco@valla.it>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dma: swiotlb: use KiB in restricted pool allocation log
  2026-10-07 22:05 ` [PATCH] dma: swiotlb: use KiB in restricted pool allocation log Francesco Valla
@ 2026-10-08 10:08   ` Marek Szyprowski
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Szyprowski @ 2026-10-08 10:08 UTC (permalink / raw)
  To: Francesco Valla, Robin Murphy; +Cc: iommu, linux-kernel

On 08.10.2026 00:05, Francesco Valla wrote:
> 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>

Applied to dma-mapping-for-next. Thanks!

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-08 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20261007220543eucas1p19170ec07885046129718b630c71ab9cb@eucas1p1.samsung.com>
2026-10-07 22:05 ` [PATCH] dma: swiotlb: use KiB in restricted pool allocation log Francesco Valla
2026-10-08 10:08   ` Marek Szyprowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®