aboutsummaryrefslogtreecommitdiff
path: root/drivers/accel/ivpu/ivpu_debugfs.c
diff options
context:
space:
mode:
authorGravatar Tomasz Rusinowicz <tomasz.rusinowicz@intel.com> 2023-10-28 15:34:07 +0200
committerGravatar Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> 2023-10-30 11:06:09 +0100
commitf13108fc7bae7085616805ed176b2114cdf4bd55 (patch)
tree5e58734fc285dc69889c3d05434f8980f93e5d09 /drivers/accel/ivpu/ivpu_debugfs.c
parentaccel/ivpu: Remove unneeded drm_driver declaration (diff)
downloadlinux-f13108fc7bae7085616805ed176b2114cdf4bd55.tar.gz
linux-f13108fc7bae7085616805ed176b2114cdf4bd55.tar.bz2
linux-f13108fc7bae7085616805ed176b2114cdf4bd55.zip
accel/ivpu: Add dvfs_mode file to debugfs
Add new debugfs file to set dvfs_mode FW boot parameter and restart the FW to allow experimenting with DVFS (dynamic voltage & frequency scaling). Signed-off-by: Tomasz Rusinowicz <tomasz.rusinowicz@intel.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231028133415.1169975-4-stanislaw.gruszka@linux.intel.com
Diffstat (limited to 'drivers/accel/ivpu/ivpu_debugfs.c')
-rw-r--r--drivers/accel/ivpu/ivpu_debugfs.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c
index ea453b985b49..6e0d56823024 100644
--- a/drivers/accel/ivpu/ivpu_debugfs.c
+++ b/drivers/accel/ivpu/ivpu_debugfs.c
@@ -115,6 +115,31 @@ static const struct drm_debugfs_info vdev_debugfs_list[] = {
{"reset_pending", reset_pending_show, 0},
};
+static ssize_t
+dvfs_mode_fops_write(struct file *file, const char __user *user_buf, size_t size, loff_t *pos)
+{
+ struct ivpu_device *vdev = file->private_data;
+ struct ivpu_fw_info *fw = vdev->fw;
+ u32 dvfs_mode;
+ int ret;
+
+ ret = kstrtou32_from_user(user_buf, size, 0, &dvfs_mode);
+ if (ret < 0)
+ return ret;
+
+ fw->dvfs_mode = dvfs_mode;
+
+ ivpu_pm_schedule_recovery(vdev);
+
+ return size;
+}
+
+static const struct file_operations dvfs_mode_fops = {
+ .owner = THIS_MODULE,
+ .open = simple_open,
+ .write = dvfs_mode_fops_write,
+};
+
static int fw_log_show(struct seq_file *s, void *v)
{
struct ivpu_device *vdev = s->private;
@@ -280,6 +305,9 @@ void ivpu_debugfs_init(struct ivpu_device *vdev)
debugfs_create_file("force_recovery", 0200, debugfs_root, vdev,
&ivpu_force_recovery_fops);
+ debugfs_create_file("dvfs_mode", 0200, debugfs_root, vdev,
+ &dvfs_mode_fops);
+
debugfs_create_file("fw_log", 0644, debugfs_root, vdev,
&fw_log_fops);
debugfs_create_file("fw_trace_destination_mask", 0200, debugfs_root, vdev,