From: Frank Li <Frank.li@oss.nxp.com>
To: nuno.sa@analog.com
Cc: dmaengine@vger.kernel.org, linux-iio@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH RFC 3/3] iio: buffer-dmaengine: Use dma_slave_caps width accessors
Date: Tue, 16 Jun 2026 11:25:58 -0500 [thread overview]
Message-ID: <ajF5Fko3bWehuvYg@SMW015318> (raw)
In-Reply-To: <20260616-dmaengine-support-wider-dma-masks-v1-3-da23a8dcb756@analog.com>
On Tue, Jun 16, 2026 at 04:40:54PM +0100, Nuno Sá via B4 Relay wrote:
>
> Query the minimum supported source and destination widths through the
> new dma_slave_caps_get_{src,dst}_width_min() helpers rather than
> decoding the raw u32 width mask. This keeps the buffer working with DMA
> controllers that advertise their address widths via the new bitmap
> representation.
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/iio/buffer/industrialio-buffer-dmaengine.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> index 98acce909854..855e3662cd3d 100644
> --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> @@ -229,14 +229,13 @@ static struct iio_buffer *iio_dmaengine_buffer_alloc(struct dma_chan *chan)
> return ERR_PTR(-ENOMEM);
>
> /* Needs to be aligned to the maximum of the minimums */
> - if (caps.src_addr_widths)
> - src_width = __ffs(caps.src_addr_widths);
> - else
> - src_width = 1;
> - if (caps.dst_addr_widths)
> - dest_width = __ffs(caps.dst_addr_widths);
> - else
> - dest_width = 1;
> + src_width = dma_slave_caps_get_src_width_min(&caps);
> + if (src_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
> + src_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
> + dest_width = dma_slave_caps_get_dst_width_min(&caps);
> + if (dest_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
> + dest_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
> +
> width = max(src_width, dest_width);
>
> INIT_LIST_HEAD(&dmaengine_buffer->active);
>
> --
> 2.54.0
>
>
prev parent reply other threads:[~2026-06-16 16:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 15:40 [PATCH RFC 0/3] dmaengine: Support address bus widths of 32 bytes and above Nuno Sá via B4 Relay
2026-06-16 15:40 ` [PATCH RFC 1/3] " Nuno Sá via B4 Relay
2026-06-16 15:55 ` sashiko-bot
2026-06-16 16:19 ` Frank Li
2026-06-16 15:40 ` [PATCH RFC 2/3] dmaengine: dma-axi-dmac: Switch to bitmap-based address width masks Nuno Sá via B4 Relay
2026-06-16 15:52 ` sashiko-bot
2026-06-16 16:23 ` Frank Li
2026-06-16 15:40 ` [PATCH RFC 3/3] iio: buffer-dmaengine: Use dma_slave_caps width accessors Nuno Sá via B4 Relay
2026-06-16 16:25 ` Frank Li [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=ajF5Fko3bWehuvYg@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=dmaengine@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=vkoul@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