Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231609
b: refs/heads/master
c: 8087aac
h: refs/heads/master
i:
  231607: 6c7ab50
v: v3
  • Loading branch information
Russell King - ARM Linux authored and Dan Williams committed Jan 5, 2011
1 parent ea42f2f commit 447e471
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 501e67e82dee68d0a594ec0549f3d6a2943c91f5
refs/heads/master: 8087aacda040bdbf84940712d132ce80c30b9d5d
11 changes: 11 additions & 0 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
ch->signal,
plchan->name);

plchan->phychan_hold++;
plchan->phychan = ch;

return 0;
Expand Down Expand Up @@ -998,6 +999,8 @@ static dma_cookie_t pl08x_tx_submit(struct dma_async_tx_descriptor *tx)
/* Do this memcpy whenever there is a channel ready */
plchan->state = PL08X_CHAN_WAITING;
plchan->waiting = txd;
} else {
plchan->phychan_hold--;
}

/* This unlock follows the lock in the prep() function */
Expand Down Expand Up @@ -1585,6 +1588,7 @@ static void pl08x_tasklet(unsigned long data)
*/
plchan->lc = txd->tx.cookie;
}

/*
* If a new descriptor is queued, set it up
* plchan->at is NULL here
Expand All @@ -1598,6 +1602,12 @@ static void pl08x_tasklet(unsigned long data)
list_del(&next->node);

pl08x_start_txd(plchan, next);
} else if (plchan->phychan_hold) {
/*
* This channel is still in use - we have a new txd being
* prepared and will soon be queued. Don't give up the
* physical channel.
*/
} else {
struct pl08x_dma_chan *waiting = NULL;

Expand Down Expand Up @@ -1625,6 +1635,7 @@ static void pl08x_tasklet(unsigned long data)
ret = prep_phy_channel(waiting,
waiting->waiting);
BUG_ON(ret);
waiting->phychan_hold--;
waiting->state = PL08X_CHAN_RUNNING;
waiting->waiting = NULL;
pl08x_issue_pending(&waiting->chan);
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/amba/pl08x.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ enum pl08x_dma_chan_state {
* struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel
* @chan: wrappped abstract channel
* @phychan: the physical channel utilized by this channel, if there is one
* @phychan_hold: if non-zero, hold on to the physical channel even if we
* have no pending entries
* @tasklet: tasklet scheduled by the IRQ to handle actual work etc
* @name: name of channel
* @cd: channel platform data
Expand All @@ -173,6 +175,7 @@ enum pl08x_dma_chan_state {
struct pl08x_dma_chan {
struct dma_chan chan;
struct pl08x_phy_chan *phychan;
int phychan_hold;
struct tasklet_struct tasklet;
char *name;
struct pl08x_channel_data *cd;
Expand Down

0 comments on commit 447e471

Please sign in to comment.