From: Johan Hovold <johan@kernel.org>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: freedreno@lists.freedesktop.org, Rob Clark <robdclark@gmail.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Kuogee Hsieh <quic_khsieh@quicinc.com>,
dri-devel@lists.freedesktop.org, swboyd@chromium.org,
quic_jesszhan@quicinc.com, quic_parellan@quicinc.com,
quic_bjorande@quicinc.com, Rob Clark <robdclark@chromium.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/dp: move link_ready out of HPD event thread
Date: Thu, 14 Mar 2024 16:38:56 +0100 [thread overview]
Message-ID: <ZfMaEIzv3Z3ny3y0@hovoldconsulting.com> (raw)
In-Reply-To: <ec2cba17-5644-6cf6-f6c9-d37d7ca56204@quicinc.com>
On Wed, Mar 13, 2024 at 10:24:08AM -0700, Abhinav Kumar wrote:
> On 3/13/2024 1:18 AM, Johan Hovold wrote:
> > Right, but your proposed fix would not actually fix anything and judging
> > from the sparse commit message and diff itself it is clearly only meant
> > to mitigate the case where user space is involved, which is *not* the
> > case here.
> There can be a race condition between the time the DP driver gets the
> hpd disconnect event and when the hpd thread processes that event
> allowing the commit to sneak in. This is something which has always been
> there even without pm_runtime series and remains even today.
>
> In this race condition, the setting of "link_ready" to false can be a
> bit delayed if we go through the HPD event processing increasing the
> race condition window.
>
> If link_ready is false, atomic_check() fails, thereby failing any
> commits and hence not allowing the atomic_disable() / atomic_enable()
> cycle and hence avoiding this reset.
>
> The patch is moving the setting of link_ready to false earlier by not
> putting it through the HPD event thread and hence trying to reduce the
> window of the issue.
Perhaps I'm missing something in the race that you are trying to
describe (and which I've asked you to describe in more detail so that I
don't have to spend more time trying to come up with a reproducer
myself).
I do understand how your patch works, but my point is that it does
not fix the race that we are hitting on sc8280xp and, unless I'm missing
something, it is not even sufficient to fix the race you are talking
about as user space can still trigger that ioctl() before you clear the
link_ready flag.
That's why I said that it is only papering over the issue by making the
race window smaller (and this should also be highlighted in the commit
message).
For some reason it also made things worse on sc8280xp, but I did not
spend time on tracking down exactly why.
Johan
next prev parent reply other threads:[~2024-03-14 15:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 21:45 [PATCH] drm/msm/dp: move link_ready out of HPD event thread Abhinav Kumar
2024-03-11 17:57 ` Kuogee Hsieh
2024-03-12 10:09 ` Johan Hovold
2024-03-12 16:41 ` Johan Hovold
2024-03-12 16:59 ` Johan Hovold
2024-03-12 17:39 ` Abhinav Kumar
2024-03-13 8:18 ` Johan Hovold
2024-03-13 17:24 ` Abhinav Kumar
2024-03-14 15:38 ` Johan Hovold [this message]
2024-03-14 16:30 ` Abhinav Kumar
2024-03-15 15:57 ` Johan Hovold
2024-03-18 18:01 ` Abhinav Kumar
2024-03-21 16:41 ` 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=ZfMaEIzv3Z3ny3y0@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_bjorande@quicinc.com \
--cc=quic_jesszhan@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=quic_parellan@quicinc.com \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--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