Re: [PATCH] drm/msm/dsi: avoid pinning the command buffer on every transfer
From: Dmitry Baryshkov
Date: Wed Nov 11 2026 - 11:06:05 EST
On Mon, Nov 09, 2026 at 12:32:05PM +0000, Michael McAllister wrote:
> The command buffer is already pinned by msm_gem_kernel_new() when it is
> allocated. Calling msm_gem_get_and_pin_iova() to fetch its DMA address
> adds another pin for each transfer, while teardown only drops the
> allocation's lifetime pin. This leaves outstanding pins on the buffer.
>
> Use msm_gem_get_iova() to retrieve the address without taking another
> pin. The allocation's existing pin keeps the mapping valid until
> msm_gem_kernel_put() releases the buffer.
>
> Fixes: 7ad0e8cf6317 ("drm/msm: Count how many times iova memory is pinned")
> Signed-off-by: Michael McAllister <me@xxxxxxxxxxxxxxxxxxxxx>
> ---
> Hi,
>
> I ran into this while testing display teardown on the Moto G10. The DSI
> command buffer is already pinned for its lifetime, so this avoids taking
> another pin every time we fetch its DMA address.
>
> I tested this as part of the G10 display fixes on 7.2.9, including display
> power cycling, suspend/resume and teardown with the compositor stopped.
Sashiko reports a double-free and I think I'd tend to believe it.
--
With best wishes
Dmitry