summaryrefslogtreecommitdiff
path: root/include/linux/debugobjects.h
diff options
context:
space:
mode:
authorYili Zhang <zhangyili01@baidu.com>2026-09-24 14:55:08 +0800
committerChristian König <christian.koenig@amd.com>2026-10-20 13:44:35 +0200
commitd57e3a7d880d783c64aa29457d78b0e3c5a40e3c (patch)
tree6180f7ed9363df5471d775f5eeb02aaff1b33c55 /include/linux/debugobjects.h
parentcb104d395da48d965665fefe8502f71b6e7e3733 (diff)
dma-buf: Fix IOVA offset when linking phys vecs to sgt
The dma_buf_phys_vec_to_sgt() routine links every physical range into the allocated IOVA space at offset zero instead of advancing the offset by the already mapped length. This breaks the THRU_HOST_BRIDGE flow whenever phys_vec contains more than one entry: the second and subsequent dma_iova_link() calls try to install mappings on top of PTEs that already exist, which fails and makes the whole conversion return an error. Fix it by passing the accumulated mapped_len as the IOVA offset. This matches the pattern used by all other dma_iova_link() callers and is consistent with the rest of the function: dma_iova_sync() and the error path in dma_iova_destroy() both operate on the [0, mapped_len) prefix of the IOVA space, which assumes that the ranges were linked contiguously starting at offset 0. Fixes: 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine") Cc: stable@vger.kernel.org Signed-off-by: Yili Zhang <zhangyili01@baidu.com> Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com> Reviewed-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/r/20260924065508.27245-1-zhangyili01@baidu.com Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions