Skip to content

Commit af309c0

Browse files
Kuogee Hsiehlumag
authored andcommitted
drm/msm/dp: retry 3 times if set sink to D0 poweer state failed
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 v5: -- split into two patches Signed-off-by: Kuogee Hsieh <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/502536/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent d54c518 commit af309c0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/gpu/drm/msm/dp/dp_link.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
5050
{
5151
u8 value;
5252
ssize_t len;
53+
int i;
5354

5455
if (link->revision < 0x11)
5556
return 0;
@@ -61,11 +62,13 @@ static int dp_aux_link_power_up(struct drm_dp_aux *aux,
6162
value &= ~DP_SET_POWER_MASK;
6263
value |= DP_SET_POWER_D0;
6364

64-
len = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
65-
if (len < 0)
66-
return len;
67-
68-
usleep_range(1000, 2000);
65+
/* retry for 1ms to give the sink time to wake up */
66+
for (i = 0; i < 3; i++) {
67+
len = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
68+
usleep_range(1000, 2000);
69+
if (len == 1)
70+
break;
71+
}
6972

7073
return 0;
7174
}

0 commit comments

Comments
 (0)