Lines Matching refs:hpriv
59 struct hl_fpriv *hpriv; in hpriv_release() local
62 hpriv = container_of(ref, struct hl_fpriv, refcount); in hpriv_release()
64 hdev = hpriv->hdev; in hpriv_release()
66 put_pid(hpriv->taskpid); in hpriv_release()
68 hl_debugfs_remove_file(hpriv); in hpriv_release()
70 mutex_destroy(&hpriv->restore_phase_mutex); in hpriv_release()
73 list_del(&hpriv->dev_node); in hpriv_release()
77 kfree(hpriv); in hpriv_release()
95 void hl_hpriv_get(struct hl_fpriv *hpriv) in hl_hpriv_get() argument
97 kref_get(&hpriv->refcount); in hl_hpriv_get()
100 int hl_hpriv_put(struct hl_fpriv *hpriv) in hl_hpriv_put() argument
102 return kref_put(&hpriv->refcount, hpriv_release); in hl_hpriv_put()
115 struct hl_fpriv *hpriv = filp->private_data; in hl_device_release() local
116 struct hl_device *hdev = hpriv->hdev; in hl_device_release()
122 put_pid(hpriv->taskpid); in hl_device_release()
129 hl_release_pending_user_interrupts(hpriv->hdev); in hl_device_release()
131 hl_cb_mgr_fini(hdev, &hpriv->cb_mgr); in hl_device_release()
132 hl_ctx_mgr_fini(hdev, &hpriv->ctx_mgr); in hl_device_release()
134 if (!hl_hpriv_put(hpriv)) in hl_device_release()
146 struct hl_fpriv *hpriv = filp->private_data; in hl_device_release_ctrl() local
147 struct hl_device *hdev = hpriv->hdev; in hl_device_release_ctrl()
157 list_del(&hpriv->dev_node); in hl_device_release_ctrl()
160 put_pid(hpriv->taskpid); in hl_device_release_ctrl()
162 kfree(hpriv); in hl_device_release_ctrl()
178 struct hl_fpriv *hpriv = filp->private_data; in hl_mmap() local
179 struct hl_device *hdev = hpriv->hdev; in hl_mmap()
192 return hl_cb_mmap(hpriv, vma); in hl_mmap()
195 return hl_hw_block_mmap(hpriv, vma); in hl_mmap()
822 struct hl_fpriv *hpriv; in device_kill_open_processes() local
851 list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node) { in device_kill_open_processes()
852 task = get_pid_task(hpriv->taskpid, PIDTYPE_PID); in device_kill_open_processes()
904 struct hl_fpriv *hpriv; in device_disable_open_processes() local
907 list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node) in device_disable_open_processes()
908 hpriv->hdev = NULL; in device_disable_open_processes()