diff options
| author | Yili Zhang <zhangyili01@baidu.com> | 2026-09-24 14:55:08 +0800 |
|---|---|---|
| committer | Christian König <christian.koenig@amd.com> | 2026-10-20 13:44:35 +0200 |
| commit | d57e3a7d880d783c64aa29457d78b0e3c5a40e3c (patch) | |
| tree | 6180f7ed9363df5471d775f5eeb02aaff1b33c55 /include/linux/debugobjects.h | |
| parent | cb104d395da48d965665fefe8502f71b6e7e3733 (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
