diff options
author | xinhui pan <xinhui.pan@amd.com> | 2019-03-21 15:00:47 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-27 22:39:59 -0500 |
commit | 190211ab7554c4ebe603b02adfb956dbc3e8e2af (patch) | |
tree | 7819d02c6fb5f19958bfdf3dce4a825c0975f109 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |
parent | 828cfa29093f86ef126f505a2b7fc1831aeeed74 (diff) | |
download | lwn-190211ab7554c4ebe603b02adfb956dbc3e8e2af.tar.gz lwn-190211ab7554c4ebe603b02adfb956dbc3e8e2af.zip |
drm/amdgpu: remove per obj debugfs write
there is ras_control node which can do its job.
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 42 |
1 files changed, 1 insertions, 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 }; |