]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: buffer-dmaengine: enable .get_dma_dev()
authorNuno Sá <nuno.sa@analog.com>
Tue, 7 Oct 2025 09:15:23 +0000 (10:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:24:57 +0000 (06:24 +0900)
commit 3db847df994d475db7812dde90376f2848bcd30a upstream.

Wire up the .get_dma_dev() callback to use the DMA buffer infrastructure's
implementation. This ensures that DMABUF operations use the correct DMA
device for mapping, which is essential for proper operation on systems
where memory is mapped above the 32-bit range.

Without this callback, the core would fall back to using the IIO device's
parent, which may not have the appropriate DMA mask configuration for
high memory access.

Fixes: 7a86d469983a ("iio: buffer-dmaengine: Support new DMABUF based userspace API")
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/buffer/industrialio-buffer-dmaengine.c

index 19af1caf14cd34e04f8cd851abe9a6fcc1aabfa0..95222f00e5ff49ef4b88075990e1af398be0df00 100644 (file)
@@ -177,6 +177,8 @@ static const struct iio_buffer_access_funcs iio_dmaengine_buffer_ops = {
        .lock_queue = iio_dma_buffer_lock_queue,
        .unlock_queue = iio_dma_buffer_unlock_queue,
 
+       .get_dma_dev = iio_dma_buffer_get_dma_dev,
+
        .modes = INDIO_BUFFER_HARDWARE,
        .flags = INDIO_BUFFER_FLAG_FIXED_WATERMARK,
 };