Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321118
b: refs/heads/master
c: 571fa74
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Jul 1, 2012
1 parent f57d0cc commit 94cfbcc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe045874aaf4480386c65baf1acae82af4c5e21f
refs/heads/master: 571fa74034701391b1be2ad193f684acfdeb75d1
19 changes: 15 additions & 4 deletions trunk/drivers/dma/virt-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,28 @@ EXPORT_SYMBOL_GPL(vchan_find_desc);
static void vchan_complete(unsigned long arg)
{
struct virt_dma_chan *vc = (struct virt_dma_chan *)arg;
struct virt_dma_desc *vd;
dma_async_tx_callback cb = NULL;
void *cb_data = NULL;
LIST_HEAD(head);

spin_lock_irq(&vc->lock);
list_splice_tail_init(&vc->desc_completed, &head);
vd = vc->cyclic;
if (vd) {
vc->cyclic = NULL;
cb = vd->tx.callback;
cb_data = vd->tx.callback_param;
}
spin_unlock_irq(&vc->lock);

if (cb)
cb(cb_data);

while (!list_empty(&head)) {
struct virt_dma_desc *vd = list_first_entry(&head,
struct virt_dma_desc, node);
dma_async_tx_callback cb = vd->tx.callback;
void *cb_data = vd->tx.callback_param;
vd = list_first_entry(&head, struct virt_dma_desc, node);
cb = vd->tx.callback;
cb_data = vd->tx.callback_param;

list_del(&vd->node);

Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/dma/virt-dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ struct virt_dma_chan {
struct list_head desc_submitted;
struct list_head desc_issued;
struct list_head desc_completed;

struct virt_dma_desc *cyclic;
};

static inline struct virt_dma_chan *to_virt_chan(struct dma_chan *chan)
Expand Down Expand Up @@ -91,6 +93,18 @@ static inline void vchan_cookie_complete(struct virt_dma_desc *vd)
tasklet_schedule(&vc->task);
}

/**
* vchan_cyclic_callback - report the completion of a period
* vd: virtual descriptor
*/
static inline void vchan_cyclic_callback(struct virt_dma_desc *vd)
{
struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan);

vc->cyclic = vd;
tasklet_schedule(&vc->task);
}

/**
* vchan_next_desc - peek at the next descriptor to be processed
* vc: virtual channel to obtain descriptor from
Expand Down

0 comments on commit 94cfbcc

Please sign in to comment.