From: Johan Hovold <johan@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Johan Hovold <johan+linaro@kernel.org>,
Rob Clark <robdclark@gmail.com>,
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>,
David Airlie <airlied@linux.ie>, 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>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
freedreno <freedreno@lists.freedesktop.org>,
LKML <linux-kernel@vger.kernel.org>,
"# 4.0+" <stable@vger.kernel.org>
Subject: Re: [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime
Date: Tue, 13 Sep 2022 09:18:17 +0200 [thread overview]
Message-ID: <YyAuuTlDoLAntrO6@hovoldconsulting.com> (raw)
In-Reply-To: <CAD=FV=U8_bjPm3NEOWqzehrx0xFV4U771nTuhhOiM9gKDVCo5g@mail.gmail.com>
On Tue, Sep 13, 2022 at 07:35:15AM +0100, Doug Anderson wrote:
> Hi,
>
> On Mon, Sep 12, 2022 at 7:10 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > On 12/09/2022 18:40, Johan Hovold wrote:
> > > 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 amending the DP aux interface and tying the lifetime of the
> > > EP device to the DRM device rather than DP controller platform device.
> >
> > Doug, could you please take a look?
> >
> > For me this is another reminder/pressure point that we should populate
> > the AUX BUS from the probe(), before binding the components together.
>
> Aside from the kernel robot complaints, I'm not necessarily convinced.
> I think we know that the AUX DP stuff in MSM-DP is fragile right now
> and Qualcomm has promised to clean it up. This really feels like a
> band-aid and is really a sign that we're populating the AUX DP bus in
> the wrong place in Qualcomm's code. As you said, if we moved this to
> probe(), which is the plan in the promised cleanup, then it wouldn't
> be a problem.
Right, but that appears to be non-trivial judging from the discussions
you had back when the offending patch was merged:
https://lore.kernel.org/lkml/CAD=FV=X+QvjwoT2zGP82KW4kD0oMUY6ZgCizSikNX_Uj8dNDqA@mail.gmail.com/t/#u
> As far as I know Qualcomm has queued this cleanup behind their current
> PSR work (though it's never been clear why both can't be worked on at
> the same time) and the PSR work was stalled because they couldn't
> figure out what caused the glitching I reported. It's still on my nag
> list that I bring up with them every week...
>
> In any case, if a band-aid is urgent, maybe you could just call
> of_dp_aux_populate_bus() directly in Qualcomm code and you could add
> your own devm_add_action_or_reset() on the DRM device.
Yeah, that's probably better. I apparently missed a bunch of users of
devm_of_dp_aux_populate_ep_devices() after searching for
devm_of_dp_aux_populate_bus() instead. Judging from a quick glance all
of these populate the bus at probe, so Qualcomm indeed appears to be
the odd bird here.
But the bug is real, in mainline and needs to be fixed, so rolling a
custom devm action indeed should to be the right thing to do here (if
only to have a smaller fix).
Johan
next prev parent reply other threads:[~2022-09-13 7:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220912154046.12900-1-johan+linaro@kernel.org>
2022-09-12 15:40 ` [PATCH 1/7] drm/msm: fix use-after-free on probe deferral Johan Hovold
2022-09-12 17:52 ` Dmitry Baryshkov
2022-09-13 7:31 ` Johan Hovold
2022-09-12 15:40 ` [PATCH 2/7] drm/msm: fix memory corruption with too many bridges Johan Hovold
2022-09-12 17:55 ` Dmitry Baryshkov
2022-09-13 7:49 ` Johan Hovold
2022-09-12 15:40 ` [PATCH 3/7] drm/msm/dp: fix IRQ lifetime Johan Hovold
2022-09-12 18:06 ` Dmitry Baryshkov
2022-09-12 15:40 ` [PATCH 4/7] drm/msm/dp: fix aux-bus EP lifetime Johan Hovold
2022-09-12 18:10 ` Dmitry Baryshkov
2022-09-12 21:55 ` Steev Klimaszewski
2022-09-13 7:20 ` Johan Hovold
2022-09-13 6:35 ` Doug Anderson
2022-09-13 7:18 ` Johan Hovold [this message]
2022-09-13 1:51 ` kernel test robot
2022-09-12 15:40 ` [PATCH 5/7] drm/msm/dp: fix bridge lifetime Johan Hovold
2022-09-12 18:11 ` Dmitry Baryshkov
2022-09-12 15:40 ` [PATCH 6/7] drm/msm/hdmi: fix IRQ lifetime Johan Hovold
2022-09-12 17:59 ` Dmitry Baryshkov
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=YyAuuTlDoLAntrO6@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--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=johan+linaro@kernel.org \
--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=robdclark@gmail.com \
--cc=robert.foss@linaro.org \
--cc=sean@poorly.run \
--cc=stable@vger.kernel.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