Re: [PATCH 1/2] drm/amdgpu: add function to creat all ras debugfs node

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

 



On Mon, Mar 9, 2020 at 5:12 AM Stanley.Yang <Stanley.Yang@xxxxxxx> wrote:
>
> From: Tao Zhou <tao.zhou1@xxxxxxx>
>
> centralize all debugfs creation in one place for ras

Might want to note that this is required to fix ras when the driver
does not use the drm load and unload callbacks due to ordering issues
with the drm device node.  With that added:
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

>
> Signed-off-by: Tao Zhou <tao.zhou1@xxxxxxx>
> Signed-off-by: Stanley.Yang <Stanley.Yang@xxxxxxx>
> Change-Id: I7489ccb41dcf7a11ecc45313ad42940474999d81
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 29 +++++++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h |  2 ++
>  2 files changed, 31 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 492960e7d5f0..422cdd1ce3ad 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1117,6 +1117,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
>                                        &amdgpu_ras_debugfs_ops);
>  }
>
> +void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
> +{
> +       struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
> +       struct ras_manager *obj, *tmp;
> +       struct ras_fs_if fs_info;
> +
> +       /*
> +        * it won't be called in resume path, no need to check
> +        * suspend and gpu reset status
> +        */
> +       if (!con)
> +               return;
> +
> +       amdgpu_ras_debugfs_create_ctrl_node(adev);
> +
> +       list_for_each_entry_safe(obj, tmp, &con->head, node) {
> +               if (!obj)
> +                       continue;
> +
> +               if (amdgpu_ras_is_supported(adev, obj->head.block) &&
> +                       (obj->attr_inuse == 1)) {
> +                       sprintf(fs_info.debugfs_name, "%s_err_inject",
> +                                       ras_block_str(obj->head.block));
> +                       fs_info.head = obj->head;
> +                       amdgpu_ras_debugfs_create(adev, &fs_info);
> +               }
> +       }
> +}
> +
>  void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
>                 struct ras_common_if *head)
>  {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> index a5fe29a9373e..55c3eceb390d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> @@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,
>  void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
>                 struct ras_fs_if *head);
>
> +void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);
> +
>  void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
>                 struct ras_common_if *head);
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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