Lines Matching full:vc

18 	/* protected by vc.lock */
29 /* protected by vc.lock */
44 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head);
45 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
52 * @vc: virtual channel allocating this descriptor
56 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan *vc, in vchan_tx_prep() argument
61 dma_async_tx_descriptor_init(&vd->tx, &vc->chan); in vchan_tx_prep()
69 spin_lock_irqsave(&vc->lock, flags); in vchan_tx_prep()
70 list_add_tail(&vd->node, &vc->desc_allocated); in vchan_tx_prep()
71 spin_unlock_irqrestore(&vc->lock, flags); in vchan_tx_prep()
78 * @vc: virtual channel to update
80 * vc.lock must be held by caller
82 static inline bool vchan_issue_pending(struct virt_dma_chan *vc) in vchan_issue_pending() argument
84 lockdep_assert_held(&vc->lock); in vchan_issue_pending()
86 list_splice_tail_init(&vc->desc_submitted, &vc->desc_issued); in vchan_issue_pending()
87 return !list_empty(&vc->desc_issued); in vchan_issue_pending()
94 * vc.lock must be held by caller
98 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cookie_complete() local
101 lockdep_assert_held(&vc->lock); in vchan_cookie_complete()
105 dev_vdbg(vc->chan.device->dev, "txd %p[%x]: marked complete\n", in vchan_cookie_complete()
107 list_add_tail(&vd->node, &vc->desc_completed); in vchan_cookie_complete()
109 tasklet_schedule(&vc->task); in vchan_cookie_complete()
118 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_vdesc_fini() local
123 spin_lock_irqsave(&vc->lock, flags); in vchan_vdesc_fini()
124 list_add(&vd->node, &vc->desc_allocated); in vchan_vdesc_fini()
125 spin_unlock_irqrestore(&vc->lock, flags); in vchan_vdesc_fini()
127 vc->desc_free(vd); in vchan_vdesc_fini()
137 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_cyclic_callback() local
139 vc->cyclic = vd; in vchan_cyclic_callback()
140 tasklet_schedule(&vc->task); in vchan_cyclic_callback()
147 * vc.lock must be held by caller
151 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan); in vchan_terminate_vdesc() local
153 lockdep_assert_held(&vc->lock); in vchan_terminate_vdesc()
155 list_add_tail(&vd->node, &vc->desc_terminated); in vchan_terminate_vdesc()
157 if (vc->cyclic == vd) in vchan_terminate_vdesc()
158 vc->cyclic = NULL; in vchan_terminate_vdesc()
163 * @vc: virtual channel to obtain descriptor from
165 * vc.lock must be held by caller
167 static inline struct virt_dma_desc *vchan_next_desc(struct virt_dma_chan *vc) in vchan_next_desc() argument
169 lockdep_assert_held(&vc->lock); in vchan_next_desc()
171 return list_first_entry_or_null(&vc->desc_issued, in vchan_next_desc()
177 * @vc: virtual channel to get descriptors from
180 * vc.lock must be held by caller
185 static inline void vchan_get_all_descriptors(struct virt_dma_chan *vc, in vchan_get_all_descriptors() argument
188 lockdep_assert_held(&vc->lock); in vchan_get_all_descriptors()
190 list_splice_tail_init(&vc->desc_allocated, head); in vchan_get_all_descriptors()
191 list_splice_tail_init(&vc->desc_submitted, head); in vchan_get_all_descriptors()
192 list_splice_tail_init(&vc->desc_issued, head); in vchan_get_all_descriptors()
193 list_splice_tail_init(&vc->desc_completed, head); in vchan_get_all_descriptors()
194 list_splice_tail_init(&vc->desc_terminated, head); in vchan_get_all_descriptors()
197 static inline void vchan_free_chan_resources(struct virt_dma_chan *vc) in vchan_free_chan_resources() argument
203 spin_lock_irqsave(&vc->lock, flags); in vchan_free_chan_resources()
204 vchan_get_all_descriptors(vc, &head); in vchan_free_chan_resources()
207 spin_unlock_irqrestore(&vc->lock, flags); in vchan_free_chan_resources()
209 vchan_dma_desc_free_list(vc, &head); in vchan_free_chan_resources()
214 * @vc: virtual channel to synchronize
221 static inline void vchan_synchronize(struct virt_dma_chan *vc) in vchan_synchronize() argument
226 tasklet_kill(&vc->task); in vchan_synchronize()
228 spin_lock_irqsave(&vc->lock, flags); in vchan_synchronize()
230 list_splice_tail_init(&vc->desc_terminated, &head); in vchan_synchronize()
232 spin_unlock_irqrestore(&vc->lock, flags); in vchan_synchronize()
234 vchan_dma_desc_free_list(vc, &head); in vchan_synchronize()