Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: skip error logging when DMUB is inactive from S3

[Why]
On resume from S3, while DMUB is inactive, DMUB queue and execute
calls will not work. Skip reporting errors in these scenarios

[How]
Add new return code during DMUB queue and execute calls when DMUB
is in S3 state. Skip logging errors in these scenarios

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Samson Tam <samson.tam@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Samson Tam and committed by
Alex Deucher
8b09656b 006ad514

+27 -12
+24 -10
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
··· 140 140 141 141 if (status == DMUB_STATUS_QUEUE_FULL) { 142 142 /* Execute and wait for queue to become empty again. */ 143 - dmub_srv_cmd_execute(dmub); 143 + status = dmub_srv_cmd_execute(dmub); 144 + if (status == DMUB_STATUS_POWER_STATE_D3) 145 + return false; 146 + 144 147 dmub_srv_wait_for_idle(dmub, 100000); 145 148 146 149 /* Requeue the command. */ ··· 151 148 } 152 149 153 150 if (status != DMUB_STATUS_OK) { 154 - DC_ERROR("Error queueing DMUB command: status=%d\n", status); 155 - dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 151 + if (status != DMUB_STATUS_POWER_STATE_D3) { 152 + DC_ERROR("Error queueing DMUB command: status=%d\n", status); 153 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 154 + } 156 155 return false; 157 156 } 158 157 } 159 158 160 159 status = dmub_srv_cmd_execute(dmub); 161 160 if (status != DMUB_STATUS_OK) { 162 - DC_ERROR("Error starting DMUB execution: status=%d\n", status); 163 - dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 161 + if (status != DMUB_STATUS_POWER_STATE_D3) { 162 + DC_ERROR("Error starting DMUB execution: status=%d\n", status); 163 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 164 + } 164 165 return false; 165 166 } 166 167 ··· 225 218 226 219 if (status == DMUB_STATUS_QUEUE_FULL) { 227 220 /* Execute and wait for queue to become empty again. */ 228 - dmub_srv_cmd_execute(dmub); 221 + status = dmub_srv_cmd_execute(dmub); 222 + if (status == DMUB_STATUS_POWER_STATE_D3) 223 + return false; 224 + 229 225 dmub_srv_wait_for_idle(dmub, 100000); 230 226 231 227 /* Requeue the command. */ ··· 236 226 } 237 227 238 228 if (status != DMUB_STATUS_OK) { 239 - DC_ERROR("Error queueing DMUB command: status=%d\n", status); 240 - dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 229 + if (status != DMUB_STATUS_POWER_STATE_D3) { 230 + DC_ERROR("Error queueing DMUB command: status=%d\n", status); 231 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 232 + } 241 233 return false; 242 234 } 243 235 } 244 236 245 237 status = dmub_srv_cmd_execute(dmub); 246 238 if (status != DMUB_STATUS_OK) { 247 - DC_ERROR("Error starting DMUB execution: status=%d\n", status); 248 - dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 239 + if (status != DMUB_STATUS_POWER_STATE_D3) { 240 + DC_ERROR("Error starting DMUB execution: status=%d\n", status); 241 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 242 + } 249 243 return false; 250 244 } 251 245
+1
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 86 86 DMUB_STATUS_TIMEOUT, 87 87 DMUB_STATUS_INVALID, 88 88 DMUB_STATUS_HW_FAILURE, 89 + DMUB_STATUS_POWER_STATE_D3 89 90 }; 90 91 91 92 /* enum dmub_asic - dmub asic identifier */
+2 -2
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
··· 768 768 return DMUB_STATUS_INVALID; 769 769 770 770 if (dmub->power_state != DMUB_POWER_STATE_D0) 771 - return DMUB_STATUS_INVALID; 771 + return DMUB_STATUS_POWER_STATE_D3; 772 772 773 773 if (dmub->inbox1_rb.rptr > dmub->inbox1_rb.capacity || 774 774 dmub->inbox1_rb.wrpt > dmub->inbox1_rb.capacity) { ··· 789 789 return DMUB_STATUS_INVALID; 790 790 791 791 if (dmub->power_state != DMUB_POWER_STATE_D0) 792 - return DMUB_STATUS_INVALID; 792 + return DMUB_STATUS_POWER_STATE_D3; 793 793 794 794 /** 795 795 * Read back all the queued commands to ensure that they've