Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308048
b: refs/heads/master
c: 56cbb3d
h: refs/heads/master
v: v3
  • Loading branch information
Vinod Koul committed Apr 25, 2012
1 parent cead081 commit 278f160
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 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: affa115ed365d646ad1a8cc7d2d063b8181cce37
refs/heads/master: 56cbb3dd48623c01e7c589d29da743d486c95a58
1 change: 1 addition & 0 deletions trunk/drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
* signal
*/
release_phy_channel(plchan);
plchan->phychan_hold = 0;
}
/* Dequeue jobs and free LLIs */
if (plchan->at) {
Expand Down
25 changes: 15 additions & 10 deletions trunk/drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list)
{
struct dma_pl330_dmac *pdmac;
struct dma_pl330_desc *desc;
struct dma_pl330_chan *pch;
struct dma_pl330_chan *pch = NULL;
unsigned long flags;

if (list_empty(list))
return;

/* Finish off the work list */
list_for_each_entry(desc, list, node) {
dma_async_tx_callback callback;
Expand All @@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list)
desc->pchan = NULL;
}

/* pch will be unset if list was empty */
if (!pch)
return;

pdmac = pch->dmac;

spin_lock_irqsave(&pdmac->pool_lock, flags);
Expand All @@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list)
static inline void handle_cyclic_desc_list(struct list_head *list)
{
struct dma_pl330_desc *desc;
struct dma_pl330_chan *pch;
struct dma_pl330_chan *pch = NULL;
unsigned long flags;

if (list_empty(list))
return;

list_for_each_entry(desc, list, node) {
dma_async_tx_callback callback;

Expand All @@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list)
callback(desc->txd.callback_param);
}

/* pch will be unset if list was empty */
if (!pch)
return;

spin_lock_irqsave(&pch->lock, flags);
list_splice_tail_init(list, &pch->work_list);
spin_unlock_irqrestore(&pch->lock, flags);
Expand Down Expand Up @@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
INIT_LIST_HEAD(&pd->channels);

/* Initialize channel parameters */
num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri,
(u8)pi->pcfg.num_chan);
if (pdat)
num_chan = max_t(int, pdat->nr_valid_peri, pi->pcfg.num_chan);
else
num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);

pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);

for (i = 0; i < num_chan; i++) {
Expand Down

0 comments on commit 278f160

Please sign in to comment.