[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2USwbAzuaCKTGdX@matsya>
Date:   Fri, 4 Nov 2022 18:55:21 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Jerry Snitselaar <jsnitsel@...hat.com>
Cc:     Koba Ko <koba.ko@...onical.com>, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jie Hai <haijie1@...wei.com>,
        Dave Jiang <dave.jiang@...el.com>
Subject: Re: [PATCH V2] dmaengine: Fix client_count is countered one more
 incorrectly.
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
Powered by blists - more mailing lists
 
