Lines Matching defs:hdev
27 static int device_status_info(struct hl_device *hdev, struct hl_info_args *args)
36 dev_stat.status = hl_device_status(hdev);
42 static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args)
47 struct asic_fixed_properties *prop = &hdev->asic_prop;
58 hw_ip.device_id = hdev->asic_funcs->get_pci_id(hdev);
86 static int hw_events_info(struct hl_device *hdev, bool aggregate,
96 arr = hdev->asic_funcs->get_events_stat(hdev, aggregate, &size);
103 struct hl_device *hdev = hpriv->hdev;
107 struct asic_fixed_properties *prop = &hdev->asic_prop;
116 atomic64_read(&hdev->dram_used_mem);
125 static int hw_idle(struct hl_device *hdev, struct hl_info_args *args)
134 hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev,
143 static int debug_coresight(struct hl_device *hdev, struct hl_debug_args *args)
167 dev_err(hdev->dev, "failed to copy input debug data\n");
185 rc = hdev->asic_funcs->debug_coresight(hdev, params);
187 dev_err(hdev->dev,
194 dev_err(hdev->dev, "copy to user failed in debug ioctl\n");
208 static int device_utilization(struct hl_device *hdev, struct hl_info_args *args)
219 dev_err(hdev->dev,
225 device_util.utilization = hl_device_utilization(hdev, args->period_ms);
231 static int get_clk_rate(struct hl_device *hdev, struct hl_info_args *args)
241 rc = hdev->asic_funcs->get_clk_rate(hdev, &clk_rate.cur_clk_rate_mhz,
250 static int get_reset_count(struct hl_device *hdev, struct hl_info_args *args)
259 reset_count.hard_reset_cnt = hdev->hard_reset_cnt;
260 reset_count.soft_reset_cnt = hdev->soft_reset_cnt;
266 static int time_sync_info(struct hl_device *hdev, struct hl_info_args *args)
275 time_sync.device_time = hdev->asic_funcs->get_device_time(hdev);
284 struct hl_device *hdev = hpriv->hdev;
293 rc = hl_fw_cpucp_pci_counters_get(hdev, &pci_counters);
303 struct hl_device *hdev = hpriv->hdev;
311 clk_throttle.clk_throttling_reason = hdev->clk_throttling_reason;
319 struct hl_device *hdev = hpriv->hdev;
327 memcpy(&cs_counters.cs_counters, &hdev->aggregated_cs_counters,
340 struct hl_device *hdev = hpriv->hdev;
341 struct asic_fixed_properties *prop = &hdev->asic_prop;
365 struct hl_device *hdev = hpriv->hdev;
374 rc = hl_fw_cpucp_total_energy_get(hdev,
387 struct hl_device *hdev = hpriv->hdev;
396 return hw_ip_info(hdev, args);
399 return device_status_info(hdev, args);
402 return get_reset_count(hdev, args);
408 if (hl_device_disabled_or_in_reset(hdev)) {
411 atomic_read(&hdev->in_reset) ? "in_reset" : "disabled");
417 rc = hw_events_info(hdev, false, args);
425 rc = hw_idle(hdev, args);
429 rc = device_utilization(hdev, args);
433 rc = hw_events_info(hdev, true, args);
437 rc = get_clk_rate(hdev, args);
441 return time_sync_info(hdev, args);
469 return _hl_info_ioctl(hpriv, data, hpriv->hdev->dev);
474 return _hl_info_ioctl(hpriv, data, hpriv->hdev->dev_ctrl);
480 struct hl_device *hdev = hpriv->hdev;
483 if (hl_device_disabled_or_in_reset(hdev)) {
484 dev_warn_ratelimited(hdev->dev,
486 atomic_read(&hdev->in_reset) ? "in_reset" : "disabled");
498 if (!hdev->in_debug) {
499 dev_err_ratelimited(hdev->dev,
505 rc = debug_coresight(hdev, args);
508 rc = hl_device_set_debug_mode(hdev, (bool) args->enable);
511 dev_err(hdev->dev, "Invalid request %d\n", args->op);
539 struct hl_device *hdev = hpriv->hdev;
548 if (hdev->hard_reset_pending) {
549 dev_crit_ratelimited(hdev->dev_ctrl,
610 struct hl_device *hdev = hpriv->hdev;
617 dev_err(hdev->dev, "invalid ioctl: pid=%d, nr=0x%02x\n",
622 return _hl_ioctl(filep, cmd, arg, ioctl, hdev->dev);
628 struct hl_device *hdev = hpriv->hdev;
635 dev_err(hdev->dev_ctrl, "invalid ioctl: pid=%d, nr=0x%02x\n",
640 return _hl_ioctl(filep, cmd, arg, ioctl, hdev->dev_ctrl);