aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index d18b5d069d7e..9d31d5eb95c1 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -515,7 +515,6 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
515 break; 515 break;
516 if (--device->privatecnt == 0) 516 if (--device->privatecnt == 0)
517 dma_cap_clear(DMA_PRIVATE, device->cap_mask); 517 dma_cap_clear(DMA_PRIVATE, device->cap_mask);
518 chan->private = NULL;
519 chan = NULL; 518 chan = NULL;
520 } 519 }
521 } 520 }
@@ -537,7 +536,6 @@ void dma_release_channel(struct dma_chan *chan)
537 /* drop PRIVATE cap enabled by __dma_request_channel() */ 536 /* drop PRIVATE cap enabled by __dma_request_channel() */
538 if (--chan->device->privatecnt == 0) 537 if (--chan->device->privatecnt == 0)
539 dma_cap_clear(DMA_PRIVATE, chan->device->cap_mask); 538 dma_cap_clear(DMA_PRIVATE, chan->device->cap_mask);
540 chan->private = NULL;
541 mutex_unlock(&dma_list_mutex); 539 mutex_unlock(&dma_list_mutex);
542} 540}
543EXPORT_SYMBOL_GPL(dma_release_channel); 541EXPORT_SYMBOL_GPL(dma_release_channel);
@@ -695,11 +693,11 @@ int dma_async_device_register(struct dma_device *device)
695 BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) && 693 BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
696 !device->device_prep_slave_sg); 694 !device->device_prep_slave_sg);
697 BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) && 695 BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
698 !device->device_terminate_all); 696 !device->device_control);
699 697
700 BUG_ON(!device->device_alloc_chan_resources); 698 BUG_ON(!device->device_alloc_chan_resources);
701 BUG_ON(!device->device_free_chan_resources); 699 BUG_ON(!device->device_free_chan_resources);
702 BUG_ON(!device->device_is_tx_complete); 700 BUG_ON(!device->device_tx_status);
703 BUG_ON(!device->device_issue_pending); 701 BUG_ON(!device->device_issue_pending);
704 BUG_ON(!device->dev); 702 BUG_ON(!device->dev);
705 703
@@ -978,7 +976,9 @@ void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
978 struct dma_chan *chan) 976 struct dma_chan *chan)
979{ 977{
980 tx->chan = chan; 978 tx->chan = chan;
979 #ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
981 spin_lock_init(&tx->lock); 980 spin_lock_init(&tx->lock);
981 #endif
982} 982}
983EXPORT_SYMBOL(dma_async_tx_descriptor_init); 983EXPORT_SYMBOL(dma_async_tx_descriptor_init);
984 984
@@ -1011,7 +1011,7 @@ EXPORT_SYMBOL_GPL(dma_wait_for_async_tx);
1011 */ 1011 */
1012void dma_run_dependencies(struct dma_async_tx_descriptor *tx) 1012void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1013{ 1013{
1014 struct dma_async_tx_descriptor *dep = tx->next; 1014 struct dma_async_tx_descriptor *dep = txd_next(tx);
1015 struct dma_async_tx_descriptor *dep_next; 1015 struct dma_async_tx_descriptor *dep_next;
1016 struct dma_chan *chan; 1016 struct dma_chan *chan;
1017 1017
@@ -1019,7 +1019,7 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1019 return; 1019 return;
1020 1020
1021 /* we'll submit tx->next now, so clear the link */ 1021 /* we'll submit tx->next now, so clear the link */
1022 tx->next = NULL; 1022 txd_clear_next(tx);
1023 chan = dep->chan; 1023 chan = dep->chan;
1024 1024
1025 /* keep submitting up until a channel switch is detected 1025 /* keep submitting up until a channel switch is detected
@@ -1027,14 +1027,14 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1027 * processing the interrupt from async_tx_channel_switch 1027 * processing the interrupt from async_tx_channel_switch
1028 */ 1028 */
1029 for (; dep; dep = dep_next) { 1029 for (; dep; dep = dep_next) {
1030 spin_lock_bh(&dep->lock); 1030 txd_lock(dep);
1031 dep->parent = NULL; 1031 txd_clear_parent(dep);
1032 dep_next = dep->next; 1032 dep_next = txd_next(dep);
1033 if (dep_next && dep_next->chan == chan) 1033 if (dep_next && dep_next->chan == chan)
1034 dep->next = NULL; /* ->next will be submitted */ 1034 txd_clear_next(dep); /* ->next will be submitted */
1035 else 1035 else
1036 dep_next = NULL; /* submit current dep and terminate */ 1036 dep_next = NULL; /* submit current dep and terminate */
1037 spin_unlock_bh(&dep->lock); 1037 txd_unlock(dep);
1038 1038
1039 dep->tx_submit(dep); 1039 dep->tx_submit(dep);
1040 } 1040 }