forked from Minki/linux
Merge branch 'topic/qcom' into for-linus
This commit is contained in:
commit
73bf95f57b
@ -636,8 +636,8 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
|
||||
num_alloc += DIV_ROUND_UP(sg_dma_len(sg), BAM_FIFO_SIZE);
|
||||
|
||||
/* allocate enough room to accomodate the number of entries */
|
||||
async_desc = kzalloc(sizeof(*async_desc) +
|
||||
(num_alloc * sizeof(struct bam_desc_hw)), GFP_NOWAIT);
|
||||
async_desc = kzalloc(struct_size(async_desc, desc, num_alloc),
|
||||
GFP_NOWAIT);
|
||||
|
||||
if (!async_desc)
|
||||
goto err_out;
|
||||
|
@ -138,24 +138,25 @@ static void hidma_process_completed(struct hidma_chan *mchan)
|
||||
desc = &mdesc->desc;
|
||||
last_cookie = desc->cookie;
|
||||
|
||||
llstat = hidma_ll_status(mdma->lldev, mdesc->tre_ch);
|
||||
|
||||
spin_lock_irqsave(&mchan->lock, irqflags);
|
||||
if (llstat == DMA_COMPLETE) {
|
||||
mchan->last_success = last_cookie;
|
||||
result.result = DMA_TRANS_NOERROR;
|
||||
} else {
|
||||
result.result = DMA_TRANS_ABORTED;
|
||||
}
|
||||
|
||||
dma_cookie_complete(desc);
|
||||
spin_unlock_irqrestore(&mchan->lock, irqflags);
|
||||
|
||||
llstat = hidma_ll_status(mdma->lldev, mdesc->tre_ch);
|
||||
dmaengine_desc_get_callback(desc, &cb);
|
||||
|
||||
dma_run_dependencies(desc);
|
||||
|
||||
spin_lock_irqsave(&mchan->lock, irqflags);
|
||||
list_move(&mdesc->node, &mchan->free);
|
||||
|
||||
if (llstat == DMA_COMPLETE) {
|
||||
mchan->last_success = last_cookie;
|
||||
result.result = DMA_TRANS_NOERROR;
|
||||
} else
|
||||
result.result = DMA_TRANS_ABORTED;
|
||||
|
||||
spin_unlock_irqrestore(&mchan->lock, irqflags);
|
||||
|
||||
dmaengine_desc_callback_invoke(&cb, &result);
|
||||
@ -415,6 +416,7 @@ hidma_prep_dma_memcpy(struct dma_chan *dmach, dma_addr_t dest, dma_addr_t src,
|
||||
if (!mdesc)
|
||||
return NULL;
|
||||
|
||||
mdesc->desc.flags = flags;
|
||||
hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch,
|
||||
src, dest, len, flags,
|
||||
HIDMA_TRE_MEMCPY);
|
||||
@ -447,6 +449,7 @@ hidma_prep_dma_memset(struct dma_chan *dmach, dma_addr_t dest, int value,
|
||||
if (!mdesc)
|
||||
return NULL;
|
||||
|
||||
mdesc->desc.flags = flags;
|
||||
hidma_ll_set_transfer_params(mdma->lldev, mdesc->tre_ch,
|
||||
value, dest, len, flags,
|
||||
HIDMA_TRE_MEMSET);
|
||||
|
@ -423,9 +423,8 @@ static int __init hidma_mgmt_init(void)
|
||||
hidma_mgmt_of_populate_channels(child);
|
||||
}
|
||||
#endif
|
||||
platform_driver_register(&hidma_mgmt_driver);
|
||||
return platform_driver_register(&hidma_mgmt_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
module_init(hidma_mgmt_init);
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
Loading…
Reference in New Issue
Block a user