aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch
new file mode 100644
index 00000000..0d232619
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3352-drm-amdgpu-add-sub-block-parameter-in-ras-inject-com.patch
@@ -0,0 +1,70 @@
+From f9df41172be164bffbf1f6fc4ee3061f1a10e9b9 Mon Sep 17 00:00:00 2001
+From: Tao Zhou <tao.zhou1@amd.com>
+Date: Wed, 7 Aug 2019 14:27:42 +0800
+Subject: [PATCH 3352/4256] drm/amdgpu: add sub block parameter in ras inject
+ command
+
+ras sub block index could be passed from shell command
+
+Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
+Reviewed-by: Guchun Chen <guchun.chen@amd.com>
+Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+index 369651247b23..bc766cdbeaae 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+@@ -129,6 +129,7 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
+ char err[9] = "ue";
+ int op = -1;
+ int block_id;
++ uint32_t sub_block;
+ u64 address, value;
+
+ if (*pos)
+@@ -167,11 +168,12 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
+ data->op = op;
+
+ if (op == 2) {
+- if (sscanf(str, "%*s %*s %*s %llu %llu",
+- &address, &value) != 2)
+- if (sscanf(str, "%*s %*s %*s 0x%llx 0x%llx",
+- &address, &value) != 2)
++ if (sscanf(str, "%*s %*s %*s %u %llu %llu",
++ &sub_block, &address, &value) != 3)
++ if (sscanf(str, "%*s %*s %*s 0x%x 0x%llx 0x%llx",
++ &sub_block, &address, &value) != 3)
+ return -EINVAL;
++ data->head.sub_block_index = sub_block;
+ data->inject.address = address;
+ data->inject.value = value;
+ }
+@@ -216,7 +218,7 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
+ * write the struct to the control node.
+ *
+ * bash:
+- * echo op block [error [address value]] > .../ras/ras_ctrl
++ * echo op block [error [sub_blcok address value]] > .../ras/ras_ctrl
+ * op: disable, enable, inject
+ * disable: only block is needed
+ * enable: block and error are needed
+@@ -226,10 +228,11 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
+ * error: ue, ce
+ * ue: multi_uncorrectable
+ * ce: single_correctable
++ * sub_block: sub block index, pass 0 if there is no sub block
+ *
+ * here are some examples for bash commands,
+- * echo inject umc ue 0x0 0x0 > /sys/kernel/debug/dri/0/ras/ras_ctrl
+- * echo inject umc ce 0 0 > /sys/kernel/debug/dri/0/ras/ras_ctrl
++ * echo inject umc ue 0x0 0x0 0x0 > /sys/kernel/debug/dri/0/ras/ras_ctrl
++ * echo inject umc ce 0 0 0 > /sys/kernel/debug/dri/0/ras/ras_ctrl
+ * echo disable umc > /sys/kernel/debug/dri/0/ras/ras_ctrl
+ *
+ * How to check the result?
+--
+2.17.1
+