Commit 56fc13fe authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Alex Deucher

drm/amd/display: Don't spin forever waiting for DMCUB phy/auto init

[Why]
It's an interface violation to use infinite loops within DMUB
service functions and we'll lock up the kernel by doing so.

[How]
Revert the function back to its intended functionality.
Move the infinite loops into DC/DM as necessary.
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarSun peng Li <Sunpeng.Li@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 46250a0c
...@@ -112,8 +112,10 @@ void dc_dmub_srv_wait_phy_init(struct dc_dmub_srv *dc_dmub_srv) ...@@ -112,8 +112,10 @@ void dc_dmub_srv_wait_phy_init(struct dc_dmub_srv *dc_dmub_srv)
struct dc_context *dc_ctx = dc_dmub_srv->ctx; struct dc_context *dc_ctx = dc_dmub_srv->ctx;
enum dmub_status status; enum dmub_status status;
status = dmub_srv_wait_for_phy_init(dmub, 1000000); status = dmub_srv_wait_for_phy_init(dmub, 10000000);
if (status != DMUB_STATUS_OK) if (status != DMUB_STATUS_OK) {
DC_ERROR("Error waiting for DMUB phy init: status=%d\n", DC_ERROR("Error waiting for DMUB phy init: status=%d\n",
status); status);
ASSERT(0);
}
} }
...@@ -400,19 +400,14 @@ enum dmub_status dmub_srv_wait_for_phy_init(struct dmub_srv *dmub, ...@@ -400,19 +400,14 @@ enum dmub_status dmub_srv_wait_for_phy_init(struct dmub_srv *dmub,
if (!dmub->hw_init || !dmub->hw_funcs.is_phy_init) if (!dmub->hw_init || !dmub->hw_funcs.is_phy_init)
return DMUB_STATUS_INVALID; return DMUB_STATUS_INVALID;
/* for (i = 0; i <= timeout_us; i += 10) { for (i = 0; i <= timeout_us; i += 10) {
if (dmub->hw_funcs.is_phy_init(dmub)) if (dmub->hw_funcs.is_phy_init(dmub))
return DMUB_STATUS_OK; return DMUB_STATUS_OK;
udelay(10); udelay(10);
}*/
while (!dmub->hw_funcs.is_phy_init(dmub)) {
ASSERT(i <= timeout_us);
i += 10;
udelay(10);
} }
return DMUB_STATUS_OK; return DMUB_STATUS_TIMEOUT;
} }
enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub, enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment