Lines Matching refs:hpriv
140 struct hl_fpriv *hpriv;
153 hpriv = kzalloc(sizeof(*hpriv), GFP_KERNEL);
154 if (!hpriv)
157 hpriv->hdev = hdev;
158 filp->private_data = hpriv;
159 hpriv->filp = filp;
161 mutex_init(&hpriv->notifier_event.lock);
162 mutex_init(&hpriv->restore_phase_mutex);
163 mutex_init(&hpriv->ctx_lock);
164 kref_init(&hpriv->refcount);
167 hl_ctx_mgr_init(&hpriv->ctx_mgr);
168 hl_mem_mgr_init(hpriv->hdev->dev, &hpriv->mem_mgr);
170 hpriv->taskpid = get_task_pid(current, PIDTYPE_PID);
212 rc = hl_ctx_create(hdev, hpriv);
218 list_add(&hpriv->dev_node, &hdev->fpriv_list);
223 hl_debugfs_add_file(hpriv);
235 hl_mem_mgr_fini(&hpriv->mem_mgr);
236 hl_mem_mgr_idr_destroy(&hpriv->mem_mgr);
237 hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr);
239 mutex_destroy(&hpriv->ctx_lock);
240 mutex_destroy(&hpriv->restore_phase_mutex);
241 mutex_destroy(&hpriv->notifier_event.lock);
242 put_pid(hpriv->taskpid);
244 kfree(hpriv);
252 struct hl_fpriv *hpriv;
265 hpriv = kzalloc(sizeof(*hpriv), GFP_KERNEL);
266 if (!hpriv)
269 /* Prevent other routines from reading partial hpriv data by
270 * initializing hpriv fields before inserting it to the list
272 hpriv->hdev = hdev;
273 filp->private_data = hpriv;
274 hpriv->filp = filp;
276 mutex_init(&hpriv->notifier_event.lock);
279 hpriv->taskpid = get_task_pid(current, PIDTYPE_PID);
291 list_add(&hpriv->dev_node, &hdev->fpriv_ctrl_list);
299 put_pid(hpriv->taskpid);
301 kfree(hpriv);