mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 17:57:38 -04:00
habanalabs: Add INFO IOCTL opcode for time sync information
Add a new opcode to the INFO IOCTL that retrieves the device time alongside the host time, to allow a user application that want to measure device time together with host time (such as a profiler) to synchronize these times. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
This commit is contained in:
@@ -101,6 +101,8 @@ enum hl_device_status {
|
||||
* HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
|
||||
* operations performed on the device since the last
|
||||
* time the driver was loaded.
|
||||
* HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
|
||||
* for synchronization.
|
||||
*/
|
||||
#define HL_INFO_HW_IP_INFO 0
|
||||
#define HL_INFO_HW_EVENTS 1
|
||||
@@ -111,6 +113,7 @@ enum hl_device_status {
|
||||
#define HL_INFO_HW_EVENTS_AGGREGATE 7
|
||||
#define HL_INFO_CLK_RATE 8
|
||||
#define HL_INFO_RESET_COUNT 9
|
||||
#define HL_INFO_TIME_SYNC 10
|
||||
|
||||
#define HL_INFO_VERSION_MAX_LEN 128
|
||||
#define HL_INFO_CARD_NAME_MAX_LEN 16
|
||||
@@ -169,6 +172,11 @@ struct hl_info_reset_count {
|
||||
__u32 soft_reset_cnt;
|
||||
};
|
||||
|
||||
struct hl_info_time_sync {
|
||||
__u64 device_time;
|
||||
__u64 host_time;
|
||||
};
|
||||
|
||||
struct hl_info_args {
|
||||
/* Location of relevant struct in userspace */
|
||||
__u64 return_pointer;
|
||||
|
||||
Reference in New Issue
Block a user