aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/misc
diff options
context:
space:
mode:
authorDalit Ben Zoor <dbenzoor@habana.ai>2019-03-24 04:15:44 -0400
committerOded Gabbay <oded.gabbay@gmail.com>2019-03-24 04:15:44 -0400
commitaa957088b4e846146b230e431dd9dad59e907f9a (patch)
tree26f0a463b800b7945a86eb0230cef65c8129e722 /include/uapi/misc
parent9354c29ed52762e9645d6dc2631045228ed10fbd (diff)
habanalabs: add device status option to INFO IOCTL
This patch adds a new opcode to INFO IOCTL that returns the device status. This will allow users to query the device status in order to avoid sending command submissions while device is in reset. Signed-off-by: Dalit Ben Zoor <dbenzoor@habana.ai> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'include/uapi/misc')
-rw-r--r--include/uapi/misc/habanalabs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h
index ab1957e31077..993a79edad73 100644
--- a/include/uapi/misc/habanalabs.h
+++ b/include/uapi/misc/habanalabs.h
@@ -45,11 +45,18 @@ enum goya_queue_id {
45 GOYA_QUEUE_ID_SIZE 45 GOYA_QUEUE_ID_SIZE
46}; 46};
47 47
48enum hl_device_status {
49 HL_DEVICE_STATUS_OPERATIONAL,
50 HL_DEVICE_STATUS_IN_RESET,
51 HL_DEVICE_STATUS_MALFUNCTION
52};
53
48/* Opcode for management ioctl */ 54/* Opcode for management ioctl */
49#define HL_INFO_HW_IP_INFO 0 55#define HL_INFO_HW_IP_INFO 0
50#define HL_INFO_HW_EVENTS 1 56#define HL_INFO_HW_EVENTS 1
51#define HL_INFO_DRAM_USAGE 2 57#define HL_INFO_DRAM_USAGE 2
52#define HL_INFO_HW_IDLE 3 58#define HL_INFO_HW_IDLE 3
59#define HL_INFO_DEVICE_STATUS 4
53 60
54#define HL_INFO_VERSION_MAX_LEN 128 61#define HL_INFO_VERSION_MAX_LEN 128
55 62
@@ -82,6 +89,11 @@ struct hl_info_hw_idle {
82 __u32 pad; 89 __u32 pad;
83}; 90};
84 91
92struct hl_info_device_status {
93 __u32 status;
94 __u32 pad;
95};
96
85struct hl_info_args { 97struct hl_info_args {
86 /* Location of relevant struct in userspace */ 98 /* Location of relevant struct in userspace */
87 __u64 return_pointer; 99 __u64 return_pointer;