diff options
| author | 2015-10-06 15:01:52 +0100 | |
|---|---|---|
| committer | 2015-10-06 15:01:52 +0100 | |
| commit | c39b7eef7d92f5ffef1abf04227a62fa2a6a62b2 (patch) | |
| tree | 00aff822e9208ab2f2ac41c6e1a0f61c6eb9b57f /drivers/dma/dmaengine.c | |
| parent | Revert "iommu: Allow iova to be used without requiring IOMMU_SUPPORT" (diff) | |
| parent | Linux 4.3-rc4 (diff) | |
| download | linux-dev-c39b7eef7d92f5ffef1abf04227a62fa2a6a62b2.tar.xz linux-dev-c39b7eef7d92f5ffef1abf04227a62fa2a6a62b2.zip | |
Merge 4.3-rc4 into char-misc-next
This is needed due to the duplicated iommu stuff to help with the merge
and to prevent future issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma/dmaengine.c')
| -rw-r--r-- | drivers/dma/dmaengine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 3ff284c8e3d5..09479d4be4db 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -554,10 +554,18 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan) mutex_lock(&dma_list_mutex); if (chan->client_count == 0) { + struct dma_device *device = chan->device; + + dma_cap_set(DMA_PRIVATE, device->cap_mask); + device->privatecnt++; err = dma_chan_get(chan); - if (err) + if (err) { pr_debug("%s: failed to get %s: (%d)\n", __func__, dma_chan_name(chan), err); + chan = NULL; + if (--device->privatecnt == 0) + dma_cap_clear(DMA_PRIVATE, device->cap_mask); + } } else chan = NULL; |
