From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Kuogee Hsieh <quic_khsieh@quicinc.com>
Cc: quic_sbillaka@quicinc.com, quic_abhinavk@quicinc.com,
airlied@linux.ie, freedreno@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, dianders@chromium.org,
vkoul@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org,
linux-arm-msm@vger.kernel.org, swboyd@chromium.org,
sean@poorly.run, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed
Date: Fri, 9 Sep 2022 01:10:14 +0300 [thread overview]
Message-ID: <CAA8EJpoEPD7pvLcCOnH-r-J=zVxm5C=ZOvMYLBqfwv4ufSWmDA@mail.gmail.com> (raw)
In-Reply-To: <1662671917-17194-3-git-send-email-quic_khsieh@quicinc.com>
On Fri, 9 Sept 2022 at 00:18, Kuogee Hsieh <quic_khsieh@quicinc.com> wrote:
>
> Bring sink out of D3 (power down) mode into D0 (normal operation) mode
> by setting DP_SET_POWER_D0 bit to DP_SET_POWER dpcd register. This
> patch will retry 3 times if written to DP_SET_POWER register failed.
>
> Changes in v4:
> -- split into two patches
>
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
> drivers/gpu/drm/msm/dp/dp_link.c | 21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c
> index 36f0af0..7b5ecf5 100644
> --- a/drivers/gpu/drm/msm/dp/dp_link.c
> +++ b/drivers/gpu/drm/msm/dp/dp_link.c
> @@ -49,23 +49,26 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
> struct dp_link_info *link)
> {
> u8 value;
> - int err;
> + ssize_t len;
> + int i;
>
> if (link->revision < 0x11)
> return 0;
>
> - err = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
> - if (err < 0)
> - return err;
> + len = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
> + if (len < 0)
> + return len;
This is a separate patch.
>
> value &= ~DP_SET_POWER_MASK;
> value |= DP_SET_POWER_D0;
>
> - err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
> - if (err < 0)
> - return err;
> -
> - usleep_range(1000, 2000);
> + /* retry for 1ms to give the sink time to wake up */
> + for (i = 0; i < 3; i++) {
> + len = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
> + usleep_range(1000, 2000);
> + if (len == 1)
> + break;
> + }
>
> return 0;
> }
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
--
With best wishes
Dmitry
prev parent reply other threads:[~2022-09-08 22:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 21:18 [PATCH v4 0/2] cleared DP_DOWNSPREAD_CTRL register Kuogee Hsieh
2022-09-08 21:18 ` [PATCH v4 1/2] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training Kuogee Hsieh
2022-09-08 21:18 ` [PATCH v4 2/2] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed Kuogee Hsieh
2022-09-08 22:10 ` Dmitry Baryshkov [this message]
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='CAA8EJpoEPD7pvLcCOnH-r-J=zVxm5C=ZOvMYLBqfwv4ufSWmDA@mail.gmail.com' \
--to=dmitry.baryshkov@linaro.org \
--cc=agross@kernel.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.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_khsieh@quicinc.com \
--cc=quic_sbillaka@quicinc.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;
as well as URLs for NNTP newsgroup(s).