[PATCH] drm/amdgpu/pm: don't bail for in_suspend

Michel Dänzer michel at daenzer.net
Fri May 29 09:56:03 UTC 2020


On 2020-05-28 12:51 a.m., Alex Deucher wrote:
> Otherwise we disable sysfs/debugfs access with runtime pm.
> 
> Fixes: f7c8d853b029df ("drm/amdgpu/pm: return an error during GPU reset or suspend")
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 114 ++++++++++++-------------
>  1 file changed, 57 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> index 808884aaf36d..775e389c9a13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -163,7 +163,7 @@ static ssize_t amdgpu_get_power_dpm_state(struct device *dev,
>  	enum amd_pm_state_type pm;
>  	int ret;
>  
> -	if (adev->in_gpu_reset || adev->in_suspend)
> +	if (adev->in_gpu_reset)
>  		return -EPERM;
>  
>  	ret = pm_runtime_get_sync(ddev->dev);
> @@ -199,7 +199,7 @@ static ssize_t amdgpu_set_power_dpm_state(struct device *dev,
>  	enum amd_pm_state_type  state;
>  	int ret;
>  
> -	if (adev->in_gpu_reset || adev->in_suspend)
> +	if (adev->in_gpu_reset)
>  		return -EPERM;
>  
>  	if (strncmp("battery", buf, strlen("battery")) == 0)

Might be worth moving this check into a helper function; that would make
similar changes easier in the future. :) Can be a separate change, of
course.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer


More information about the amd-gfx mailing list