From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá via B4 Relay" <devnull+nuno.sa.analog.com@kernel.org>
Cc: nuno.sa@analog.com, linux-iio@vger.kernel.org,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 0/3] iio: buffer: Fix DMABUF mapping in some systems
Date: Sun, 12 Oct 2025 16:46:40 +0100 [thread overview]
Message-ID: <20251012164640.40d29b87@jic23-huawei> (raw)
In-Reply-To: <20251007-fix-iio-dmabuf-get-dma-device-v3-0-0c73e2c0653b@analog.com>
On Tue, 07 Oct 2025 10:15:20 +0100
Nuno Sá via B4 Relay <devnull+nuno.sa.analog.com@kernel.org> wrote:
> This series fixes an issue with DMABUF support in the IIO subsystem where
> the wrong DMA device could be used for buffer mapping operations. This
> becomes critical on systems like Xilinx/AMD ZynqMP Ultrascale where memory
> can be mapped above the 32-bit address range.
>
> Problem:
> --------
> The current IIO DMABUF implementation assumes it can use the parent device
> of the IIO device for DMA operations. However, this device may not have
> the appropriate DMA mask configuration for accessing high memory addresses.
> On systems where memory is mapped above 32-bits, this leads to the use of
> bounce buffers through swiotlb, significantly impacting performance.
>
> Solution:
> ---------
> This series introduces a new .get_dma_dev() callback in the buffer access
> functions that allows buffer implementations to specify the correct DMA
> device that should be used for DMABUF operations. The DMA buffer
> infrastructure implements this callback to return the device that actually
> owns the DMA channel, ensuring proper memory mapping without bounce buffers.
>
> Changes:
> --------
> 1. Add .get_dma_dev() callback to iio_buffer_access_funcs and update core
> DMABUF code to use it when available
> 2. Implement the callback in the DMA buffer infrastructure
> 3. Wire up the callback in the dmaengine buffer implementation
>
> This ensures that DMABUF operations use the device with the correct DMA
> configuration, eliminating unnecessary bounce buffer usage and improving
> performance on high-memory systems.
>
> (AI generated cover. I would not be this formal but I guess is not
> that bad :))
>
> ---
> Changes in v3:
> - Patch 1
> * Add a new iio_buffer_get_dma_dev() helper to get the DMA dev.
> - Link to v2: https://lore.kernel.org/r/20251006-fix-iio-dmabuf-get-dma-device-v2-0-d960bc9084da@analog.com
Looks like I misinterpreted outcome of v2 thread. Anyhow dropped that and picked
this up.
Thanks
J
>
> ---
> Nuno Sá (3):
> iio: buffer: support getting dma channel from the buffer
> iio: buffer-dma: support getting the DMA channel
> iio: buffer-dmaengine: enable .get_dma_dev()
>
> drivers/iio/buffer/industrialio-buffer-dma.c | 6 ++++++
> drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 ++
> drivers/iio/industrialio-buffer.c | 21 ++++++++++++++++-----
> include/linux/iio/buffer-dma.h | 1 +
> include/linux/iio/buffer_impl.h | 2 ++
> 5 files changed, 27 insertions(+), 5 deletions(-)
> ---
> base-commit: b9700f87939f0f477e5c00db817f54ab8a97702b
> change-id: 20250930-fix-iio-dmabuf-get-dma-device-339ac70543db
> --
>
> Thanks!
> - Nuno Sá
>
>
>
prev parent reply other threads:[~2025-10-12 15:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 9:15 [PATCH v3 0/3] iio: buffer: Fix DMABUF mapping in some systems Nuno Sá via B4 Relay
2025-10-07 9:15 ` [PATCH v3 1/3] iio: buffer: support getting dma channel from the buffer Nuno Sá via B4 Relay
2025-10-07 9:15 ` [PATCH v3 2/3] iio: buffer-dma: support getting the DMA channel Nuno Sá via B4 Relay
2025-10-07 9:15 ` [PATCH v3 3/3] iio: buffer-dmaengine: enable .get_dma_dev() Nuno Sá via B4 Relay
2025-10-12 15:46 ` Jonathan Cameron [this message]
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=20251012164640.40d29b87@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=devnull+nuno.sa.analog.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=stable@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