aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-05-17 19:30:58 -0400
committerDan Williams <dan.j.williams@intel.com>2010-05-17 19:30:58 -0400
commit0b28330e39bbe0ffee4c56b09fc415fcec595ea3 (patch)
treefcf504879883763557e696eff81427b1ab78f76b /drivers/dma/dmaengine.c
parent058276303dbc4ed089c1f7dad0871810b1f5ddf1 (diff)
parentcaa20d974c86af496b419eef70010e63b7fab7ac (diff)
Merge branch 'ioat' into dmaengine
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 21eb896f4dfd..9d31d5eb95c1 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -58,6 +58,7 @@
58#include <linux/jiffies.h> 58#include <linux/jiffies.h>
59#include <linux/rculist.h> 59#include <linux/rculist.h>
60#include <linux/idr.h> 60#include <linux/idr.h>
61#include <linux/slab.h>
61 62
62static DEFINE_MUTEX(dma_list_mutex); 63static DEFINE_MUTEX(dma_list_mutex);
63static LIST_HEAD(dma_device_list); 64static LIST_HEAD(dma_device_list);
@@ -975,7 +976,9 @@ void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
975 struct dma_chan *chan) 976 struct dma_chan *chan)
976{ 977{
977 tx->chan = chan; 978 tx->chan = chan;
979 #ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
978 spin_lock_init(&tx->lock); 980 spin_lock_init(&tx->lock);
981 #endif
979} 982}
980EXPORT_SYMBOL(dma_async_tx_descriptor_init); 983EXPORT_SYMBOL(dma_async_tx_descriptor_init);
981 984
@@ -1008,7 +1011,7 @@ EXPORT_SYMBOL_GPL(dma_wait_for_async_tx);
1008 */ 1011 */
1009void dma_run_dependencies(struct dma_async_tx_descriptor *tx) 1012void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1010{ 1013{
1011 struct dma_async_tx_descriptor *dep = tx->next; 1014 struct dma_async_tx_descriptor *dep = txd_next(tx);
1012 struct dma_async_tx_descriptor *dep_next; 1015 struct dma_async_tx_descriptor *dep_next;
1013 struct dma_chan *chan; 1016 struct dma_chan *chan;
1014 1017
@@ -1016,7 +1019,7 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1016 return; 1019 return;
1017 1020
1018 /* we'll submit tx->next now, so clear the link */ 1021 /* we'll submit tx->next now, so clear the link */
1019 tx->next = NULL; 1022 txd_clear_next(tx);
1020 chan = dep->chan; 1023 chan = dep->chan;
1021 1024
1022 /* keep submitting up until a channel switch is detected 1025 /* keep submitting up until a channel switch is detected
@@ -1024,14 +1027,14 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx)
1024 * processing the interrupt from async_tx_channel_switch 1027 * processing the interrupt from async_tx_channel_switch
1025 */ 1028 */
1026 for (; dep; dep = dep_next) { 1029 for (; dep; dep = dep_next) {
1027 spin_lock_bh(&dep->lock); 1030 txd_lock(dep);
1028 dep->parent = NULL; 1031 txd_clear_parent(dep);
1029 dep_next = dep->next; 1032 dep_next = txd_next(dep);
1030 if (dep_next && dep_next->chan == chan) 1033 if (dep_next && dep_next->chan == chan)
1031 dep->next = NULL; /* ->next will be submitted */ 1034 txd_clear_next(dep); /* ->next will be submitted */
1032 else 1035 else
1033 dep_next = NULL; /* submit current dep and terminate */ 1036 dep_next = NULL; /* submit current dep and terminate */
1034 spin_unlock_bh(&dep->lock); 1037 txd_unlock(dep);
1035 1038
1036 dep->tx_submit(dep); 1039 dep->tx_submit(dep);
1037 } 1040 }