Re: [PATCH 09/29] accel/ivpu: Add FW version debugfs entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/24/2024 2:17 AM, Jacek Lawrynowicz wrote:
From: Karol Wachowski <karol.wachowski@xxxxxxxxx>

Add debugfs that prints current firmware version string on read.

Signed-off-by: Karol Wachowski <karol.wachowski@xxxxxxxxx>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@xxxxxxxxxxxxxxx>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@xxxxxxxxxxxxxxx>
---
  drivers/accel/ivpu/ivpu_debugfs.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)

diff --git a/drivers/accel/ivpu/ivpu_debugfs.c b/drivers/accel/ivpu/ivpu_debugfs.c
index cd3ac08f0409a..65245f45cc701 100644
--- a/drivers/accel/ivpu/ivpu_debugfs.c
+++ b/drivers/accel/ivpu/ivpu_debugfs.c
@@ -4,6 +4,7 @@
   */
#include <linux/debugfs.h>
+#include <linux/firmware.h>
#include <drm/drm_debugfs.h>
  #include <drm/drm_file.h>
@@ -20,6 +21,8 @@
  #include "ivpu_jsm_msg.h"
  #include "ivpu_pm.h"
+#include "vpu_boot_api.h"
+
  static inline struct ivpu_device *seq_to_ivpu(struct seq_file *s)
  {
  	struct drm_debugfs_entry *entry = s->private;
@@ -45,6 +48,14 @@ static int fw_name_show(struct seq_file *s, void *v)
  	return 0;
  }
+static int fw_version_show(struct seq_file *s, void *v)
+{
+	struct ivpu_device *vdev = seq_to_ivpu(s);
+
+	seq_printf(s, "%s\n", (const char *)vdev->fw->file->data + VPU_FW_HEADER_SIZE);

This FW file comes from userspace. Is there a check somewhere else that this string is properly NULL terminated as expected?




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux