All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs
@ 2019-08-09  9:50 Tao Zhou
       [not found] ` <20190809095047.12372-1-tao.zhou1-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Tao Zhou @ 2019-08-09  9:50 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	christian.koenig-5C7GfCeVMHo, hawking.zhang-5C7GfCeVMHo,
	Chris.Freehill-5C7GfCeVMHo, Kent.Russell-5C7GfCeVMHo
  Cc: Tao Zhou

feature mask info is enough for rocm tool,
"cat /sys/class/drm/card0/device/ras/features" will get the
info like this:

feature mask: 0x3ffb

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index be59102526a1..50c13b02d234 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -791,25 +791,8 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
 {
 	struct amdgpu_ras *con =
 		container_of(attr, struct amdgpu_ras, features_attr);
-	struct drm_device *ddev = dev_get_drvdata(dev);
-	struct amdgpu_device *adev = ddev->dev_private;
-	struct ras_common_if head;
-	int ras_block_count = AMDGPU_RAS_BLOCK_COUNT;
-	int i, enabled;
-	ssize_t s;
-
-	s = scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
-
-	for (i = 0; i < ras_block_count; i++) {
-		head.block = i;
-		enabled = amdgpu_ras_is_feature_enabled(adev, &head);
-
-		s += scnprintf(&buf[s], PAGE_SIZE - s,
-				"%s ras feature mask: %s\n",
-				ras_block_str(i), enabled?"on":"off");
-	}
 
-	return s;
+	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
 }
 
 static int amdgpu_ras_sysfs_create_feature_node(struct amdgpu_device *adev)
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs
       [not found] ` <20190809095047.12372-1-tao.zhou1-5C7GfCeVMHo@public.gmane.org>
@ 2019-08-09 10:28   ` Zhang, Hawking
       [not found]     ` <MWHPR12MB1424FCE0F9D5E8C7835EEE8AFCD60-Gy0DoCVfaSWlS75/fbfGowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Hawking @ 2019-08-09 10:28 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Koenig, Christian,
	Freehill, Chris, Russell, Kent
  Cc: Zhou1, Tao

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Tao Zhou
Sent: 2019年8月9日 17:51
To: amd-gfx@lists.freedesktop.org; Koenig, Christian <Christian.Koenig@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Freehill, Chris <Chris.Freehill@amd.com>; Russell, Kent <Kent.Russell@amd.com>
Cc: Zhou1, Tao <Tao.Zhou1@amd.com>
Subject: [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs

feature mask info is enough for rocm tool, "cat /sys/class/drm/card0/device/ras/features" will get the info like this:

feature mask: 0x3ffb

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index be59102526a1..50c13b02d234 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -791,25 +791,8 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,  {
 	struct amdgpu_ras *con =
 		container_of(attr, struct amdgpu_ras, features_attr);
-	struct drm_device *ddev = dev_get_drvdata(dev);
-	struct amdgpu_device *adev = ddev->dev_private;
-	struct ras_common_if head;
-	int ras_block_count = AMDGPU_RAS_BLOCK_COUNT;
-	int i, enabled;
-	ssize_t s;
-
-	s = scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
-
-	for (i = 0; i < ras_block_count; i++) {
-		head.block = i;
-		enabled = amdgpu_ras_is_feature_enabled(adev, &head);
-
-		s += scnprintf(&buf[s], PAGE_SIZE - s,
-				"%s ras feature mask: %s\n",
-				ras_block_str(i), enabled?"on":"off");
-	}
 
-	return s;
+	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", 
+con->features);
 }
 
 static int amdgpu_ras_sysfs_create_feature_node(struct amdgpu_device *adev)
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs
       [not found]     ` <MWHPR12MB1424FCE0F9D5E8C7835EEE8AFCD60-Gy0DoCVfaSWlS75/fbfGowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-08-09 11:48       ` Koenig, Christian
  0 siblings, 0 replies; 3+ messages in thread
From: Koenig, Christian @ 2019-08-09 11:48 UTC (permalink / raw)
  To: Zhang, Hawking, Zhou1, Tao,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Freehill, Chris,
	Russell, Kent

Reviewed-by: Christian König <christian.koenig@amd.com>

Am 09.08.19 um 12:28 schrieb Zhang, Hawking:
> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
>
> Regards,
> Hawking
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Tao Zhou
> Sent: 2019年8月9日 17:51
> To: amd-gfx@lists.freedesktop.org; Koenig, Christian <Christian.Koenig@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Freehill, Chris <Chris.Freehill@amd.com>; Russell, Kent <Kent.Russell@amd.com>
> Cc: Zhou1, Tao <Tao.Zhou1@amd.com>
> Subject: [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs
>
> feature mask info is enough for rocm tool, "cat /sys/class/drm/card0/device/ras/features" will get the info like this:
>
> feature mask: 0x3ffb
>
> Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 19 +------------------
>   1 file changed, 1 insertion(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index be59102526a1..50c13b02d234 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -791,25 +791,8 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,  {
>   	struct amdgpu_ras *con =
>   		container_of(attr, struct amdgpu_ras, features_attr);
> -	struct drm_device *ddev = dev_get_drvdata(dev);
> -	struct amdgpu_device *adev = ddev->dev_private;
> -	struct ras_common_if head;
> -	int ras_block_count = AMDGPU_RAS_BLOCK_COUNT;
> -	int i, enabled;
> -	ssize_t s;
> -
> -	s = scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
> -
> -	for (i = 0; i < ras_block_count; i++) {
> -		head.block = i;
> -		enabled = amdgpu_ras_is_feature_enabled(adev, &head);
> -
> -		s += scnprintf(&buf[s], PAGE_SIZE - s,
> -				"%s ras feature mask: %s\n",
> -				ras_block_str(i), enabled?"on":"off");
> -	}
>   
> -	return s;
> +	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n",
> +con->features);
>   }
>   
>   static int amdgpu_ras_sysfs_create_feature_node(struct amdgpu_device *adev)
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-09 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  9:50 [PATCH] drm/amdgpu: remove ras block's feature status info in sysfs Tao Zhou
     [not found] ` <20190809095047.12372-1-tao.zhou1-5C7GfCeVMHo@public.gmane.org>
2019-08-09 10:28   ` Zhang, Hawking
     [not found]     ` <MWHPR12MB1424FCE0F9D5E8C7835EEE8AFCD60-Gy0DoCVfaSWlS75/fbfGowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-09 11:48       ` Koenig, Christian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.