Skip to content

Commit cf32515

Browse files
Yang Wangalexdeucher
authored andcommitted
drm/amd/pm: refine amdgpu pm sysfs node error code
v1: Returns different error codes based on the scenario to help the user app understand the AMDGPU device status when an exception occurs. v2: change -NODEV to -EBUSY. Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent bddf309 commit cf32515

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ static int amdgpu_pm_dev_state_check(struct amdgpu_device *adev, bool runpm)
110110
bool runpm_check = runpm ? adev->in_runpm : false;
111111

112112
if (amdgpu_in_reset(adev))
113-
return -EPERM;
113+
return -EBUSY;
114+
114115
if (adev->in_suspend && !runpm_check)
115-
return -EPERM;
116+
return -EBUSY;
116117

117118
return 0;
118119
}

0 commit comments

Comments
 (0)