From: Kuogee Hsieh <quic_khsieh@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <robdclark@gmail.com>, <sean@poorly.run>, <swboyd@chromium.org>,
<dianders@chromium.org>, <vkoul@kernel.org>, <daniel@ffwll.ch>,
<airlied@gmail.com>, <agross@kernel.org>, <andersson@kernel.org>,
<quic_abhinavk@quicinc.com>, <quic_sbillaka@quicinc.com>,
<freedreno@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] drm/msm/dp: check core_initialized flag at both host_init() and host_deinit()
Date: Wed, 1 Mar 2023 08:57:28 -0800 [thread overview]
Message-ID: <38bf75b4-799a-9758-aae3-69a7e0fc3f58@quicinc.com> (raw)
In-Reply-To: <CAA8EJpquZAhn+HswNxardN1fE8Zu1CKrCU5EiX=B8mGWuxfWnQ@mail.gmail.com>
On 2/28/2023 6:16 PM, Dmitry Baryshkov wrote:
> On Wed, 1 Mar 2023 at 02:17, Kuogee Hsieh <quic_khsieh@quicinc.com> wrote:
>> There is a reboot/suspend test case where system suspend is forced
>> during system booting up. Since dp_display_host_init() of external
>> DP is executed at hpd thread context, this test case may created a
>> scenario that dp_display_host_deinit() from pm_suspend() run before
>> dp_display_host_init() if hpd thread has no chance to run during
>> booting up while suspend request command was issued. At this scenario
>> system will crash at aux register access at dp_display_host_deinit()
>> since aux clock had not yet been enabled by dp_display_host_init().
>> Therefore we have to ensure aux clock enabled by checking
>> core_initialized flag before access aux registers at pm_suspend.
> Can a call to dp_display_host_init() be moved from
> dp_display_config_hpd() to dp_display_bind()?
yes, Sankeerth's "drm/msm/dp: enable pm_runtime support for dp driver"
patch is doing that which is under review.
https://patchwork.freedesktop.org/patch/523879/?series=114297&rev=1
>
> Related question: what is the primary reason for having
> EV_HPD_INIT_SETUP and calling dp_display_config_hpd() via the event
> thread? Does DP driver really depend on DPU irqs being installed? As
> far as I understand, DP device uses MDSS interrupts and those IRQs are
> available and working at the time of dp_display_probe() /
> dp_display_bind().
HDP gpio pin has to run through DP aux module 100ms denouncing logic and
have its mask bits.
Therefore DP irq has to be enabled to receive DP isr with mask bits set.
Similar mechanism is used for mdp, dsi, etc.
>> Changes in v2:
>> -- at commit text, dp_display_host_init() instead of host_init()
>> -- at commit text, dp_display_host_deinit() instead of host_deinit()
>>
>> Changes in v3:
>> -- re arrange to avoid commit text line over 75 chars
>>
>> Fixes: 989ebe7bc446 ("drm/msm/dp: do not initialize phy until plugin interrupt received")
>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>> ---
>> drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++--------
>> 1 file changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
>> index bde1a7c..1850738 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>> @@ -460,10 +460,12 @@ static void dp_display_host_init(struct dp_display_private *dp)
>> dp->dp_display.connector_type, dp->core_initialized,
>> dp->phy_initialized);
>>
>> - dp_power_init(dp->power, false);
>> - dp_ctrl_reset_irq_ctrl(dp->ctrl, true);
>> - dp_aux_init(dp->aux);
>> - dp->core_initialized = true;
>> + if (!dp->core_initialized) {
>> + dp_power_init(dp->power, false);
>> + dp_ctrl_reset_irq_ctrl(dp->ctrl, true);
>> + dp_aux_init(dp->aux);
>> + dp->core_initialized = true;
>> + }
>> }
>>
>> static void dp_display_host_deinit(struct dp_display_private *dp)
>> @@ -472,10 +474,12 @@ static void dp_display_host_deinit(struct dp_display_private *dp)
>> dp->dp_display.connector_type, dp->core_initialized,
>> dp->phy_initialized);
>>
>> - dp_ctrl_reset_irq_ctrl(dp->ctrl, false);
>> - dp_aux_deinit(dp->aux);
>> - dp_power_deinit(dp->power);
>> - dp->core_initialized = false;
>> + if (dp->core_initialized) {
>> + dp_ctrl_reset_irq_ctrl(dp->ctrl, false);
>> + dp_aux_deinit(dp->aux);
>> + dp_power_deinit(dp->power);
>> + dp->core_initialized = false;
>> + }
>> }
>>
>> static int dp_display_usbpd_configure_cb(struct device *dev)
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
>
next prev parent reply other threads:[~2023-03-01 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 0:16 Kuogee Hsieh
2023-03-01 2:16 ` Dmitry Baryshkov
2023-03-01 16:57 ` Kuogee Hsieh [this message]
2023-03-01 21:15 ` Dmitry Baryshkov
2023-03-02 18:41 ` Kuogee Hsieh
2023-03-02 19:04 ` Dmitry Baryshkov
2023-03-03 22:45 ` Kuogee Hsieh
2023-03-03 23:38 ` 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=38bf75b4-799a-9758-aae3-69a7e0fc3f58@quicinc.com \
--to=quic_khsieh@quicinc.com \
--cc=agross@kernel.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--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=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_sbillaka@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
--cc=vkoul@kernel.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
all inboxes | Powered by JetHome®