Lines Matching full:args
36 static int device_status_info(struct hl_device *hdev, struct hl_info_args *args) in device_status_info() argument
39 u32 size = args->return_size; in device_status_info()
40 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in device_status_info()
51 static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) in hw_ip_info() argument
54 u32 size = args->return_size; in hw_ip_info()
55 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_ip_info()
122 struct hl_info_args *args) in hw_events_info() argument
124 u32 size, max_size = args->return_size; in hw_events_info()
125 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_events_info()
140 static int events_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in events_info() argument
142 u32 max_size = args->return_size; in events_info()
144 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in events_info()
157 static int dram_usage_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_usage_info() argument
161 u32 max_size = args->return_size; in dram_usage_info()
162 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_usage_info()
181 static int hw_idle(struct hl_device *hdev, struct hl_info_args *args) in hw_idle() argument
184 u32 max_size = args->return_size; in hw_idle()
185 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_idle()
200 static int debug_coresight(struct hl_device *hdev, struct hl_ctx *ctx, struct hl_debug_args *args) in debug_coresight() argument
210 params->reg_idx = args->reg_idx; in debug_coresight()
211 params->enable = args->enable; in debug_coresight()
212 params->op = args->op; in debug_coresight()
214 if (args->input_ptr && args->input_size) { in debug_coresight()
215 input = kzalloc(hl_debug_struct_size[args->op], GFP_KERNEL); in debug_coresight()
221 if (copy_from_user(input, u64_to_user_ptr(args->input_ptr), in debug_coresight()
222 args->input_size)) { in debug_coresight()
231 if (args->output_ptr && args->output_size) { in debug_coresight()
232 output = kzalloc(args->output_size, GFP_KERNEL); in debug_coresight()
239 params->output_size = args->output_size; in debug_coresight()
249 if (output && copy_to_user((void __user *) (uintptr_t) args->output_ptr, in debug_coresight()
250 output, args->output_size)) { in debug_coresight()
265 static int device_utilization(struct hl_device *hdev, struct hl_info_args *args) in device_utilization() argument
268 u32 max_size = args->return_size; in device_utilization()
269 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in device_utilization()
283 static int get_clk_rate(struct hl_device *hdev, struct hl_info_args *args) in get_clk_rate() argument
286 u32 max_size = args->return_size; in get_clk_rate()
287 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in get_clk_rate()
301 static int get_reset_count(struct hl_device *hdev, struct hl_info_args *args) in get_reset_count() argument
304 u32 max_size = args->return_size; in get_reset_count()
305 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in get_reset_count()
317 static int time_sync_info(struct hl_device *hdev, struct hl_info_args *args) in time_sync_info() argument
320 u32 max_size = args->return_size; in time_sync_info()
321 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in time_sync_info()
334 static int pci_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in pci_counters_info() argument
338 u32 max_size = args->return_size; in pci_counters_info()
339 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in pci_counters_info()
353 static int clk_throttle_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in clk_throttle_info() argument
355 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in clk_throttle_info()
359 u32 max_size = args->return_size; in clk_throttle_info()
392 static int cs_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in cs_counters_info() argument
394 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in cs_counters_info()
398 u32 max_size = args->return_size; in cs_counters_info()
443 static int sync_manager_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in sync_manager_info() argument
448 u32 max_size = args->return_size; in sync_manager_info()
449 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in sync_manager_info()
454 if (args->dcore_id >= HL_MAX_DCORES) in sync_manager_info()
458 prop->first_available_user_sob[args->dcore_id]; in sync_manager_info()
460 prop->first_available_user_mon[args->dcore_id]; in sync_manager_info()
462 prop->first_available_cq[args->dcore_id]; in sync_manager_info()
469 struct hl_info_args *args) in total_energy_consumption_info() argument
473 u32 max_size = args->return_size; in total_energy_consumption_info()
474 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in total_energy_consumption_info()
489 static int pll_frequency_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in pll_frequency_info() argument
493 u32 max_size = args->return_size; in pll_frequency_info()
494 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in pll_frequency_info()
500 rc = hl_fw_cpucp_pll_info_get(hdev, args->pll_index, freq_info.output); in pll_frequency_info()
508 static int power_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in power_info() argument
511 u32 max_size = args->return_size; in power_info()
513 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in power_info()
527 static int open_stats_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in open_stats_info() argument
530 u32 max_size = args->return_size; in open_stats_info()
532 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in open_stats_info()
547 static int dram_pending_rows_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_pending_rows_info() argument
550 u32 max_size = args->return_size; in dram_pending_rows_info()
552 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_pending_rows_info()
566 static int dram_replaced_rows_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_replaced_rows_info() argument
569 u32 max_size = args->return_size; in dram_replaced_rows_info()
571 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_replaced_rows_info()
584 static int last_err_open_dev_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in last_err_open_dev_info() argument
588 u32 max_size = args->return_size; in last_err_open_dev_info()
589 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in last_err_open_dev_info()
599 static int cs_timeout_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in cs_timeout_info() argument
603 u32 max_size = args->return_size; in cs_timeout_info()
604 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in cs_timeout_info()
615 static int razwi_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in razwi_info() argument
617 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in razwi_info()
619 u32 max_size = args->return_size; in razwi_info()
633 static int undefined_opcode_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in undefined_opcode_info() argument
636 u32 max_size = args->return_size; in undefined_opcode_info()
638 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in undefined_opcode_info()
655 static int dev_mem_alloc_page_sizes_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dev_mem_alloc_page_sizes_info() argument
657 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dev_mem_alloc_page_sizes_info()
660 u32 max_size = args->return_size; in dev_mem_alloc_page_sizes_info()
676 static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in sec_attest_info() argument
678 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in sec_attest_info()
681 u32 max_size = args->return_size; in sec_attest_info()
697 rc = hl_fw_get_sec_attest_info(hpriv->hdev, sec_attest_info, args->sec_attest_nonce); in sec_attest_info()
725 static int dev_info_signed(struct hl_fpriv *hpriv, struct hl_info_args *args) in dev_info_signed() argument
727 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dev_info_signed()
730 u32 max_size = args->return_size; in dev_info_signed()
747 dev_info_signed, args->sec_attest_nonce); in dev_info_signed()
772 static int eventfd_register(struct hl_fpriv *hpriv, struct hl_info_args *args) in eventfd_register() argument
783 hpriv->notifier_event.eventfd = eventfd_ctx_fdget(args->eventfd); in eventfd_register()
795 static int eventfd_unregister(struct hl_fpriv *hpriv, struct hl_info_args *args) in eventfd_unregister() argument
809 static int engine_status_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in engine_status_info() argument
811 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in engine_status_info()
812 u32 status_buf_size = args->return_size; in engine_status_info()
836 args->user_buffer_actual_size = eng_data.actual_size; in engine_status_info()
845 static int page_fault_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in page_fault_info() argument
847 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in page_fault_info()
849 u32 max_size = args->return_size; in page_fault_info()
863 static int user_mappings_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in user_mappings_info() argument
865 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in user_mappings_info()
866 u32 user_buf_size = args->return_size; in user_mappings_info()
878 args->array_size = pgf_info->num_of_user_mappings; in user_mappings_info()
887 static int hw_err_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in hw_err_info() argument
889 void __user *user_buf = (void __user *) (uintptr_t) args->return_pointer; in hw_err_info()
891 u32 user_buf_size = args->return_size; in hw_err_info()
909 static int fw_err_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in fw_err_info() argument
911 void __user *user_buf = (void __user *) (uintptr_t) args->return_pointer; in fw_err_info()
913 u32 user_buf_size = args->return_size; in fw_err_info()
931 static int engine_err_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in engine_err_info() argument
933 void __user *user_buf = (void __user *) (uintptr_t) args->return_pointer; in engine_err_info()
935 u32 user_buf_size = args->return_size; in engine_err_info()
1005 struct hl_info_args *args = data; in _hl_info_ioctl() local
1009 if (args->pad) { in _hl_info_ioctl()
1018 switch (args->op) { in _hl_info_ioctl()
1020 return hw_ip_info(hdev, args); in _hl_info_ioctl()
1023 return device_status_info(hdev, args); in _hl_info_ioctl()
1026 return get_reset_count(hdev, args); in _hl_info_ioctl()
1029 return hw_events_info(hdev, false, args); in _hl_info_ioctl()
1032 return hw_events_info(hdev, true, args); in _hl_info_ioctl()
1035 return cs_counters_info(hpriv, args); in _hl_info_ioctl()
1038 return clk_throttle_info(hpriv, args); in _hl_info_ioctl()
1041 return sync_manager_info(hpriv, args); in _hl_info_ioctl()
1044 return open_stats_info(hpriv, args); in _hl_info_ioctl()
1047 return last_err_open_dev_info(hpriv, args); in _hl_info_ioctl()
1050 return cs_timeout_info(hpriv, args); in _hl_info_ioctl()
1053 return razwi_info(hpriv, args); in _hl_info_ioctl()
1056 return undefined_opcode_info(hpriv, args); in _hl_info_ioctl()
1059 return dev_mem_alloc_page_sizes_info(hpriv, args); in _hl_info_ioctl()
1062 return events_info(hpriv, args); in _hl_info_ioctl()
1065 return page_fault_info(hpriv, args); in _hl_info_ioctl()
1068 return user_mappings_info(hpriv, args); in _hl_info_ioctl()
1071 return eventfd_unregister(hpriv, args); in _hl_info_ioctl()
1074 return hw_err_info(hpriv, args); in _hl_info_ioctl()
1077 return fw_err_info(hpriv, args); in _hl_info_ioctl()
1080 return engine_err_info(hpriv, args); in _hl_info_ioctl()
1083 return dram_usage_info(hpriv, args); in _hl_info_ioctl()
1095 switch (args->op) { in _hl_info_ioctl()
1097 rc = hw_idle(hdev, args); in _hl_info_ioctl()
1101 rc = device_utilization(hdev, args); in _hl_info_ioctl()
1105 rc = get_clk_rate(hdev, args); in _hl_info_ioctl()
1109 return time_sync_info(hdev, args); in _hl_info_ioctl()
1112 return pci_counters_info(hpriv, args); in _hl_info_ioctl()
1115 return total_energy_consumption_info(hpriv, args); in _hl_info_ioctl()
1118 return pll_frequency_info(hpriv, args); in _hl_info_ioctl()
1121 return power_info(hpriv, args); in _hl_info_ioctl()
1125 return dram_replaced_rows_info(hpriv, args); in _hl_info_ioctl()
1128 return dram_pending_rows_info(hpriv, args); in _hl_info_ioctl()
1131 return sec_attest_info(hpriv, args); in _hl_info_ioctl()
1134 return eventfd_register(hpriv, args); in _hl_info_ioctl()
1137 return engine_status_info(hpriv, args); in _hl_info_ioctl()
1140 return send_fw_generic_request(hdev, args); in _hl_info_ioctl()
1143 return dev_info_signed(hpriv, args); in _hl_info_ioctl()
1146 dev_err(dev, "Invalid request %d\n", args->op); in _hl_info_ioctl()
1163 struct hl_info_args *args = data; in hl_info_ioctl_control() local
1165 switch (args->op) { in hl_info_ioctl_control()
1181 struct hl_debug_args *args = data; in hl_debug_ioctl() local
1193 switch (args->op) { in hl_debug_ioctl()
1206 args->input_size = min(args->input_size, hl_debug_struct_size[args->op]); in hl_debug_ioctl()
1207 rc = debug_coresight(hdev, hpriv->ctx, args); in hl_debug_ioctl()
1211 rc = hl_device_set_debug_mode(hdev, hpriv->ctx, (bool) args->enable); in hl_debug_ioctl()
1215 dev_err(hdev->dev, "Invalid request %d\n", args->op); in hl_debug_ioctl()