]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
habanalabs: extend busy engines mask to 64 bits
authorfarah kassabri <fkassabri@habana.ai>
Wed, 12 Aug 2020 14:20:13 +0000 (17:20 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 22 Sep 2020 15:49:50 +0000 (18:49 +0300)
change busy engines bitmask to 64 bits in order to represent
more engines, needed for future ASIC support.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/habanalabs_ioctl.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c
include/uapi/misc/habanalabs.h

index 2fd268e4cf10259de9b349ee39bef2981eb79d87..fbdf105c4bb2efb24810bb703c6ea9704329c131 100644 (file)
@@ -754,7 +754,7 @@ struct hl_asic_funcs {
        void (*set_clock_gating)(struct hl_device *hdev);
        void (*disable_clock_gating)(struct hl_device *hdev);
        int (*debug_coresight)(struct hl_device *hdev, void *data);
-       bool (*is_device_idle)(struct hl_device *hdev, u32 *mask,
+       bool (*is_device_idle)(struct hl_device *hdev, u64 *mask,
                                struct seq_file *s);
        int (*soft_reset_late_init)(struct hl_device *hdev);
        void (*hw_queues_lock)(struct hl_device *hdev);
index fe6c5534d378bbe56491f7ba622c69a6b888a463..a9480001424332e0e712cced02f38af60c93f230 100644 (file)
@@ -132,7 +132,7 @@ static int hw_idle(struct hl_device *hdev, struct hl_info_args *args)
                return -EINVAL;
 
        hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev,
-                                       &hw_idle.busy_engines_mask, NULL);
+                                       &hw_idle.busy_engines_mask_ext, NULL);
 
        return copy_to_user(out, &hw_idle,
                min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0;
index a0932261e67cff3a19369c5093526364f36ff429..ba964a316b0b8f877c57f20e838f643e8c47b2eb 100644 (file)
@@ -6083,7 +6083,7 @@ static int gaudi_armcp_info_get(struct hl_device *hdev)
        return 0;
 }
 
-static bool gaudi_is_device_idle(struct hl_device *hdev, u32 *mask,
+static bool gaudi_is_device_idle(struct hl_device *hdev, u64 *mask,
                                        struct seq_file *s)
 {
        struct gaudi_device *gaudi = hdev->asic_specific;
index ac4d44fa56e471165e2f166b6a7878cda16c120a..5fb3565c80c565913dbcc7e09f15fce4220d408e 100644 (file)
@@ -5148,7 +5148,7 @@ static void goya_disable_clock_gating(struct hl_device *hdev)
        /* clock gating not supported in Goya */
 }
 
-static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask,
+static bool goya_is_device_idle(struct hl_device *hdev, u64 *mask,
                                struct seq_file *s)
 {
        const char *fmt = "%-5d%-9s%#-14x%#-16x%#x\n";
index ca6dc1fc250ecd2e34081d446575c5df4acbfc1f..693081728ef390b3e727703698b1b7da8b4d735f 100644 (file)
@@ -319,6 +319,12 @@ struct hl_info_hw_idle {
         * Bits definition is according to `enum <chip>_enging_id'.
         */
        __u32 busy_engines_mask;
+
+       /*
+        * Extended Bitmask of busy engines.
+        * Bits definition is according to `enum <chip>_enging_id'.
+        */
+       __u64 busy_engines_mask_ext;
 };
 
 struct hl_info_device_status {