History

Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul: "We have two small fixes: - pl330 termination hang fix by Krzysztof - hsu memory leak fix by Peter" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: hsu: Fix memory leak when stopping a running transfer dmaengine: pl330: Fix hang on dmaengine_terminate_all on certain boards

Linus Torvalds committed 11 years ago

Commit ff25ea82 parents 8a7deb3 42977082 files · +7 −1Browse files

Unified · Split

2 files
  1. drivers/dma/hsu/hsu.c +4 −1
  2. drivers/dma/pl330.c +3 −0
drivers/dma/hsu/hsu.c+4−1
@@ -384,7 +384,10 @@ static int hsu_dma_terminate_all(struct dma_chan *chan) · 383 unmodified lines
384384 spin_lock_irqsave(&hsuc->vchan.lock, flags);
385385
386386 hsu_dma_stop_channel(hsuc);
387− hsuc->desc = NULL;
387+ if (hsuc->desc) {
388+ hsu_dma_desc_free(&hsuc->desc->vdesc);
389+ hsuc->desc = NULL;
390+ }
388391
389392 vchan_get_all_descriptors(&hsuc->vchan, &head);
390393 spin_unlock_irqrestore(&hsuc->vchan.lock, flags);
drivers/dma/pl330.c+3−0
@@ -2127,6 +2127,7 @@ static int pl330_terminate_all(struct dma_chan *chan) · 2126 unmodified lines
21272127 struct pl330_dmac *pl330 = pch->dmac;
21282128 LIST_HEAD(list);
21292129
2130+ pm_runtime_get_sync(pl330->ddma.dev);
21302131 spin_lock_irqsave(&pch->lock, flags);
21312132 spin_lock(&pl330->lock);
21322133 _stop(pch->thread);
@@ -2151,6 +2152,8 @@ static int pl330_terminate_all(struct dma_chan *chan) · 18 unmodified lines
21512152 list_splice_tail_init(&pch->work_list, &pl330->desc_pool);
21522153 list_splice_tail_init(&pch->completed_list, &pl330->desc_pool);
21532154 spin_unlock_irqrestore(&pch->lock, flags);
2155+ pm_runtime_mark_last_busy(pl330->ddma.dev);
2156+ pm_runtime_put_autosuspend(pl330->ddma.dev);
21542157
21552158 return 0;
21562159 }