[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241208183201.1b83cd0c@jic23-huawei>
Date: Sun, 8 Dec 2024 18:32:01 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Nuno Sá <nuno.sa@...log.com>, Uwe
Kleine-König <ukleinek@...nel.org>, Michael Hennerich
<Michael.Hennerich@...log.com>, Lars-Peter Clausen <lars@...afoo.de>, David
Jander <david@...tonic.nl>, Martin Sperl <kernel@...tin.sperl.org>,
linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH v5 10/16] iio: buffer-dmaengine: add
devm_iio_dmaengine_buffer_setup_ext2()
On Fri, 6 Dec 2024 16:04:40 -0600
David Lechner <dlechner@...libre.com> wrote:
> On 12/6/24 3:36 PM, David Lechner wrote:
> > On 11/24/24 11:16 AM, Jonathan Cameron wrote:
> >> On Fri, 15 Nov 2024 14:18:49 -0600
> >> David Lechner <dlechner@...libre.com> wrote:
> >>
> >>> Add a new devm_iio_dmaengine_buffer_setup_ext2() function to handle
> >>> cases where the DMA channel is managed by the caller rather than being
> >>> requested and released by the iio_dmaengine module.
> >>>
> >>> Signed-off-by: David Lechner <dlechner@...libre.com>
> >> Fresh read and I'm wondering if the lifetimes in here can be managed
> >> more simply either by pushing the DMA channel get down, or dragging
> >> the release up. Basically I'd like to see them at the same level
> >> of nesting in the code. If it ends up being necessary to duplicate
> >> more code that is fine if it makes this easier to reason about.
> >>
> >
> > One option could be instead of introducing a 2nd function, change
>
> Oops. The new function is devm_ so would still need a 2nd function
> but changing iio_dmaengine_buffer_setup_ext() to have basically
> the same signature would still avoid the asymmetry.
That sounds sensible. (though I've mostly forgotten the background ;)
>
> > the existing iio_dmaengine_buffer_setup_ext() to use the signature
> > of the proposed devm_iio_dmaengine_buffer_setup_ext2(). There are
> > only two users of these functions. So we could move the dma chan
> > request/release out to the drivers for those.
> >
> > Otherwise, we can't completely get rid of the owns_chan bit.
> >
Powered by blists - more mailing lists