[PATCH 1/2] drm/amdgpu: drop pm_sysfs_en flag from amdgpu_device structure

Christian König christian.koenig at amd.com
Fri Mar 10 07:35:15 UTC 2023


Am 10.03.23 um 06:03 schrieb Guchun Chen:
> pm_sysfs_en is overlapped with pm.sysfs_initialized, so drop it
> for simplifying code(no functional change).
>
> Signed-off-by: Guchun Chen <guchun.chen at amd.com>

Acked-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 1 -
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++------
>   2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 164141bc8b4a..386729cc45d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1023,7 +1023,6 @@ struct amdgpu_device {
>   	bool                            in_runpm;
>   	bool                            has_pr3;
>   
> -	bool                            pm_sysfs_en;
>   	bool                            ucode_sysfs_en;
>   	bool                            psp_sysfs_en;
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index da5b0258a237..41ef3368556b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3864,11 +3864,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>   	adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
>   
>   	r = amdgpu_pm_sysfs_init(adev);
> -	if (r) {
> -		adev->pm_sysfs_en = false;
> -		DRM_ERROR("registering pm debugfs failed (%d).\n", r);
> -	} else
> -		adev->pm_sysfs_en = true;
> +	if (r)
> +		DRM_ERROR("registering pm sysfs failed (%d).\n", r);
>   
>   	r = amdgpu_ucode_sysfs_init(adev);
>   	if (r) {
> @@ -4011,7 +4008,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>   	if (adev->mman.initialized)
>   		drain_workqueue(adev->mman.bdev.wq);
>   
> -	if (adev->pm_sysfs_en)
> +	if (adev->pm.sysfs_initialized)
>   		amdgpu_pm_sysfs_fini(adev);
>   	if (adev->ucode_sysfs_en)
>   		amdgpu_ucode_sysfs_fini(adev);



More information about the amd-gfx mailing list