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
Unified · Split
| @@ -384,7 +384,10 @@ static int hsu_dma_terminate_all(struct dma_chan *chan) · 383 unmodified lines | ||
| 384 | 384 | spin_lock_irqsave(&hsuc->vchan.lock, flags); |
| 385 | 385 | |
| 386 | 386 | 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 | + } | |
| 388 | 391 | |
| 389 | 392 | vchan_get_all_descriptors(&hsuc->vchan, &head); |
| 390 | 393 | spin_unlock_irqrestore(&hsuc->vchan.lock, flags); |
| @@ -2127,6 +2127,7 @@ static int pl330_terminate_all(struct dma_chan *chan) · 2126 unmodified lines | ||
| 2127 | 2127 | struct pl330_dmac *pl330 = pch->dmac; |
| 2128 | 2128 | LIST_HEAD(list); |
| 2129 | 2129 | |
| 2130 | + pm_runtime_get_sync(pl330->ddma.dev); | |
| 2130 | 2131 | spin_lock_irqsave(&pch->lock, flags); |
| 2131 | 2132 | spin_lock(&pl330->lock); |
| 2132 | 2133 | _stop(pch->thread); |
| @@ -2151,6 +2152,8 @@ static int pl330_terminate_all(struct dma_chan *chan) · 18 unmodified lines | ||
| 2151 | 2152 | list_splice_tail_init(&pch->work_list, &pl330->desc_pool); |
| 2152 | 2153 | list_splice_tail_init(&pch->completed_list, &pl330->desc_pool); |
| 2153 | 2154 | spin_unlock_irqrestore(&pch->lock, flags); |
| 2155 | + pm_runtime_mark_last_busy(pl330->ddma.dev); | |
| 2156 | + pm_runtime_put_autosuspend(pl330->ddma.dev); | |
| 2154 | 2157 | |
| 2155 | 2158 | return 0; |
| 2156 | 2159 | } |