diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-01-06 13:38:14 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-01-06 13:38:14 -0500 |
commit | 2ba05622b8b143b0c95968ba59bddfbd6d2f2559 (patch) | |
tree | b7b72d02a993ff2ba731d6608f4ab8ce87482bcb /net | |
parent | bec085134e446577a983f17f57d642a88d1af53b (diff) |
dmaengine: provide a common 'issue_pending_all' implementation
async_tx and net_dma each have open-coded versions of issue_pending_all,
so provide a common routine in dmaengine.
The implementation needs to walk the global device list, so implement
rcu to allow dma_issue_pending_all to run lockless. Clients protect
themselves from channel removal events by holding a dmaengine reference.
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 09c66a449da6..e40b0d57f8ff 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2635,14 +2635,7 @@ out: | |||
2635 | * There may not be any more sk_buffs coming right now, so push | 2635 | * There may not be any more sk_buffs coming right now, so push |
2636 | * any pending DMA copies to hardware | 2636 | * any pending DMA copies to hardware |
2637 | */ | 2637 | */ |
2638 | if (!cpus_empty(net_dma.channel_mask)) { | 2638 | dma_issue_pending_all(); |
2639 | int chan_idx; | ||
2640 | for_each_cpu_mask_nr(chan_idx, net_dma.channel_mask) { | ||
2641 | struct dma_chan *chan = net_dma.channels[chan_idx]; | ||
2642 | if (chan) | ||
2643 | dma_async_memcpy_issue_pending(chan); | ||
2644 | } | ||
2645 | } | ||
2646 | #endif | 2639 | #endif |
2647 | 2640 | ||
2648 | return; | 2641 | return; |