Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panthor: Improve IOMMU map/unmap debugging logs

Log the number of pages and their sizes actually mapped/unmapped by
the IOMMU page table driver. Since a map/unmap op is often split in
several ops depending on the underlying scatter/gather table, add the
start address and the total size to the debugging logs in order to
help understand which batch an op is part of.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251114170303.2800-10-loic.molinari@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

authored by

Loïc Molinari and committed by
Boris Brezillon
e20c6260 ab349049

+14 -5
+14 -5
drivers/gpu/drm/panthor/panthor_mmu.c
··· 918 918 { 919 919 struct panthor_device *ptdev = vm->ptdev; 920 920 struct io_pgtable_ops *ops = vm->pgtbl_ops; 921 + u64 start_iova = iova; 921 922 u64 offset = 0; 922 - 923 - drm_dbg(&ptdev->base, "unmap: as=%d, iova=%llx, len=%llx", vm->as.id, iova, size); 924 923 925 924 while (offset < size) { 926 925 size_t unmapped_sz = 0, pgcount; ··· 935 936 panthor_vm_flush_range(vm, iova, offset + unmapped_sz); 936 937 return -EINVAL; 937 938 } 939 + 940 + drm_dbg(&ptdev->base, 941 + "unmap: as=%d, iova=0x%llx, sz=%llu, va=0x%llx, pgcnt=%zu, pgsz=%zu", 942 + vm->as.id, start_iova, size, iova + offset, 943 + unmapped_sz / pgsize, pgsize); 944 + 938 945 offset += unmapped_sz; 939 946 } 940 947 ··· 956 951 struct scatterlist *sgl; 957 952 struct io_pgtable_ops *ops = vm->pgtbl_ops; 958 953 u64 start_iova = iova; 954 + u64 start_size = size; 959 955 int ret; 960 956 961 957 if (!size) ··· 976 970 len = min_t(size_t, len, size); 977 971 size -= len; 978 972 979 - drm_dbg(&ptdev->base, "map: as=%d, iova=%llx, paddr=%pad, len=%zx", 980 - vm->as.id, iova, &paddr, len); 981 - 982 973 while (len) { 983 974 size_t pgcount, mapped = 0; 984 975 size_t pgsize = get_pgsize(iova | paddr, len, &pgcount); 985 976 986 977 ret = ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, 987 978 GFP_KERNEL, &mapped); 979 + 980 + drm_dbg(&ptdev->base, 981 + "map: as=%d, iova=0x%llx, sz=%llu, va=0x%llx, pa=%pad, pgcnt=%zu, pgsz=%zu", 982 + vm->as.id, start_iova, start_size, iova, &paddr, 983 + mapped / pgsize, pgsize); 984 + 988 985 iova += mapped; 989 986 paddr += mapped; 990 987 len -= mapped;