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

drm/amd/display: prevent register access while in IPS

We can't read/write to DCN registers while in IPS. Since, that can cause
the system to hang. So, before proceeding with the access in that
scenario, force the system out of IPS.

Cc: stable@vger.kernel.org # 6.6+
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Hamza Mahfooz and committed by
Alex Deucher
56342da3 84801d4f

+10
+10
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 11437 11437 mutex_unlock(&adev->dm.dc_lock); 11438 11438 } 11439 11439 11440 + static inline void amdgpu_dm_exit_ips_for_hw_access(struct dc *dc) 11441 + { 11442 + if (dc->ctx->dmub_srv && !dc->ctx->dmub_srv->idle_exit_counter) 11443 + dc_exit_ips_for_hw_access(dc); 11444 + } 11445 + 11440 11446 void dm_write_reg_func(const struct dc_context *ctx, uint32_t address, 11441 11447 u32 value, const char *func_name) 11442 11448 { ··· 11453 11447 return; 11454 11448 } 11455 11449 #endif 11450 + 11451 + amdgpu_dm_exit_ips_for_hw_access(ctx->dc); 11456 11452 cgs_write_register(ctx->cgs_device, address, value); 11457 11453 trace_amdgpu_dc_wreg(&ctx->perf_trace->write_count, address, value); 11458 11454 } ··· 11477 11469 ASSERT(false); 11478 11470 return 0; 11479 11471 } 11472 + 11473 + amdgpu_dm_exit_ips_for_hw_access(ctx->dc); 11480 11474 11481 11475 value = cgs_read_register(ctx->cgs_device, address); 11482 11476