From: Vinod Koul <vkoul@kernel.org>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: Koba Ko <koba.ko@canonical.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Jie Hai <haijie1@huawei.com>, Dave Jiang <dave.jiang@intel.com>
Subject: Re: [PATCH V2] dmaengine: Fix client_count is countered one more incorrectly.
Date: Fri, 4 Nov 2022 18:55:21 +0530 [thread overview]
Message-ID: <Y2USwbAzuaCKTGdX@matsya> (raw)
In-Reply-To: <20221102180726.fuwwk2npsse56ius@cantor>
On 02-11-22, 11:07, Jerry Snitselaar wrote:
> Hi Vinod,
>
> Thoughts on this patch?
>
> Maybe changing the summary to "dmaengine: Fix double increment of client_count in dma_chan_get()"
> would be clearer?
Yes that would be better
>
> On Sat, Oct 01, 2022 at 01:36:52AM +0800, Koba Ko wrote:
> > If the passed client_count is 0,
> > it would be incremented by balance_ref_count first
> > then increment one more.
> > This would cause client_count to 2.
> >
> > cat /sys/class/dma/dma0chan*/in_use
> > 2
> > 2
> > 2
>
> Would this be better?
>
> The first time dma_chan_get() is called for a channel the channel
> client_count is incorrectly incremented twice for public channels,
> first in balance_ref_count(), and again prior to returning. This
> results in an incorrect client count which will lead to the
> channel resources not being freed when they should be. A simple
> test of repeated module load and unload of async_tx on a Dell
> Power Edge R7425 also shows this resulting in a kref underflow
> warning.
Agree, also if you have the underflow warning handy, do add it to the
log
--
~Vinod
next prev parent reply other threads:[~2022-11-04 13:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 17:36 [PATCH V2] dmaengine: Fix client_count is countered one more incorrectly Koba Ko
2022-09-30 18:39 ` Joel Savitz
2022-11-02 18:07 ` Jerry Snitselaar
2022-11-04 13:25 ` Vinod Koul [this message]
2022-11-04 15:36 ` Jerry Snitselaar
2022-11-05 7:18 ` Vinod Koul
2022-11-16 6:32 ` Koba Ko
2022-11-22 2:06 ` Koba Ko
-- strict thread matches above, loose matches on Subject: below --
2022-11-22 17:46 Joel Savitz
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=Y2USwbAzuaCKTGdX@matsya \
--to=vkoul@kernel.org \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=haijie1@huawei.com \
--cc=jsnitsel@redhat.com \
--cc=koba.ko@canonical.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox