Lines Matching refs:desc

360 	struct dma_pl330_desc *desc;  member
552 struct dma_pl330_desc *desc; member
561 return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL; in _queue_full()
1005 struct dma_pl330_desc *desc; in _trigger() local
1016 if (thrd->req[idx].desc != NULL) { in _trigger()
1020 if (thrd->req[idx].desc != NULL) in _trigger()
1034 desc = req->desc; in _trigger()
1036 ns = desc->rqcfg.nonsecure ? 1 : 0; in _trigger()
1099 struct pl330_config *pcfg = pxs->desc->rqcfg.pcfg; in _ldst_memtomem()
1197 off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri); in _ldst_peripheral()
1199 off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri); in _ldst_peripheral()
1200 off += _emit_load(dry_run, &buf[off], cond, pxs->desc->rqtype, in _ldst_peripheral()
1201 pxs->desc->peri); in _ldst_peripheral()
1202 off += _emit_store(dry_run, &buf[off], cond, pxs->desc->rqtype, in _ldst_peripheral()
1203 pxs->desc->peri); in _ldst_peripheral()
1218 switch (pxs->desc->rqtype) { in _bursts()
1267 switch (pxs->desc->rqtype) { in _dregs()
1375 struct pl330_xfer *x = &pxs->desc->px; in _setup_loops()
1396 struct pl330_xfer *x = &pxs->desc->px; in _setup_xfer()
1475 struct dma_pl330_desc *desc) in pl330_submit_req() argument
1484 switch (desc->rqtype) { in pl330_submit_req()
1506 if (desc->rqtype != DMA_MEM_TO_MEM && in pl330_submit_req()
1507 desc->peri >= pl330->pcfg.num_peri) { in pl330_submit_req()
1510 __func__, __LINE__, desc->peri); in pl330_submit_req()
1523 desc->rqcfg.nonsecure = 0; in pl330_submit_req()
1525 desc->rqcfg.nonsecure = 1; in pl330_submit_req()
1527 ccr = _prepare_ccr(&desc->rqcfg); in pl330_submit_req()
1529 idx = thrd->req[0].desc == NULL ? 0 : 1; in pl330_submit_req()
1532 xs.desc = desc; in pl330_submit_req()
1546 thrd->req[idx].desc = desc; in pl330_submit_req()
1557 static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err) in dma_pl330_rqcb() argument
1562 if (!desc) in dma_pl330_rqcb()
1565 pch = desc->pchan; in dma_pl330_rqcb()
1573 desc->status = DONE; in dma_pl330_rqcb()
1620 dma_pl330_rqcb(thrd->req[1 - thrd->lstenq].desc, err); in pl330_dotask()
1621 dma_pl330_rqcb(thrd->req[thrd->lstenq].desc, err); in pl330_dotask()
1624 thrd->req[0].desc = NULL; in pl330_dotask()
1625 thrd->req[1].desc = NULL; in pl330_dotask()
1705 descdone = thrd->req[active].desc; in pl330_update()
1706 thrd->req[active].desc = NULL; in pl330_update()
1782 thrd->req[0].desc = NULL; in pl330_request_channel()
1783 thrd->req[1].desc = NULL; in pl330_request_channel()
1812 dma_pl330_rqcb(thrd->req[1 - thrd->lstenq].desc, PL330_ERR_ABORT); in pl330_release_channel()
1813 dma_pl330_rqcb(thrd->req[thrd->lstenq].desc, PL330_ERR_ABORT); in pl330_release_channel()
1872 thrd->req[0].desc = NULL; in _reset_thread()
1878 thrd->req[1].desc = NULL; in _reset_thread()
2044 struct dma_pl330_desc *desc; in fill_queue() local
2047 list_for_each_entry(desc, &pch->work_list, node) { in fill_queue()
2050 if (desc->status == BUSY || desc->status == PAUSED) in fill_queue()
2053 ret = pl330_submit_req(pch->thread, desc); in fill_queue()
2055 desc->status = BUSY; in fill_queue()
2061 desc->status = DONE; in fill_queue()
2063 __func__, __LINE__, desc->txd.cookie); in fill_queue()
2072 struct dma_pl330_desc *desc, *_dt; in pl330_tasklet() local
2079 list_for_each_entry_safe(desc, _dt, &pch->work_list, node) in pl330_tasklet()
2080 if (desc->status == DONE) { in pl330_tasklet()
2082 dma_cookie_complete(&desc->txd); in pl330_tasklet()
2083 list_move_tail(&desc->node, &pch->completed_list); in pl330_tasklet()
2105 desc = list_first_entry(&pch->completed_list, in pl330_tasklet()
2108 dmaengine_desc_get_callback(&desc->txd, &cb); in pl330_tasklet()
2111 desc->status = PREP; in pl330_tasklet()
2112 list_move_tail(&desc->node, &pch->work_list); in pl330_tasklet()
2121 desc->status = FREE; in pl330_tasklet()
2122 list_move_tail(&desc->node, &pch->dmac->desc_pool); in pl330_tasklet()
2125 dma_descriptor_unmap(&desc->txd); in pl330_tasklet()
2283 struct dma_pl330_desc *desc; in pl330_terminate_all() local
2293 pch->thread->req[0].desc = NULL; in pl330_terminate_all()
2294 pch->thread->req[1].desc = NULL; in pl330_terminate_all()
2302 list_for_each_entry(desc, &pch->submitted_list, node) { in pl330_terminate_all()
2303 desc->status = FREE; in pl330_terminate_all()
2304 dma_cookie_complete(&desc->txd); in pl330_terminate_all()
2307 list_for_each_entry(desc, &pch->work_list , node) { in pl330_terminate_all()
2308 desc->status = FREE; in pl330_terminate_all()
2309 dma_cookie_complete(&desc->txd); in pl330_terminate_all()
2335 struct dma_pl330_desc *desc; in pl330_pause() local
2345 list_for_each_entry(desc, &pch->work_list, node) { in pl330_pause()
2346 if (desc->status == BUSY) in pl330_pause()
2347 desc->status = PAUSED; in pl330_pause()
2380 struct dma_pl330_desc *desc) in pl330_get_current_xferred_count() argument
2389 if (desc->rqcfg.src_inc) { in pl330_get_current_xferred_count()
2391 addr = desc->px.src_addr; in pl330_get_current_xferred_count()
2394 addr = desc->px.dst_addr; in pl330_get_current_xferred_count()
2412 struct dma_pl330_desc *desc, *running = NULL, *last_enq = NULL; in pl330_tx_status() local
2428 running = pch->thread->req[pch->thread->req_running].desc; in pl330_tx_status()
2430 last_enq = pch->thread->req[pch->thread->lstenq].desc; in pl330_tx_status()
2433 list_for_each_entry(desc, &pch->work_list, node) { in pl330_tx_status()
2434 if (desc->status == DONE) in pl330_tx_status()
2435 transferred = desc->bytes_requested; in pl330_tx_status()
2436 else if (running && desc == running) in pl330_tx_status()
2438 pl330_get_current_xferred_count(pch, desc); in pl330_tx_status()
2439 else if (desc->status == BUSY || desc->status == PAUSED) in pl330_tx_status()
2444 if (desc == last_enq) in pl330_tx_status()
2447 transferred = desc->bytes_requested; in pl330_tx_status()
2450 residual += desc->bytes_requested - transferred; in pl330_tx_status()
2451 if (desc->txd.cookie == cookie) { in pl330_tx_status()
2452 switch (desc->status) { in pl330_tx_status()
2468 if (desc->last) in pl330_tx_status()
2509 struct dma_pl330_desc *desc, *last = to_desc(tx); in pl330_tx_submit() local
2518 desc = list_entry(last->node.next, struct dma_pl330_desc, node); in pl330_tx_submit()
2520 desc->txd.callback = last->txd.callback; in pl330_tx_submit()
2521 desc->txd.callback_param = last->txd.callback_param; in pl330_tx_submit()
2523 desc->last = false; in pl330_tx_submit()
2525 dma_cookie_assign(&desc->txd); in pl330_tx_submit()
2527 list_move_tail(&desc->node, &pch->submitted_list); in pl330_tx_submit()
2538 static inline void _init_desc(struct dma_pl330_desc *desc) in _init_desc() argument
2540 desc->rqcfg.swap = SWAP_NO; in _init_desc()
2541 desc->rqcfg.scctl = CCTRL0; in _init_desc()
2542 desc->rqcfg.dcctl = CCTRL0; in _init_desc()
2543 desc->txd.tx_submit = pl330_tx_submit; in _init_desc()
2545 INIT_LIST_HEAD(&desc->node); in _init_desc()
2552 struct dma_pl330_desc *desc; in add_desc() local
2556 desc = kcalloc(count, sizeof(*desc), flg); in add_desc()
2557 if (!desc) in add_desc()
2563 _init_desc(&desc[i]); in add_desc()
2564 list_add_tail(&desc[i].node, pool); in add_desc()
2575 struct dma_pl330_desc *desc = NULL; in pluck_desc() local
2581 desc = list_entry(pool->next, in pluck_desc()
2584 list_del_init(&desc->node); in pluck_desc()
2586 desc->status = PREP; in pluck_desc()
2587 desc->txd.callback = NULL; in pluck_desc()
2592 return desc; in pluck_desc()
2599 struct dma_pl330_desc *desc; in pl330_get_desc() local
2602 desc = pluck_desc(&pl330->desc_pool, &pl330->pool_lock); in pl330_get_desc()
2605 if (!desc) { in pl330_get_desc()
2612 desc = pluck_desc(&pool, &lock); in pl330_get_desc()
2613 WARN_ON(!desc || !list_empty(&pool)); in pl330_get_desc()
2617 desc->pchan = pch; in pl330_get_desc()
2618 desc->txd.cookie = 0; in pl330_get_desc()
2619 async_tx_ack(&desc->txd); in pl330_get_desc()
2621 desc->peri = peri_id ? pch->chan.chan_id : 0; in pl330_get_desc()
2622 desc->rqcfg.pcfg = &pch->dmac->pcfg; in pl330_get_desc()
2624 dma_async_tx_descriptor_init(&desc->txd, &pch->chan); in pl330_get_desc()
2626 return desc; in pl330_get_desc()
2641 struct dma_pl330_desc *desc = pl330_get_desc(pch); in __pl330_prep_dma_memcpy() local
2643 if (!desc) { in __pl330_prep_dma_memcpy()
2659 fill_px(&desc->px, dst, src, len); in __pl330_prep_dma_memcpy()
2661 return desc; in __pl330_prep_dma_memcpy()
2665 static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) in get_burst_len() argument
2667 struct dma_pl330_chan *pch = desc->pchan; in get_burst_len()
2673 burst_len >>= desc->rqcfg.brst_size; in get_burst_len()
2687 struct dma_pl330_desc *desc = NULL, *first = NULL; in pl330_prep_dma_cyclic() local
2709 desc = pl330_get_desc(pch); in pl330_prep_dma_cyclic()
2710 if (!desc) { in pl330_prep_dma_cyclic()
2722 desc = list_entry(first->node.next, in pl330_prep_dma_cyclic()
2724 list_move_tail(&desc->node, &pl330->desc_pool); in pl330_prep_dma_cyclic()
2736 desc->rqcfg.src_inc = 1; in pl330_prep_dma_cyclic()
2737 desc->rqcfg.dst_inc = 0; in pl330_prep_dma_cyclic()
2742 desc->rqcfg.src_inc = 0; in pl330_prep_dma_cyclic()
2743 desc->rqcfg.dst_inc = 1; in pl330_prep_dma_cyclic()
2751 desc->rqtype = direction; in pl330_prep_dma_cyclic()
2752 desc->rqcfg.brst_size = pch->burst_sz; in pl330_prep_dma_cyclic()
2753 desc->rqcfg.brst_len = pch->burst_len; in pl330_prep_dma_cyclic()
2754 desc->bytes_requested = period_len; in pl330_prep_dma_cyclic()
2755 fill_px(&desc->px, dst, src, period_len); in pl330_prep_dma_cyclic()
2758 first = desc; in pl330_prep_dma_cyclic()
2760 list_add_tail(&desc->node, &first->node); in pl330_prep_dma_cyclic()
2765 if (!desc) in pl330_prep_dma_cyclic()
2770 return &desc->txd; in pl330_prep_dma_cyclic()
2777 struct dma_pl330_desc *desc; in pl330_prep_dma_memcpy() local
2787 desc = __pl330_prep_dma_memcpy(pch, dst, src, len); in pl330_prep_dma_memcpy()
2788 if (!desc) in pl330_prep_dma_memcpy()
2791 desc->rqcfg.src_inc = 1; in pl330_prep_dma_memcpy()
2792 desc->rqcfg.dst_inc = 1; in pl330_prep_dma_memcpy()
2793 desc->rqtype = DMA_MEM_TO_MEM; in pl330_prep_dma_memcpy()
2806 desc->rqcfg.brst_size = 0; in pl330_prep_dma_memcpy()
2807 while (burst != (1 << desc->rqcfg.brst_size)) in pl330_prep_dma_memcpy()
2808 desc->rqcfg.brst_size++; in pl330_prep_dma_memcpy()
2810 desc->rqcfg.brst_len = get_burst_len(desc, len); in pl330_prep_dma_memcpy()
2816 desc->rqcfg.brst_len = 1; in pl330_prep_dma_memcpy()
2818 desc->bytes_requested = len; in pl330_prep_dma_memcpy()
2820 return &desc->txd; in pl330_prep_dma_memcpy()
2827 struct dma_pl330_desc *desc; in __pl330_giveback_desc() local
2835 desc = list_entry(first->node.next, in __pl330_giveback_desc()
2837 list_move_tail(&desc->node, &pl330->desc_pool); in __pl330_giveback_desc()
2850 struct dma_pl330_desc *first, *desc = NULL; in pl330_prep_slave_sg() local
2867 desc = pl330_get_desc(pch); in pl330_prep_slave_sg()
2868 if (!desc) { in pl330_prep_slave_sg()
2880 first = desc; in pl330_prep_slave_sg()
2882 list_add_tail(&desc->node, &first->node); in pl330_prep_slave_sg()
2885 desc->rqcfg.src_inc = 1; in pl330_prep_slave_sg()
2886 desc->rqcfg.dst_inc = 0; in pl330_prep_slave_sg()
2887 fill_px(&desc->px, pch->fifo_dma, sg_dma_address(sg), in pl330_prep_slave_sg()
2890 desc->rqcfg.src_inc = 0; in pl330_prep_slave_sg()
2891 desc->rqcfg.dst_inc = 1; in pl330_prep_slave_sg()
2892 fill_px(&desc->px, sg_dma_address(sg), pch->fifo_dma, in pl330_prep_slave_sg()
2896 desc->rqcfg.brst_size = pch->burst_sz; in pl330_prep_slave_sg()
2897 desc->rqcfg.brst_len = pch->burst_len; in pl330_prep_slave_sg()
2898 desc->rqtype = direction; in pl330_prep_slave_sg()
2899 desc->bytes_requested = sg_dma_len(sg); in pl330_prep_slave_sg()
2903 return &desc->txd; in pl330_prep_slave_sg()