* [PATCH 4/5] drm/amdgpu: remove per obj debugfs write
@ 2019-03-21 7:30 Pan, Xinhui
[not found] ` <SN6PR12MB280007D5C8C30B27811323D787420-kxOKjb6HO/EqkY47FTA1ogdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Pan, Xinhui @ 2019-03-21 7:30 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander
there is ras_ctrl node which can do the job.
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 42 +------------------------
1 file changed, 1 insertion(+), 41 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 1e243e16c560..469cb6477b8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -157,50 +157,10 @@ static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf,
return s;
}
-static ssize_t amdgpu_ras_debugfs_write(struct file *f, const char __user *buf,
- size_t size, loff_t *pos)
-{
- struct ras_manager *obj = (struct ras_manager *)file_inode(f)->i_private;
- struct ras_inject_if info = {
- .head = obj->head,
- };
- ssize_t s = min_t(u64, 64, size);
- char val[64];
- char *str = val;
- memset(val, 0, sizeof(val));
-
- if (*pos)
- return -EINVAL;
-
- if (copy_from_user(str, buf, s))
- return -EINVAL;
-
- /* only care ue/ce for now. */
- if (memcmp(str, "ue", 2) == 0) {
- info.head.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
- str += 2;
- } else if (memcmp(str, "ce", 2) == 0) {
- info.head.type = AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE;
- str += 2;
- }
-
- if (sscanf(str, "0x%llx 0x%llx", &info.address, &info.value) != 2) {
- if (sscanf(str, "%llu %llu", &info.address, &info.value) != 2)
- return -EINVAL;
- }
-
- *pos = s;
-
- if (amdgpu_ras_error_inject(obj->adev, &info))
- return -EINVAL;
-
- return size;
-}
-
static const struct file_operations amdgpu_ras_debugfs_ops = {
.owner = THIS_MODULE,
.read = amdgpu_ras_debugfs_read,
- .write = amdgpu_ras_debugfs_write,
+ .write = NULL,
.llseek = default_llseek
};
--
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] 2+ messages in thread
* Re: [PATCH 4/5] drm/amdgpu: remove per obj debugfs write
[not found] ` <SN6PR12MB280007D5C8C30B27811323D787420-kxOKjb6HO/EqkY47FTA1ogdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-21 15:58 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-03-21 15:58 UTC (permalink / raw)
To: Pan, Xinhui; +Cc: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Thu, Mar 21, 2019 at 3:30 AM Pan, Xinhui <Xinhui.Pan@amd.com> wrote:
>
> there is ras_ctrl node which can do the job.
>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 42 +------------------------
> 1 file changed, 1 insertion(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 1e243e16c560..469cb6477b8e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -157,50 +157,10 @@ static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf,
> return s;
> }
>
> -static ssize_t amdgpu_ras_debugfs_write(struct file *f, const char __user *buf,
> - size_t size, loff_t *pos)
> -{
> - struct ras_manager *obj = (struct ras_manager *)file_inode(f)->i_private;
> - struct ras_inject_if info = {
> - .head = obj->head,
> - };
> - ssize_t s = min_t(u64, 64, size);
> - char val[64];
> - char *str = val;
> - memset(val, 0, sizeof(val));
> -
> - if (*pos)
> - return -EINVAL;
> -
> - if (copy_from_user(str, buf, s))
> - return -EINVAL;
> -
> - /* only care ue/ce for now. */
> - if (memcmp(str, "ue", 2) == 0) {
> - info.head.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
> - str += 2;
> - } else if (memcmp(str, "ce", 2) == 0) {
> - info.head.type = AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE;
> - str += 2;
> - }
> -
> - if (sscanf(str, "0x%llx 0x%llx", &info.address, &info.value) != 2) {
> - if (sscanf(str, "%llu %llu", &info.address, &info.value) != 2)
> - return -EINVAL;
> - }
> -
> - *pos = s;
> -
> - if (amdgpu_ras_error_inject(obj->adev, &info))
> - return -EINVAL;
> -
> - return size;
> -}
> -
> static const struct file_operations amdgpu_ras_debugfs_ops = {
> .owner = THIS_MODULE,
> .read = amdgpu_ras_debugfs_read,
> - .write = amdgpu_ras_debugfs_write,
> + .write = NULL,
> .llseek = default_llseek
> };
>
> --
> 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] 2+ messages in thread
end of thread, other threads:[~2019-03-21 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 7:30 [PATCH 4/5] drm/amdgpu: remove per obj debugfs write Pan, Xinhui
[not found] ` <SN6PR12MB280007D5C8C30B27811323D787420-kxOKjb6HO/EqkY47FTA1ogdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-21 15:58 ` Alex Deucher
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.