Re: [PATCH v3 5/6] drm/msm: Convert map helper to use dma-address

From: Rob Clark

Date: Thu Oct 29 2026 - 17:28:14 EST


On Tue, Oct 27, 2026 at 6:14 PM Dmitry Baryshkov
<dmitry.baryshkov@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Oct 27, 2026 at 04:04:48PM -0700, Rob Clark wrote:
> > Now that we have everything unified in one path, switch over to using
> > dma addresses for setting up the mapping. This avoids issues with
> > CONFIG_DMABUF_DEBUG stripping the pages from the sgt.
> >
> > Tested-by: Jianfeng Liu <liujianfeng1994@xxxxxxxxx> # x1e78100 (Acer SFA14-11), v7.3-rc5 + this series, CONFIG_DMABUF_DEBUG=y
> > Signed-off-by: Rob Clark <robin.clark@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/gpu/drm/msm/msm_iommu.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
> This commit seems to break GPU on db410c (which uses qcom_iommu).

In theory, this should help for qcom_iommu and msm_iommu, but untested:

https://lore.kernel.org/all/20261029212344.346069-1-robin.clark@xxxxxxxxxxxxxxxx/

Not sure if there would be further issues on devices with bootloader
splash? It would probably be ok for DSI cmd mode panels which aren't
actively TX'ing to panel, but otherwise idk.

BR,
-R

>
> [ 104.954564] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for GPU
> to idle!
> [ 104.954932] msm_mdp 1a01000.display-controller: [drm:adreno_load_gpu]
> *ERROR* gpu hw init failed: -22
> [ 105.958559] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for GPU
> to idle!
> [ 109.082571] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for GPU
> to idle!
> [ 109.082670] msm_mdp 1a01000.display-controller: [drm:adreno_load_gpu]
> *ERROR* gpu hw init failed: -22
> [ 110.086572] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for GPU
> to idle!
> [ 111.098576] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for GPU
> to idle!
> [ 111.098674] msm_mdp 1a01000.display-controller: [drm:adreno_load_gpu]
> *ERROR* gpu hw init failed: -22
> c[ 112.102576] [drm:a3xx_idle] *ERROR* 03000600: timeout waiting for
> GPU to idle!
> >
> > diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
> > index 479e5450a4dc..c2950d32c507 100644
> > --- a/drivers/gpu/drm/msm/msm_iommu.c
> > +++ b/drivers/gpu/drm/msm/msm_iommu.c
> > @@ -153,9 +153,9 @@ __do_map(unsigned long pgsize_bitmap, u64 iova, struct sg_table *sgt, size_t off
> > u64 addr = iova;
> > unsigned int i;
> >
> > - for_each_sgtable_sg (sgt, sg, i) {
> > - size_t size = sg->length;
> > - phys_addr_t phys = sg_phys(sg);
> > + for_each_sgtable_dma_sg (sgt, sg, i) {
> > + size_t size = sg_dma_len(sg);
> > + phys_addr_t phys = sg_dma_address(sg);
> >
> > if (!len)
> > break;
> > --
> > 2.56.0
> >
>
> --
> With best wishes
> Dmitry