[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <067c7bc0-4746-f714-db56-a3c9e4f25588@linaro.org>
Date: Mon, 12 Sep 2022 21:37:20 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Kuogee Hsieh <quic_khsieh@...cinc.com>,
dri-devel@...ts.freedesktop.org, robdclark@...il.com,
sean@...rly.run, swboyd@...omium.org, dianders@...omium.org,
vkoul@...nel.org, daniel@...ll.ch, airlied@...ux.ie,
agross@...nel.org, bjorn.andersson@...aro.org
Cc: quic_abhinavk@...cinc.com, quic_sbillaka@...cinc.com,
freedreno@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 3/3] drm/msm/dp: retry 3 times if set sink to D0 poweer
state failed
On 12/09/2022 19:23, Kuogee Hsieh 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.
Could you please elaborate this change? Can the sink succeed in reading
the DP_SET_POWER, but fail writing DP_SET_POWER?
>
> Changes in v5:
> -- split into two patches
>
> Signed-off-by: Kuogee Hsieh <quic_khsieh@...cinc.com>
> ---
> drivers/gpu/drm/msm/dp/dp_link.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c
> index 9d5381d..4360728 100644
> --- a/drivers/gpu/drm/msm/dp/dp_link.c
> +++ b/drivers/gpu/drm/msm/dp/dp_link.c
> @@ -50,6 +50,7 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
> {
> u8 value;
> ssize_t len;
> + int i;
>
> if (link->revision < 0x11)
> return 0;
> @@ -61,11 +62,13 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
> value &= ~DP_SET_POWER_MASK;
> value |= DP_SET_POWER_D0;
>
> - len = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
> - if (len < 0)
> - return len;
> -
> - 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;
> }
--
With best wishes
Dmitry
Powered by blists - more mailing lists