Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321151
b: refs/heads/master
c: 5e2479b
h: refs/heads/master
i:
  321149: 7e1069e
  321147: 5cbd489
  321143: 9d6d597
  321135: 36f654c
  321119: a27e2c5
  321087: db7025c
  321023: 2363931
v: v3
  • Loading branch information
Russell King committed Jul 1, 2012
1 parent 7ff4664 commit aa8baef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: ad0de2ac3218d372149d89d9d5c5058aca6aa29b
refs/heads/master: 5e2479bd0e0dc41f2b9f6b4345bc5d4557837056
18 changes: 13 additions & 5 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ enum pl08x_dma_chan_state {
* @waiting: a TX descriptor on this channel which is waiting for a physical
* channel to become available
* @signal: the physical DMA request signal which this channel is using
* @mux_use: count of descriptors using this DMA request signal setting
*/
struct pl08x_dma_chan {
struct dma_chan chan;
Expand All @@ -244,6 +245,7 @@ struct pl08x_dma_chan {
bool slave;
struct pl08x_txd *waiting;
int signal;
unsigned mux_use;
};

/**
Expand Down Expand Up @@ -310,10 +312,12 @@ static int pl08x_request_mux(struct pl08x_dma_chan *plchan)
const struct pl08x_platform_data *pd = plchan->host->pd;
int ret;

if (pd->get_signal) {
if (plchan->mux_use++ == 0 && pd->get_signal) {
ret = pd->get_signal(plchan->cd);
if (ret < 0)
if (ret < 0) {
plchan->mux_use = 0;
return ret;
}

plchan->signal = ret;
}
Expand All @@ -324,9 +328,13 @@ static void pl08x_release_mux(struct pl08x_dma_chan *plchan)
{
const struct pl08x_platform_data *pd = plchan->host->pd;

if (plchan->signal >= 0 && pd->put_signal) {
pd->put_signal(plchan->cd, plchan->signal);
plchan->signal = -1;
if (plchan->signal >= 0) {
WARN_ON(plchan->mux_use == 0);

if (--plchan->mux_use == 0 && pd->put_signal) {
pd->put_signal(plchan->cd, plchan->signal);
plchan->signal = -1;
}
}
}

Expand Down

0 comments on commit aa8baef

Please sign in to comment.