accel/habanalabs: allow getting HL_INFO_DRAM_USAGE during soft-reset
authorDafna Hirschfeld <dhirschfeld@habana.ai>
Mon, 27 Feb 2023 06:22:54 +0000 (08:22 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 15 Mar 2023 11:29:15 +0000 (13:29 +0200)
We can allow userspace to query the dram usage during soft-reset.

Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/habanalabs_ioctl.c

index 100282fc82fc4f3432900d8f80a8eb10f8a1d677..0997ede359d77c58117bc4f3c9a2d793f97544be 100644 (file)
@@ -1002,6 +1002,8 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data,
        case HL_INFO_FW_ERR_EVENT:
                return fw_err_info(hpriv, args);
 
+       case HL_INFO_DRAM_USAGE:
+               return dram_usage_info(hpriv, args);
        default:
                break;
        }
@@ -1014,10 +1016,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data,
        }
 
        switch (args->op) {
-       case HL_INFO_DRAM_USAGE:
-               rc = dram_usage_info(hpriv, args);
-               break;
-
        case HL_INFO_HW_IDLE:
                rc = hw_idle(hdev, args);
                break;