[PATCH] drm/amdgpu: correct return type of amdgpu_ras_query_error_count
Chen, Guchun
Guchun.Chen at amd.com
Fri Aug 16 10:20:08 UTC 2019
In ras unit test tool, we have already used "unsigned long" to record the ce and ue error count.
Regards,
Guchun
-----Original Message-----
From: Zhou1, Tao <Tao.Zhou1 at amd.com>
Sent: Friday, August 16, 2019 5:59 PM
To: Chen, Guchun <Guchun.Chen at amd.com>; amd-gfx at lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang at amd.com>; Li, Dennis <Dennis.Li at amd.com>; Pan, Xinhui <Xinhui.Pan at amd.com>
Cc: Chen, Guchun <Guchun.Chen at amd.com>
Subject: RE: [PATCH] drm/amdgpu: correct return type of amdgpu_ras_query_error_count
The change is reasonable, but I also check the function's caller, a uint32_t ras_counter stores the value in amdgpu_ctx_query2.
How about ras test tool? Can we get rid of all the chaos about the counter's type?
Tao
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> Guchun Chen
> Sent: 2019年8月16日 15:10
> To: amd-gfx at lists.freedesktop.org; Zhang, Hawking
> <Hawking.Zhang at amd.com>; Li, Dennis <Dennis.Li at amd.com>; Pan, Xinhui
> <Xinhui.Pan at amd.com>; Zhou1, Tao <Tao.Zhou1 at amd.com>
> Cc: Chen, Guchun <Guchun.Chen at amd.com>
> Subject: [PATCH] drm/amdgpu: correct return type of
> amdgpu_ras_query_error_count
>
> The return value type of amdgpu_ras_query_error_count should be
> unsigned long, not int.
>
> Change-Id: I011406d81bad69a65433b63960e1691c4959bbc5
> Signed-off-by: Guchun Chen <guchun.chen at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 +++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 50c13b02d234..df4b9ae39c5e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -686,7 +686,7 @@ int amdgpu_ras_error_cure(struct amdgpu_device
> *adev, }
>
> /* get the total error counts on all IPs */ -int
> amdgpu_ras_query_error_count(struct amdgpu_device *adev,
> +unsigned long amdgpu_ras_query_error_count(struct amdgpu_device
> *adev,
> bool is_ce)
> {
> struct amdgpu_ras *con = amdgpu_ras_get_context(adev); @@ -
> 694,7 +694,7 @@ int amdgpu_ras_query_error_count(struct amdgpu_device
> *adev,
> struct ras_err_data data = {0, 0};
>
> if (!con)
> - return -EINVAL;
> + return 0;
>
> list_for_each_entry(obj, &con->head, node) {
> struct ras_query_if info = {
> @@ -702,7 +702,7 @@ int amdgpu_ras_query_error_count(struct
> amdgpu_device *adev,
> };
>
> if (amdgpu_ras_error_query(adev, &info))
> - return -EINVAL;
> + return 0;
>
> data.ce_count += info.ce_count;
> data.ue_count += info.ue_count;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> index 2765f2dbb1e6..02a51e3dfa14 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
> @@ -484,7 +484,7 @@ int amdgpu_ras_request_reset_on_boot(struct
> amdgpu_device *adev, void amdgpu_ras_resume(struct amdgpu_device
> *adev); void amdgpu_ras_suspend(struct amdgpu_device *adev);
>
> -int amdgpu_ras_query_error_count(struct amdgpu_device *adev,
> +unsigned long amdgpu_ras_query_error_count(struct amdgpu_device
> *adev,
> bool is_ce);
>
> /* error handling functions */
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list