drm/amdgpu fix amdgpu.dpm=0 (v2)
Fix crash when disabling dpm. v2: agd5f: fix coding style, cleanup commit message Signed-off-by: Sonny Jiang <sonny.jiang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c92b90ccc2
commit
46651cc5db
|
@ -1206,10 +1206,7 @@ static int cz_dpm_enable(struct amdgpu_device *adev)
|
||||||
|
|
||||||
static int cz_dpm_hw_init(struct amdgpu_device *adev)
|
static int cz_dpm_hw_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
if (!amdgpu_dpm)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
mutex_lock(&adev->pm.mutex);
|
mutex_lock(&adev->pm.mutex);
|
||||||
|
|
||||||
|
@ -1229,6 +1226,12 @@ static int cz_dpm_hw_init(struct amdgpu_device *adev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!amdgpu_dpm) {
|
||||||
|
adev->pm.dpm_enabled = false;
|
||||||
|
mutex_unlock(&adev->pm.mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* cz dpm setup asic */
|
/* cz dpm setup asic */
|
||||||
cz_dpm_setup_asic(adev);
|
cz_dpm_setup_asic(adev);
|
||||||
|
|
||||||
|
@ -1326,6 +1329,12 @@ static int cz_dpm_resume(struct amdgpu_device *adev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!amdgpu_dpm) {
|
||||||
|
adev->pm.dpm_enabled = false;
|
||||||
|
mutex_unlock(&adev->pm.mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* cz dpm setup asic */
|
/* cz dpm setup asic */
|
||||||
cz_dpm_setup_asic(adev);
|
cz_dpm_setup_asic(adev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue