lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5 2/3] venus: Add a debugfs file for SSR trigger
Date
The SSR (SubSystem Restart) is used to simulate an error on FW
side of Venus. We support following type of triggers - fatal error,
div by zero and watchdog IRQ.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
drivers/media/platform/qcom/venus/dbgfs.c | 30 +++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c
index 782d54ac1b8f..f95b7b1febe5 100644
--- a/drivers/media/platform/qcom/venus/dbgfs.c
+++ b/drivers/media/platform/qcom/venus/dbgfs.c
@@ -9,10 +9,40 @@

extern int venus_fw_debug;

+static int trigger_ssr_open(struct inode *inode, struct file *file)
+{
+ file->private_data = inode->i_private;
+ return 0;
+}
+
+static ssize_t trigger_ssr_write(struct file *filp, const char __user *buf,
+ size_t count, loff_t *ppos)
+{
+ struct venus_core *core = filp->private_data;
+ u32 ssr_type;
+ int ret;
+
+ ret = kstrtou32_from_user(buf, count, 4, &ssr_type);
+ if (ret)
+ return ret;
+
+ ret = hfi_core_trigger_ssr(core, ssr_type);
+ if (ret < 0)
+ return ret;
+
+ return count;
+}
+
+static const struct file_operations ssr_fops = {
+ .open = trigger_ssr_open,
+ .write = trigger_ssr_write,
+};
+
void venus_dbgfs_init(struct venus_core *core)
{
core->root = debugfs_create_dir("venus", NULL);
debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug);
+ debugfs_create_file("trigger_ssr", 0200, core->root, core, &ssr_fops);
}

void venus_dbgfs_deinit(struct venus_core *core)
--
2.17.1
\
 
 \ /
  Last update: 2020-07-30 11:55    [W:0.076 / U:1.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site