mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
bec085134e
commit
2ba05622b8
5 changed files with 27 additions and 24 deletions
|
|
@ -45,18 +45,6 @@ static DEFINE_SPINLOCK(async_tx_lock);
|
|||
|
||||
static LIST_HEAD(async_tx_master_list);
|
||||
|
||||
/* async_tx_issue_pending_all - start all transactions on all channels */
|
||||
void async_tx_issue_pending_all(void)
|
||||
{
|
||||
struct dma_chan_ref *ref;
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(ref, &async_tx_master_list, node)
|
||||
ref->chan->device->device_issue_pending(ref->chan);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(async_tx_issue_pending_all);
|
||||
|
||||
static void
|
||||
free_dma_chan_ref(struct rcu_head *rcu)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue