diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-10-12 04:29:09 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2023-10-16 07:27:33 -0700 |
commit | 5e05be78264594634860087953649487f486ffcc (patch) | |
tree | 665abc8fe23df1dad35359622a1a166d534dd77a /drivers/gpu/drm/msm/dsi/dsi.c | |
parent | 69b321b2c3df4f7e51a9de587e41f324b0b717b0 (diff) | |
download | linux-5e05be78264594634860087953649487f486ffcc.tar.gz linux-5e05be78264594634860087953649487f486ffcc.tar.bz2 linux-5e05be78264594634860087953649487f486ffcc.zip |
drm/msm/dsi: free TX buffer in unbind
If the drm/msm init code gets an error during output modeset
initialisation, the kernel will report an error regarding DRM memory
manager not being clean during shutdown. This is because
msm_dsi_modeset_init() allocates a piece of GEM memory for the TX
buffer, but destruction of the buffer happens only at
msm_dsi_host_destroy(), which is called during DSI driver's remove()
time, much later than the DRM MM shutdown.
To solve this issue, move the TX buffer destruction to dsi_unbind(), so
that the buffer is destructed at the correct time. Note, we also have to
store a reference to the address space, because priv->kms->aspace is
cleared before components are unbound.
Reported-by: Bjorn Andersson <andersson@kernel.org>
Fixes: 8f59ee9a570c ("drm/msm/dsi: Adjust probe order")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/562238/
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dsi/dsi.c')
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index e3ff18edbbce..6e9d0f80bceb 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -131,6 +131,7 @@ static void dsi_unbind(struct device *dev, struct device *master, struct msm_drm_private *priv = dev_get_drvdata(master); struct msm_dsi *msm_dsi = dev_get_drvdata(dev); + msm_dsi_tx_buf_free(msm_dsi->host); priv->dsi[msm_dsi->id] = NULL; } |