From: Johan Hovold <johan+linaro@kernel.org>
To: Douglas Anderson <dianders@chromium.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <robert.foss@linaro.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>, Sean Paul <sean@poorly.run>,
Stephen Boyd <swboyd@chromium.org>,
Bjorn Andersson <andersson@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Kuogee Hsieh <quic_khsieh@quicinc.com>,
Steev Klimaszewski <steev@kali.org>,
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>,
stable@vger.kernel.org
Subject: [PATCH v2 06/10] drm/msm/dp: fix aux-bus EP lifetime
Date: Tue, 13 Sep 2022 10:53:16 +0200 [thread overview]
Message-ID: <20220913085320.8577-7-johan+linaro@kernel.org> (raw)
In-Reply-To: <20220913085320.8577-1-johan+linaro@kernel.org>
Device-managed resources allocated post component bind must be tied to
the lifetime of the aggregate DRM device or they will not necessarily be
released when binding of the aggregate device is deferred.
This can lead resource leaks or failure to bind the aggregate device
when binding is later retried and a second attempt to allocate the
resources is made.
For the DP aux-bus, an attempt to populate the bus a second time will
simply fail ("DP AUX EP device already populated").
Fix this by tying the lifetime of the EP device to the DRM device rather
than DP controller platform device.
Fixes: c3bf8e21b38a ("drm/msm/dp: Add eDP support via aux_bus")
Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/gpu/drm/msm/dp/dp_display.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index ba557328710a..4b0a2d4bb61e 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1535,6 +1535,11 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor)
}
}
+static void of_dp_aux_depopulate_bus_void(void *data)
+{
+ of_dp_aux_depopulate_bus(data);
+}
+
static int dp_display_get_next_bridge(struct msm_dp *dp)
{
int rc;
@@ -1559,10 +1564,16 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
* panel driver is probed asynchronously but is the best we
* can do without a bigger driver reorganization.
*/
- rc = devm_of_dp_aux_populate_ep_devices(dp_priv->aux);
+ rc = of_dp_aux_populate_bus(dp_priv->aux, NULL);
of_node_put(aux_bus);
if (rc)
goto error;
+
+ rc = devm_add_action_or_reset(dp->drm_dev->dev,
+ of_dp_aux_depopulate_bus_void,
+ dp_priv->aux);
+ if (rc)
+ goto error;
} else if (dp->is_edp) {
DRM_ERROR("eDP aux_bus not found\n");
return -ENODEV;
--
2.35.1
next prev parent reply other threads:[~2022-09-13 8:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220913085320.8577-1-johan+linaro@kernel.org>
2022-09-13 8:53 ` [PATCH v2 01/10] drm/msm: fix use-after-free on probe deferral Johan Hovold
2022-09-22 19:48 ` [Freedreno] " Kuogee Hsieh
2022-09-22 20:01 ` Kuogee Hsieh
2022-09-13 8:53 ` [PATCH v2 02/10] drm/msm/dp: fix memory corruption with too many bridges Johan Hovold
2022-09-22 19:51 ` [Freedreno] " Kuogee Hsieh
2022-09-22 19:54 ` Dmitry Baryshkov
2022-09-13 8:53 ` [PATCH v2 03/10] drm/msm/dsi: " Johan Hovold
2022-09-22 19:51 ` Kuogee Hsieh
2022-09-22 19:54 ` Dmitry Baryshkov
2022-09-13 8:53 ` [PATCH v2 04/10] drm/msm/hdmi: " Johan Hovold
2022-09-22 19:52 ` [Freedreno] " Kuogee Hsieh
2022-09-22 19:54 ` Dmitry Baryshkov
2022-09-13 8:53 ` [PATCH v2 05/10] drm/msm/dp: fix IRQ lifetime Johan Hovold
2022-09-22 19:54 ` [Freedreno] " Kuogee Hsieh
2022-09-13 8:53 ` Johan Hovold [this message]
2022-09-13 12:36 ` [PATCH v2 06/10] drm/msm/dp: fix aux-bus EP lifetime Doug Anderson
2022-09-13 8:53 ` [PATCH v2 07/10] drm/msm/dp: fix bridge lifetime Johan Hovold
2022-09-22 19:56 ` [Freedreno] " Kuogee Hsieh
2022-09-13 8:53 ` [PATCH v2 08/10] drm/msm/hdmi: fix IRQ lifetime Johan Hovold
2022-09-22 19:55 ` Kuogee Hsieh
2022-09-23 6:17 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220913085320.8577-7-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=andersson@kernel.org \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=robdclark@gmail.com \
--cc=robert.foss@linaro.org \
--cc=sean@poorly.run \
--cc=stable@vger.kernel.org \
--cc=steev@kali.org \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox