]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
accel/habanalabs: expose server type in debugfs
authorTal Risin <trisin@habana.ai>
Mon, 26 Feb 2024 09:56:35 +0000 (11:56 +0200)
committerOfir Bitton <obitton@habana.ai>
Sun, 23 Jun 2024 06:46:07 +0000 (09:46 +0300)
Exposing server type through debugfs to enable easier access via
scripts.

Signed-off-by: Tal Risin <trisin@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Documentation/ABI/testing/debugfs-driver-habanalabs
drivers/accel/habanalabs/common/debugfs.c

index a7a432dc40156c70e9f22280750a0a9246e6af9e..efbb78bedb8b5ea0c97bbf7c4941b4895d3d20f2 100644 (file)
@@ -253,6 +253,12 @@ Description:    Triggers dump of monitor data. The value to trigger the operatio
                 When the write is finished, the user can read the "monitor_dump"
                 blob
 
+What:           /sys/kernel/debug/accel/<parent_device>/server_type
+Date:           Feb 2024
+KernelVersion:  6.11
+Contact:        trisin@habana.ai
+Description:    Exposes the device's server type, maps to enum hl_server_type.
+
 What:           /sys/kernel/debug/accel/<parent_device>/set_power_state
 Date:           Jan 2019
 KernelVersion:  5.1
index de3ae2e47ec48e70ef638a439a6ca0315107dff5..ca7677293a55822f703a3a1cbf947c4c44fdc569 100644 (file)
@@ -1717,6 +1717,11 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent
                                root,
                                &hdev->device_release_watchdog_timeout_sec);
 
+       debugfs_create_u16("server_type",
+                               0444,
+                               root,
+                               &hdev->asic_prop.server_type);
+
        for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) {
                debugfs_create_file(hl_debugfs_list[i].name,
                                        0644,