Lines Matching refs:wq

20 	return idxd_chan->wq;  in to_idxd_wq()
62 static inline void idxd_prep_desc_common(struct idxd_wq *wq, in idxd_prep_desc_common() argument
84 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_submit_memcpy() local
86 struct idxd_device *idxd = wq->idxd; in idxd_dma_submit_memcpy()
89 if (wq->state != IDXD_WQ_ENABLED) in idxd_dma_submit_memcpy()
96 desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK); in idxd_dma_submit_memcpy()
100 idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_MEMMOVE, in idxd_dma_submit_memcpy()
111 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_alloc_chan_resources() local
112 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_alloc_chan_resources()
114 idxd_wq_get(wq); in idxd_dma_alloc_chan_resources()
116 idxd_wq_refcount(wq)); in idxd_dma_alloc_chan_resources()
122 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_free_chan_resources() local
123 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_free_chan_resources()
125 idxd_wq_put(wq); in idxd_dma_free_chan_resources()
127 idxd_wq_refcount(wq)); in idxd_dma_free_chan_resources()
148 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_tx_submit() local
155 rc = idxd_submit_desc(wq, desc); in idxd_dma_tx_submit()
218 int idxd_register_dma_channel(struct idxd_wq *wq) in idxd_register_dma_channel() argument
220 struct idxd_device *idxd = wq->idxd; in idxd_register_dma_channel()
235 for (i = 0; i < wq->num_descs; i++) { in idxd_register_dma_channel()
236 struct idxd_desc *desc = wq->descs[i]; in idxd_register_dma_channel()
248 wq->idxd_chan = idxd_chan; in idxd_register_dma_channel()
249 idxd_chan->wq = wq; in idxd_register_dma_channel()
250 get_device(wq_confdev(wq)); in idxd_register_dma_channel()
255 void idxd_unregister_dma_channel(struct idxd_wq *wq) in idxd_unregister_dma_channel() argument
257 struct idxd_dma_chan *idxd_chan = wq->idxd_chan; in idxd_unregister_dma_channel()
259 struct idxd_dma_dev *idxd_dma = wq->idxd->idxd_dma; in idxd_unregister_dma_channel()
263 kfree(wq->idxd_chan); in idxd_unregister_dma_channel()
264 wq->idxd_chan = NULL; in idxd_unregister_dma_channel()
265 put_device(wq_confdev(wq)); in idxd_unregister_dma_channel()
271 struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev); in idxd_dmaengine_drv_probe() local
272 struct idxd_device *idxd = wq->idxd; in idxd_dmaengine_drv_probe()
278 mutex_lock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
279 wq->type = IDXD_WQT_KERNEL; in idxd_dmaengine_drv_probe()
280 rc = __drv_enable_wq(wq); in idxd_dmaengine_drv_probe()
282 dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc); in idxd_dmaengine_drv_probe()
287 rc = idxd_wq_alloc_resources(wq); in idxd_dmaengine_drv_probe()
294 rc = idxd_wq_init_percpu_ref(wq); in idxd_dmaengine_drv_probe()
301 rc = idxd_register_dma_channel(wq); in idxd_dmaengine_drv_probe()
309 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
313 idxd_wq_quiesce(wq); in idxd_dmaengine_drv_probe()
314 percpu_ref_exit(&wq->wq_active); in idxd_dmaengine_drv_probe()
316 idxd_wq_free_resources(wq); in idxd_dmaengine_drv_probe()
318 __drv_disable_wq(wq); in idxd_dmaengine_drv_probe()
320 wq->type = IDXD_WQT_NONE; in idxd_dmaengine_drv_probe()
321 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
327 struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev); in idxd_dmaengine_drv_remove() local
329 mutex_lock(&wq->wq_lock); in idxd_dmaengine_drv_remove()
330 idxd_wq_quiesce(wq); in idxd_dmaengine_drv_remove()
331 idxd_unregister_dma_channel(wq); in idxd_dmaengine_drv_remove()
332 idxd_wq_free_resources(wq); in idxd_dmaengine_drv_remove()
333 __drv_disable_wq(wq); in idxd_dmaengine_drv_remove()
334 percpu_ref_exit(&wq->wq_active); in idxd_dmaengine_drv_remove()
335 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_remove()