mirror of
https://github.com/torvalds/linux.git
synced 2026-04-25 18:12:26 -04:00
drm/amd: Propagate failures in dc_set_power_state()
During the suspend process dc_set_power_state() will use kzalloc to allocate memory, but this potentially fails with memory pressure. If it fails, the suspend should be aborted. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Cc: Harry.Wentland@amd.com Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
41801c6b30
commit
7441ef0b3e
@@ -2671,9 +2671,7 @@ static int dm_suspend(void *handle)
|
||||
|
||||
hpd_rx_irq_work_suspend(dm);
|
||||
|
||||
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
|
||||
|
||||
return 0;
|
||||
return dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
|
||||
}
|
||||
|
||||
struct amdgpu_dm_connector *
|
||||
@@ -2867,7 +2865,10 @@ static int dm_resume(void *handle)
|
||||
if (r)
|
||||
DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
|
||||
|
||||
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
|
||||
r = dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
dc_resume(dm->dc);
|
||||
|
||||
amdgpu_dm_irq_resume_early(adev);
|
||||
@@ -2916,7 +2917,9 @@ static int dm_resume(void *handle)
|
||||
}
|
||||
|
||||
/* power on hardware */
|
||||
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
|
||||
r = dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/* program HPD filter */
|
||||
dc_resume(dm->dc);
|
||||
|
||||
Reference in New Issue
Block a user