linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Nuno Sá" <noname.nuno@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
	robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org
Cc: linux-iio@vger.kernel.org, s32@nxp.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	chester62515@gmail.com, mbrugger@suse.com,
	ghennadi.procopciuc@oss.nxp.com
Subject: Re: [PATCH v1 2/2] iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
Date: Tue, 9 Sep 2025 18:22:00 +0200	[thread overview]
Message-ID: <222acc86-c405-4e05-ac8c-520ba81ef0a0@linaro.org> (raw)
In-Reply-To: <c30bb4b6328d15a9c213c0fa64b909035dc7bf40.camel@gmail.com>

On 09/09/2025 11:29, Nuno Sá wrote:
> Hi *Daniel* (sorry for that :)),
> 
> On Mon, 2025-09-08 at 08:58 -0500, David Lechner wrote:
>> On 9/8/25 7:16 AM, Daniel Lezcano wrote:
>>> On 05/09/2025 23:54, David Lechner wrote:
>>>> On 9/5/25 3:58 PM, Daniel Lezcano wrote:
>>>>> On 05/09/2025 17:25, David Lechner wrote:
>>>>>> On 9/5/25 4:44 AM, Daniel Lezcano wrote:
>>>>>>> On 04/09/2025 19:49, David Lechner wrote:
>>>>>>>> On 9/4/25 12:40 PM, Daniel Lezcano wrote:
>>>>>
>>>>> [ ... ]

[ ... ]

>> Unfortunately, not really. Until the last few years, there wasn't really
>> any users of these APIs. I added devm_iio_dmaengine_buffer_setup_with_handle()
>> for the SPI offloading work I did recently. The only reason it had to be
>> added is because we needed to get the DMA handle from a different devicetree
>> node from the ADC's node. Since this device has dmas and dma-names in
>> the devicetree, then if devm_iio_dmaengine_buffer_setup[_ext]() doesn't work
>> with that, then it might have other problems (assumptions made for a specific
>> use case) than just not calling dma_slave_config().
>>
>> I think maybe Nuno and certainly I are guilty of trying to offer you advice
>> without looking deeply enough into what you already submitted. :-/
>>
> 
> Yes, I pretty much just asked for (at least) some discussion about this and see
> if we could use what we already have in IIO.
> 
>> I see now that what you are doing with the DMA looks more like other SoC ADCs
>> (AT91/STM32/AM335x) which is quite different from how the iio_dmaengine_buffer
>> stuff works, e.g. cyclic vs. not. So unless you are interested in evolving
> 
> Supporting cyclic should be fairly easy (Paul left it almost prepared for it)
> and do I have some patches already. I'm just waiting on having something
> accepted on the ADI DMA IP driver (dmaengine) before sending the IIO patches I
> already have.
> 
>> the iio_dmaengine_buffer code to be more general to handle this case as well,
>> it might not be the right tool for the job currently.
> 
> I think for the STM (IIRC) case they "open" coded it because the IIO DMA support
> we had at the time (if any) was more "rudimentary" - (no real zero copy
> interface with userspace for example). But yeah, it seems there are some gaps
> for your usecase so as David said, you would need to be interested in evolving
> the IIO DMA API to accommodate your needs. Again, if nicely integrated you would
> gain some nice "improvements" in performance (not having to use the fileio
> interface for reading the buffers) for "free".
> 
> As for dma_slave_config(), you're right and we have no usecase needing that
> setup and TBH, I did not looked or have any idea (atm) on how to do it. That
> said, I'll be here to help and contribute if you decide to try and follow the
> IIO DMA buffer API.

I would be glad to help improving the IIO DMA but I don't have enough 
bandwidth ATM. I was hoping to get this driver merged for v6.18 which is 
the next LTS AFAICT. Is it something possible by taking into account all 
the comments without improving the DMA code ?

Do you have a pointer to Paul's series and the patches you mentioned 
above ? I can give a try when having some spare time



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2025-09-09 16:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 10:27 [PATCH v1 0/2] NXP SAR ADC IIO driver for s32g2/3 platforms Daniel Lezcano
2025-09-03 10:27 ` [PATCH v1 1/2] dt-bindings: iio: adc: Add the NXP SAR ADC " Daniel Lezcano
2025-09-03 21:52   ` Rob Herring (Arm)
2025-09-04 19:47   ` David Lechner
2025-09-06  7:29   ` Krzysztof Kozlowski
2025-09-03 10:27 ` [PATCH v1 2/2] iio: adc: Add the NXP SAR ADC support for the " Daniel Lezcano
2025-09-03 11:20   ` Nuno Sá
2025-09-03 14:53     ` Daniel Lezcano
2025-09-03 15:41     ` Jonathan Cameron
2025-09-04 17:40     ` Daniel Lezcano
2025-09-04 17:49       ` David Lechner
2025-09-05  9:44         ` Daniel Lezcano
2025-09-05 15:25           ` David Lechner
2025-09-05 20:58             ` Daniel Lezcano
2025-09-05 21:54               ` David Lechner
2025-09-08 12:16                 ` Daniel Lezcano
2025-09-08 13:58                   ` David Lechner
2025-09-09  9:29                     ` Nuno Sá
2025-09-09 16:22                       ` Daniel Lezcano [this message]
2025-09-10 11:57                         ` Nuno Sá
2025-09-10 16:21                           ` Jonathan Cameron
2025-09-03 11:48   ` Andy Shevchenko
2025-09-03 15:28     ` Daniel Lezcano
2025-09-04  7:33       ` Andy Shevchenko
2025-09-04 16:52         ` Daniel Lezcano
2025-09-09  9:04         ` Daniel Lezcano
2025-09-06  7:34   ` Krzysztof Kozlowski

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=222acc86-c405-4e05-ac8c-520ba81ef0a0@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=andy@kernel.org \
    --cc=chester62515@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=ghennadi.procopciuc@oss.nxp.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=noname.nuno@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=s32@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).