diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2015-08-07 06:26:47 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-08-17 13:17:43 -0400 |
commit | 05aa1a77dcf1b9f9c4fedf09a0a53e15d6b21738 (patch) | |
tree | 4f6401fd10277fc91f45aa7b823f780a8e1c50e5 /drivers/dma/dmaengine.c | |
parent | 2c6625cd545bdd66acff14f3394865d43920a5c7 (diff) |
dmaengine: fix balance of privatecnt inc/dec operations
This patch increments privatecnt value and set DMA_PRIVATE in device
caps in dma_request_slave_channel() function. This is needed to keep
privatecnt increment/decrement balance.
As function dma_release_channel() decrements privatecnt counter, we need
to increment it when channel is requested. Otherwise privatecnt drops
into negatives after few dma_release_channel() calls.
Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r-- | drivers/dma/dmaengine.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 4a4cce15f25d..3ff284c8e3d5 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -689,6 +689,10 @@ struct dma_chan *dma_request_slave_channel(struct device *dev, | |||
689 | struct dma_chan *ch = dma_request_slave_channel_reason(dev, name); | 689 | struct dma_chan *ch = dma_request_slave_channel_reason(dev, name); |
690 | if (IS_ERR(ch)) | 690 | if (IS_ERR(ch)) |
691 | return NULL; | 691 | return NULL; |
692 | |||
693 | dma_cap_set(DMA_PRIVATE, ch->device->cap_mask); | ||
694 | ch->device->privatecnt++; | ||
695 | |||
692 | return ch; | 696 | return ch; |
693 | } | 697 | } |
694 | EXPORT_SYMBOL_GPL(dma_request_slave_channel); | 698 | EXPORT_SYMBOL_GPL(dma_request_slave_channel); |