From: "Nuno Sá" <noname.nuno@gmail.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: nuno.sa@analog.com, 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 9/9] dmaengine: Drop legacy bus width fields from dma_slave_caps
Date: Mon, 3 Aug 2026 13:38:46 +0100 [thread overview]
Message-ID: <anCLovMjz14Zxyup@nsa> (raw)
In-Reply-To: <amunW2XsMCC3GmeK@SMW015318>
On Thu, Jul 30, 2026 at 02:34:51PM -0500, Frank Li wrote:
> On Thu, Jul 30, 2026 at 03:23:16PM +0100, Nuno Sá via B4 Relay wrote:
> > [You don't often get email from devnull+nuno.sa.analog.com@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > From: Nuno Sá <nuno.sa@analog.com>
> >
> > All users of dma_get_slave_caps() that inspect bus width capabilities
> > now use bitmap helpers.
> >
> > Remove the legacy fields from struct dma_slave_caps and stop copying the
> > dma_device legacy masks into them.
> >
> > Keep folding legacy dma_device masks into the returned bitmaps so
> > unconverted DMA controller producers continue to work during the
> > transition.
>
> which one you kept?
The one in
https://elixir.bootlin.com/linux/v7.1.5/source/include/linux/dmaengine.h#L890
given that we need to update all controllers in drivers/dma before we
can get rid of them. I guess I need better working in the commit
message?
- Nuno Sá
>
> Frank
>
> >
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > ---
> > drivers/dma/dmaengine.c | 2 --
> > include/linux/dmaengine.h | 16 ++--------------
> > 2 files changed, 2 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> > index 7be23ba769d0..ee0b8bfc7c97 100644
> > --- a/drivers/dma/dmaengine.c
> > +++ b/drivers/dma/dmaengine.c
> > @@ -592,7 +592,6 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
> > if (!device->directions)
> > return -ENXIO;
> >
> > - caps->src_addr_widths = device->src_addr_widths;
> > if (bitmap_empty(device->src_bus_widths, DMA_SLAVE_BUSWIDTH_MAX)) {
> > bitmap_zero(caps->src_bus_widths, DMA_SLAVE_BUSWIDTH_MAX);
> > bitmap_from_arr32(caps->src_bus_widths,
> > @@ -602,7 +601,6 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
> > DMA_SLAVE_BUSWIDTH_MAX);
> > }
> >
> > - caps->dst_addr_widths = device->dst_addr_widths;
> > if (bitmap_empty(device->dst_bus_widths, DMA_SLAVE_BUSWIDTH_MAX)) {
> > bitmap_zero(caps->dst_bus_widths, DMA_SLAVE_BUSWIDTH_MAX);
> > bitmap_from_arr32(caps->dst_bus_widths,
> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> > index cea57b166dcb..f37a0559ec5f 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -495,9 +495,7 @@ enum dma_residue_granularity {
> > * @src_bus_widths: bitmap of source bus widths the channel supports.
> > * Width is specified in bytes, e.g. for a channel supporting
> > * a width of 4 the bitmap should have bit 4 set.
> > - * @src_addr_widths: legacy bit mask of source bus widths the channel supports.
> > * @dst_bus_widths: bitmap of destination bus widths the channel supports.
> > - * @dst_addr_widths: legacy bit mask of destination bus widths the channel supports.
> > * @directions: bit mask of slave directions the channel supports.
> > * Since the enum dma_transfer_direction is not defined as bit flag for
> > * each type, the dma controller should set BIT(<TYPE>) and same
> > @@ -516,14 +514,8 @@ enum dma_residue_granularity {
> > * resubmitted multiple times
> > */
> > struct dma_slave_caps {
> > - struct {
> > - DECLARE_DMA_BUS_WIDTHS(src_bus_widths);
> > - u32 src_addr_widths;
> > - };
> > - struct {
> > - DECLARE_DMA_BUS_WIDTHS(dst_bus_widths);
> > - u32 dst_addr_widths;
> > - };
> > + DECLARE_DMA_BUS_WIDTHS(src_bus_widths);
> > + DECLARE_DMA_BUS_WIDTHS(dst_bus_widths);
> > u32 directions;
> > u32 min_burst;
> > u32 max_burst;
> > @@ -1789,8 +1781,6 @@ dma_slave_caps_clear_src_width(struct dma_slave_caps *caps,
> > enum dma_slave_buswidth width)
> > {
> > __clear_bit(width, caps->src_bus_widths);
> > - if (width < DMA_SLAVE_BUSWIDTH_32_BYTES)
> > - caps->src_addr_widths &= ~BIT(width);
> > }
> >
> > /**
> > @@ -1803,8 +1793,6 @@ dma_slave_caps_clear_dst_width(struct dma_slave_caps *caps,
> > enum dma_slave_buswidth width)
> > {
> > __clear_bit(width, caps->dst_bus_widths);
> > - if (width < DMA_SLAVE_BUSWIDTH_32_BYTES)
> > - caps->dst_addr_widths &= ~BIT(width);
> > }
> >
> > static inline int __dma_set_bus_widths(unsigned long *bus_widths,
> >
> > --
> > 2.55.0
> >
> >
next prev parent reply other threads:[~2026-08-03 12:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 14:23 [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above Nuno Sá via B4 Relay
2026-07-30 14:23 ` [PATCH 1/9] " Nuno Sá via B4 Relay
2026-07-30 19:16 ` Frank Li
2026-08-01 2:42 ` Jonathan Cameron
2026-08-01 2:46 ` Jonathan Cameron
2026-08-03 12:35 ` Nuno Sá
2026-07-30 14:23 ` [PATCH 2/9] dmaengine: dma-axi-dmac: Use bus width capability helpers Nuno Sá via B4 Relay
2026-07-30 19:23 ` Frank Li
2026-07-30 14:23 ` [PATCH 3/9] dmaengine: dw-axi-dmac: " Nuno Sá via B4 Relay
2026-07-30 19:24 ` Frank Li
2026-07-30 14:23 ` [PATCH 4/9] dmaengine: qcom: gpi: " Nuno Sá via B4 Relay
2026-07-30 19:25 ` Frank Li
2026-07-30 14:23 ` [PATCH 5/9] dmaengine: stm32-dma3: " Nuno Sá via B4 Relay
2026-07-30 19:26 ` Frank Li
2026-07-30 14:23 ` [PATCH 6/9] iio: buffer-dmaengine: Use dma_slave_caps bus width accessors Nuno Sá via B4 Relay
2026-07-30 19:27 ` Frank Li
2026-07-30 14:23 ` [PATCH 7/9] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers Nuno Sá via B4 Relay
2026-07-30 19:30 ` Frank Li
2026-07-30 14:23 ` [PATCH 8/9] spi: dw: " Nuno Sá via B4 Relay
2026-07-30 19:31 ` Frank Li
2026-07-30 14:23 ` [PATCH 9/9] dmaengine: Drop legacy bus width fields from dma_slave_caps Nuno Sá via B4 Relay
2026-07-30 19:34 ` Frank Li
2026-08-03 12:38 ` Nuno Sá [this message]
2026-07-30 19:05 ` [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above Frank Li
2026-07-31 15:34 ` Nuno Sá
2026-07-31 15:51 ` Frank Li
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=anCLovMjz14Zxyup@nsa \
--to=noname.nuno@gmail.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.li@oss.nxp.com \
--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;
as well as URLs for NNTP newsgroup(s).