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>
This commit is contained in:

committed by
Oded Gabbay

parent
9354c29ed5
commit
aa957088b4
@@ -45,11 +45,18 @@ enum goya_queue_id {
|
||||
GOYA_QUEUE_ID_SIZE
|
||||
};
|
||||
|
||||
enum hl_device_status {
|
||||
HL_DEVICE_STATUS_OPERATIONAL,
|
||||
HL_DEVICE_STATUS_IN_RESET,
|
||||
HL_DEVICE_STATUS_MALFUNCTION
|
||||
};
|
||||
|
||||
/* Opcode for management ioctl */
|
||||
#define HL_INFO_HW_IP_INFO 0
|
||||
#define HL_INFO_HW_EVENTS 1
|
||||
#define HL_INFO_DRAM_USAGE 2
|
||||
#define HL_INFO_HW_IDLE 3
|
||||
#define HL_INFO_DEVICE_STATUS 4
|
||||
|
||||
#define HL_INFO_VERSION_MAX_LEN 128
|
||||
|
||||
@@ -82,6 +89,11 @@ struct hl_info_hw_idle {
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
struct hl_info_device_status {
|
||||
__u32 status;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
struct hl_info_args {
|
||||
/* Location of relevant struct in userspace */
|
||||
__u64 return_pointer;
|
||||
|
Reference in New Issue
Block a user