From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Robert Baldyga <r.baldyga@samsung.com>, vinod.koul@intel.com
Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org, m.szyprowski@samsung.com
Subject: Re: [PATCH] dmaengine: fix balance of privatecnt inc/dec operations
Date: Mon, 10 Aug 2015 09:14:59 +0900 [thread overview]
Message-ID: <55C7ED03.2030000@samsung.com> (raw)
In-Reply-To: <1438943207-4840-1-git-send-email-r.baldyga@samsung.com>
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@samsung.com>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.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);
>
next prev parent reply other threads:[~2015-08-10 0:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 10:26 [PATCH] dmaengine: fix balance of privatecnt inc/dec operations Robert Baldyga
2015-08-10 0:14 ` Krzysztof Kozlowski [this message]
2015-08-17 17:18 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C7ED03.2030000@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=r.baldyga@samsung.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.