[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <55C7ED03.2030000@samsung.com>
Date: Mon, 10 Aug 2015 09:14:59 +0900
From: Krzysztof Kozlowski <k.kozlowski@...sung.com>
To: Robert Baldyga <r.baldyga@...sung.com>, vinod.koul@...el.com
Cc: dan.j.williams@...el.com, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org, m.szyprowski@...sung.com
Subject: Re: [PATCH] dmaengine: fix balance of privatecnt inc/dec operations
On 07.08.2015 19:26, Robert Baldyga wrote:
> 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@...sung.com>
> Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
> ---
> drivers/dma/dmaengine.c | 4 ++++
> 1 file changed, 4 insertions(+)
Fixes issue [0] (reported after applying [1]).
Tested on Trats2 board (Exynos4412, pl330, serial with DMA)
Best regards,
Krzysztof
[0] http://www.spinics.net/lists/linux-serial/msg18369.html
[1] http://www.spinics.net/lists/linux-samsung-soc/msg45700.html
>
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 4a4cce1..3ff284c 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,
> struct dma_chan *ch = dma_request_slave_channel_reason(dev, name);
> if (IS_ERR(ch))
> return NULL;
> +
> + dma_cap_set(DMA_PRIVATE, ch->device->cap_mask);
> + ch->device->privatecnt++;
> +
> return ch;
> }
> EXPORT_SYMBOL_GPL(dma_request_slave_channel);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists