drm/amd/display: Disable timeout in more places for dc_dmub_srv
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 23 Jan 2024 17:14:42 +0000 (12:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Feb 2024 17:26:22 +0000 (12:26 -0500)
[Why]
We're still missing a few and we'd like to avoid continuining when
a hang occurs for debug purposes.

[How]
Add the loop anywhere we try to wait on rptr == wptr in dc_dmub_srv.

Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c

index 0ccdc0c..838c43b 100644 (file)
@@ -74,7 +74,10 @@ void dc_dmub_srv_wait_idle(struct dc_dmub_srv *dc_dmub_srv)
        struct dc_context *dc_ctx = dc_dmub_srv->ctx;
        enum dmub_status status;
 
-       status = dmub_srv_wait_for_idle(dmub, 100000);
+       do {
+               status = dmub_srv_wait_for_idle(dmub, 100000);
+       } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
+
        if (status != DMUB_STATUS_OK) {
                DC_ERROR("Error waiting for DMUB idle: status=%d\n", status);
                dc_dmub_srv_log_diagnostic_data(dc_dmub_srv);
@@ -145,7 +148,9 @@ bool dc_dmub_srv_cmd_list_queue_execute(struct dc_dmub_srv *dc_dmub_srv,
                        if (status == DMUB_STATUS_POWER_STATE_D3)
                                return false;
 
-                       dmub_srv_wait_for_idle(dmub, 100000);
+                       do {
+                               status = dmub_srv_wait_for_idle(dmub, 100000);
+                       } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
 
                        /* Requeue the command. */
                        status = dmub_srv_cmd_queue(dmub, &cmd_list[i]);
@@ -186,7 +191,9 @@ bool dc_dmub_srv_wait_for_idle(struct dc_dmub_srv *dc_dmub_srv,
 
        // Wait for DMUB to process command
        if (wait_type != DM_DMUB_WAIT_TYPE_NO_WAIT) {
-               status = dmub_srv_wait_for_idle(dmub, 100000);
+               do {
+                       status = dmub_srv_wait_for_idle(dmub, 100000);
+               } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
 
                if (status != DMUB_STATUS_OK) {
                        DC_LOG_DEBUG("No reply for DMUB command: status=%d\n", status);