Lines Matching full:wq

20 	return idxd_chan->wq;  in to_idxd_wq()
27 struct idxd_device *idxd = desc->wq->idxd; in idxd_dma_complete_txd()
56 idxd_free_desc(desc->wq, desc); in idxd_dma_complete_txd()
66 static inline void idxd_prep_desc_common(struct idxd_wq *wq, in idxd_prep_desc_common() argument
77 * For dedicated WQ, this field is ignored and HW will use the WQCFG.priv in idxd_prep_desc_common()
88 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_prep_interrupt() local
92 if (wq->state != IDXD_WQ_ENABLED) in idxd_dma_prep_interrupt()
96 desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK); in idxd_dma_prep_interrupt()
100 idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_NOOP, in idxd_dma_prep_interrupt()
110 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_submit_memcpy() local
112 struct idxd_device *idxd = wq->idxd; in idxd_dma_submit_memcpy()
115 if (wq->state != IDXD_WQ_ENABLED) in idxd_dma_submit_memcpy()
122 desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK); in idxd_dma_submit_memcpy()
126 idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_MEMMOVE, in idxd_dma_submit_memcpy()
137 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_alloc_chan_resources() local
138 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_alloc_chan_resources()
140 idxd_wq_get(wq); in idxd_dma_alloc_chan_resources()
142 idxd_wq_refcount(wq)); in idxd_dma_alloc_chan_resources()
148 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_free_chan_resources() local
149 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_free_chan_resources()
151 idxd_wq_put(wq); in idxd_dma_free_chan_resources()
153 idxd_wq_refcount(wq)); in idxd_dma_free_chan_resources()
174 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_tx_submit() local
181 rc = idxd_submit_desc(wq, desc); in idxd_dma_tx_submit()
183 idxd_free_desc(wq, desc); in idxd_dma_tx_submit()
248 static int idxd_register_dma_channel(struct idxd_wq *wq) in idxd_register_dma_channel() argument
250 struct idxd_device *idxd = wq->idxd; in idxd_register_dma_channel()
265 for (i = 0; i < wq->num_descs; i++) { in idxd_register_dma_channel()
266 struct idxd_desc *desc = wq->descs[i]; in idxd_register_dma_channel()
278 wq->idxd_chan = idxd_chan; in idxd_register_dma_channel()
279 idxd_chan->wq = wq; in idxd_register_dma_channel()
280 get_device(wq_confdev(wq)); in idxd_register_dma_channel()
285 static void idxd_unregister_dma_channel(struct idxd_wq *wq) in idxd_unregister_dma_channel() argument
287 struct idxd_dma_chan *idxd_chan = wq->idxd_chan; in idxd_unregister_dma_channel()
289 struct idxd_dma_dev *idxd_dma = wq->idxd->idxd_dma; in idxd_unregister_dma_channel()
293 kfree(wq->idxd_chan); in idxd_unregister_dma_channel()
294 wq->idxd_chan = NULL; in idxd_unregister_dma_channel()
295 put_device(wq_confdev(wq)); in idxd_unregister_dma_channel()
301 struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev); in idxd_dmaengine_drv_probe() local
302 struct idxd_device *idxd = wq->idxd; in idxd_dmaengine_drv_probe()
308 mutex_lock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
309 if (!idxd_wq_driver_name_match(wq, dev)) { in idxd_dmaengine_drv_probe()
315 wq->type = IDXD_WQT_KERNEL; in idxd_dmaengine_drv_probe()
317 rc = idxd_drv_enable_wq(wq); in idxd_dmaengine_drv_probe()
319 dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc); in idxd_dmaengine_drv_probe()
324 rc = idxd_register_dma_channel(wq); in idxd_dmaengine_drv_probe()
332 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
336 idxd_drv_disable_wq(wq); in idxd_dmaengine_drv_probe()
338 wq->type = IDXD_WQT_NONE; in idxd_dmaengine_drv_probe()
339 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_probe()
345 struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev); in idxd_dmaengine_drv_remove() local
347 mutex_lock(&wq->wq_lock); in idxd_dmaengine_drv_remove()
348 __idxd_wq_quiesce(wq); in idxd_dmaengine_drv_remove()
349 idxd_unregister_dma_channel(wq); in idxd_dmaengine_drv_remove()
350 idxd_drv_disable_wq(wq); in idxd_dmaengine_drv_remove()
351 mutex_unlock(&wq->wq_lock); in idxd_dmaengine_drv_remove()