Lines Matching full:args

30 static int device_status_info(struct hl_device *hdev, struct hl_info_args *args)  in device_status_info()  argument
33 u32 size = args->return_size; in device_status_info()
34 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in device_status_info()
45 static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) in hw_ip_info() argument
48 u32 size = args->return_size; in hw_ip_info()
49 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_ip_info()
114 struct hl_info_args *args) in hw_events_info() argument
116 u32 size, max_size = args->return_size; in hw_events_info()
117 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_events_info()
128 static int events_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in events_info() argument
130 u32 max_size = args->return_size; in events_info()
132 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in events_info()
145 static int dram_usage_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_usage_info() argument
149 u32 max_size = args->return_size; in dram_usage_info()
150 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_usage_info()
169 static int hw_idle(struct hl_device *hdev, struct hl_info_args *args) in hw_idle() argument
172 u32 max_size = args->return_size; in hw_idle()
173 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in hw_idle()
188 static int debug_coresight(struct hl_device *hdev, struct hl_ctx *ctx, struct hl_debug_args *args) in debug_coresight() argument
198 params->reg_idx = args->reg_idx; in debug_coresight()
199 params->enable = args->enable; in debug_coresight()
200 params->op = args->op; in debug_coresight()
202 if (args->input_ptr && args->input_size) { in debug_coresight()
203 input = kzalloc(hl_debug_struct_size[args->op], GFP_KERNEL); in debug_coresight()
209 if (copy_from_user(input, u64_to_user_ptr(args->input_ptr), in debug_coresight()
210 args->input_size)) { in debug_coresight()
219 if (args->output_ptr && args->output_size) { in debug_coresight()
220 output = kzalloc(args->output_size, GFP_KERNEL); in debug_coresight()
227 params->output_size = args->output_size; in debug_coresight()
237 if (output && copy_to_user((void __user *) (uintptr_t) args->output_ptr, in debug_coresight()
238 output, args->output_size)) { in debug_coresight()
253 static int device_utilization(struct hl_device *hdev, struct hl_info_args *args) in device_utilization() argument
256 u32 max_size = args->return_size; in device_utilization()
257 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in device_utilization()
271 static int get_clk_rate(struct hl_device *hdev, struct hl_info_args *args) in get_clk_rate() argument
274 u32 max_size = args->return_size; in get_clk_rate()
275 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in get_clk_rate()
289 static int get_reset_count(struct hl_device *hdev, struct hl_info_args *args) in get_reset_count() argument
292 u32 max_size = args->return_size; in get_reset_count()
293 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in get_reset_count()
305 static int time_sync_info(struct hl_device *hdev, struct hl_info_args *args) in time_sync_info() argument
308 u32 max_size = args->return_size; in time_sync_info()
309 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in time_sync_info()
321 static int pci_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in pci_counters_info() argument
325 u32 max_size = args->return_size; in pci_counters_info()
326 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in pci_counters_info()
340 static int clk_throttle_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in clk_throttle_info() argument
342 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in clk_throttle_info()
346 u32 max_size = args->return_size; in clk_throttle_info()
379 static int cs_counters_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in cs_counters_info() argument
381 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in cs_counters_info()
385 u32 max_size = args->return_size; in cs_counters_info()
430 static int sync_manager_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in sync_manager_info() argument
435 u32 max_size = args->return_size; in sync_manager_info()
436 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in sync_manager_info()
441 if (args->dcore_id >= HL_MAX_DCORES) in sync_manager_info()
445 prop->first_available_user_sob[args->dcore_id]; in sync_manager_info()
447 prop->first_available_user_mon[args->dcore_id]; in sync_manager_info()
449 prop->first_available_cq[args->dcore_id]; in sync_manager_info()
456 struct hl_info_args *args) in total_energy_consumption_info() argument
460 u32 max_size = args->return_size; in total_energy_consumption_info()
461 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in total_energy_consumption_info()
476 static int pll_frequency_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in pll_frequency_info() argument
480 u32 max_size = args->return_size; in pll_frequency_info()
481 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in pll_frequency_info()
487 rc = hl_fw_cpucp_pll_info_get(hdev, args->pll_index, freq_info.output); in pll_frequency_info()
495 static int power_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in power_info() argument
498 u32 max_size = args->return_size; in power_info()
500 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in power_info()
514 static int open_stats_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in open_stats_info() argument
517 u32 max_size = args->return_size; in open_stats_info()
519 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in open_stats_info()
534 static int dram_pending_rows_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_pending_rows_info() argument
537 u32 max_size = args->return_size; in dram_pending_rows_info()
539 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_pending_rows_info()
553 static int dram_replaced_rows_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in dram_replaced_rows_info() argument
556 u32 max_size = args->return_size; in dram_replaced_rows_info()
558 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dram_replaced_rows_info()
571 static int last_err_open_dev_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in last_err_open_dev_info() argument
575 u32 max_size = args->return_size; in last_err_open_dev_info()
576 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in last_err_open_dev_info()
586 static int cs_timeout_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in cs_timeout_info() argument
590 u32 max_size = args->return_size; in cs_timeout_info()
591 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in cs_timeout_info()
602 static int razwi_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in razwi_info() argument
605 u32 max_size = args->return_size; in razwi_info()
607 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in razwi_info()
622 static int undefined_opcode_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in undefined_opcode_info() argument
625 u32 max_size = args->return_size; in undefined_opcode_info()
627 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in undefined_opcode_info()
644 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
646 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in dev_mem_alloc_page_sizes_info()
649 u32 max_size = args->return_size; in dev_mem_alloc_page_sizes_info()
665 static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in sec_attest_info() argument
667 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in sec_attest_info()
670 u32 max_size = args->return_size; in sec_attest_info()
686 rc = hl_fw_get_sec_attest_info(hpriv->hdev, sec_attest_info, args->sec_attest_nonce); in sec_attest_info()
714 static int eventfd_register(struct hl_fpriv *hpriv, struct hl_info_args *args) in eventfd_register() argument
725 hpriv->notifier_event.eventfd = eventfd_ctx_fdget(args->eventfd); in eventfd_register()
737 static int eventfd_unregister(struct hl_fpriv *hpriv, struct hl_info_args *args) in eventfd_unregister() argument
751 static int engine_status_info(struct hl_fpriv *hpriv, struct hl_info_args *args) in engine_status_info() argument
753 void __user *out = (void __user *) (uintptr_t) args->return_pointer; in engine_status_info()
754 u32 status_buf_size = args->return_size; in engine_status_info()
778 args->user_buffer_actual_size = eng_data.actual_size; in engine_status_info()
791 struct hl_info_args *args = data; in _hl_info_ioctl() local
800 switch (args->op) { in _hl_info_ioctl()
802 return hw_ip_info(hdev, args); in _hl_info_ioctl()
805 return device_status_info(hdev, args); in _hl_info_ioctl()
808 return get_reset_count(hdev, args); in _hl_info_ioctl()
811 return hw_events_info(hdev, false, args); in _hl_info_ioctl()
814 return hw_events_info(hdev, true, args); in _hl_info_ioctl()
817 return cs_counters_info(hpriv, args); in _hl_info_ioctl()
820 return clk_throttle_info(hpriv, args); in _hl_info_ioctl()
823 return sync_manager_info(hpriv, args); in _hl_info_ioctl()
826 return open_stats_info(hpriv, args); in _hl_info_ioctl()
829 return last_err_open_dev_info(hpriv, args); in _hl_info_ioctl()
832 return cs_timeout_info(hpriv, args); in _hl_info_ioctl()
835 return razwi_info(hpriv, args); in _hl_info_ioctl()
838 return undefined_opcode_info(hpriv, args); in _hl_info_ioctl()
841 return dev_mem_alloc_page_sizes_info(hpriv, args); in _hl_info_ioctl()
844 return events_info(hpriv, args); in _hl_info_ioctl()
857 switch (args->op) { in _hl_info_ioctl()
859 rc = dram_usage_info(hpriv, args); in _hl_info_ioctl()
863 rc = hw_idle(hdev, args); in _hl_info_ioctl()
867 rc = device_utilization(hdev, args); in _hl_info_ioctl()
871 rc = get_clk_rate(hdev, args); in _hl_info_ioctl()
875 return time_sync_info(hdev, args); in _hl_info_ioctl()
878 return pci_counters_info(hpriv, args); in _hl_info_ioctl()
881 return total_energy_consumption_info(hpriv, args); in _hl_info_ioctl()
884 return pll_frequency_info(hpriv, args); in _hl_info_ioctl()
887 return power_info(hpriv, args); in _hl_info_ioctl()
891 return dram_replaced_rows_info(hpriv, args); in _hl_info_ioctl()
894 return dram_pending_rows_info(hpriv, args); in _hl_info_ioctl()
897 return sec_attest_info(hpriv, args); in _hl_info_ioctl()
900 return eventfd_register(hpriv, args); in _hl_info_ioctl()
903 return eventfd_unregister(hpriv, args); in _hl_info_ioctl()
906 return engine_status_info(hpriv, args); in _hl_info_ioctl()
909 dev_err(dev, "Invalid request %d\n", args->op); in _hl_info_ioctl()
929 struct hl_debug_args *args = data; in hl_debug_ioctl() local
942 switch (args->op) { in hl_debug_ioctl()
955 args->input_size = min(args->input_size, hl_debug_struct_size[args->op]); in hl_debug_ioctl()
956 rc = debug_coresight(hdev, hpriv->ctx, args); in hl_debug_ioctl()
960 rc = hl_device_set_debug_mode(hdev, hpriv->ctx, (bool) args->enable); in hl_debug_ioctl()
964 dev_err(hdev->dev, "Invalid request %d\n", args->op); in hl_debug_ioctl()