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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> ---
>  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
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux