From: "Nuno Sá" <nuno.sa@analog.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Vinod Koul <vkoul@kernel.org>,
dmaengine@vger.kernel.org, linux-iio@vger.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>, Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH v2 1/9] dmaengine: Support bus widths of 32 bytes and above
Date: Thu, 13 Aug 2026 14:17:32 +0100 [thread overview]
Message-ID: <an3DWksPdKSZ_fOK@nsa> (raw)
In-Reply-To: <an1ko4Dj_fCZuGB6@ashevche-desk.local>
On Thu, Aug 13, 2026 at 09:30:59AM +0300, Andy Shevchenko wrote:
> +Cc: Arnd — what's your opinion about dmaengine.h case (see below for the details)?
>
> On Wed, Aug 12, 2026 at 01:59:59PM +0100, Nuno Sá wrote:
> > On Wed, Aug 12, 2026 at 01:18:41PM +0100, Nuno Sá wrote:
> > > On Wed, Aug 12, 2026 at 12:48:48PM +0300, Andy Shevchenko wrote:
> > > > On Wed, Aug 12, 2026 at 10:08:34AM +0100, Nuno Sá wrote:
> > > > > On Tue, Aug 11, 2026 at 11:28:04PM +0530, Vinod Koul wrote:
>
> ...
>
> > > > > Just remembered that bitmap.h is already included in dmaengine.h anyways. bitops.h
> > > > > is because of __set/clear_bit().
> > > >
> > > > Oh my gosh, true! bitmap.h implies all bit ops, so no need then a new header.
> > > > Indeed the whole hell is due to dma_cap_zero(). So, while your patch won't
> > > > change the current state, in lieu of the said previously I would like to have
> > > > a split, but since dma_cap_zero() is used almost everywhere, perhaps make
> > > > __dma_cap_zero() an exported function then? This, of course, can be done later
> > > > but if we start from the more mess, it will be harder to untangle, so I still
> > > > think the separate header is a way to go. And perhaps these capabilities also
> > > > can be split to dmaengine-capmask.h (with a fallback inclusion in dmaengine.h)
> > > > so in the future we can only include it when it's needed.
> > >
> > > Yeps dmaengine-capmask.h would make sense to me but as I said, I really
> > > don't have the bandwidth for that!
> > >
> > > > Looking into the structure of the include/linux/dma* I even would think of
> > > > something like include/linux/dma/engine/*.h with include/linux/dmaengine.h
> > > > to collect (for backward compatibility), where the first citizen may be
> > > > your API, followed by split capmask.h.
> > >
> > > Ok. So what you have in mind is something like?
> > >
> > > <include/linux/dma/engine/buswidth.h>
> > > #include <linux/bitmap.h>
>
> > > #include <linux/dmaengine.h>
>
> Not really this one,
>
> For a bare start to have something like
For my series I need dmaengine.h because the API relies on stuct dma_dev
and the slave_config which do belong to dmaengine.h. Solution is to have
the buswidth API depend on it's own type as suggested below. That way we
should be fine.
>
> dmaengine.h:
> include dma/engine/capmask.h
> include dma/engine/types.h
>
> so the latter (types.h) will have the basic minimum that is necessary
> for capmask.h and (future) widthmask.h.
>
> > I mean, one way I can see to avoid the above include is to come up with
> > a new type like dma_cap_mask_t. Something dma_buswidth_mask_t...
>
> Works for me as well, and we can put it in
>
> include dma/engine/widthmask.h
>
> but this time without back include into linux/dmaengine.h.
>
> > > And have all the inline helpers in there.
> > >
> > > I can go with the above for v3, yes! But note one thing:
> > >
> > > enum dma_slave_buswidth
> > > DECLARE_DMA_BUS_WIDTHS()
> > >
> > > will still be part of dmaengine.h and what I could do as follow up is to
> > > move the above to something like
> > >
> > > <include/linux/dma/engine/buswidth-types.h> or maybe just have a generic
> > > <include/linux/dma/engine/types.h>
>
> Yes, the second one.
>
> > > Generic might make more sense given that we move around 7 typedefs in
> > > dmaengine.h but I'm not so sure about the enums.
>
> If enums are coupled with types, then they should be there, otherwise we also
> have a concept of defs.h (but not as distributed as types.h).
>
> > > Then, we can also do the split for capmask.h as you said. I can do the
> > > dma part of things I can't just commit to change all users in the kernel
> > > for the new headers :)
>
> But it's not needed, everything except brand new APIs will be back included
> into dmaengine.h. Old users will work, new users will be encouraged to use
> exactly what they need.
Good then! I somehow thought the expectation would be to convert
existing users!
- Nuno Sá
>
> > > (Ok, moving the buswidth types into a new header might make sense in
> > > this series - if we agree with that direction).
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
next prev parent reply other threads:[~2026-08-13 13:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 15:06 [PATCH v2 0/9] dmaengine: Support bus widths of 32 bytes and above Nuno Sá
2026-08-10 15:06 ` [PATCH v2 1/9] " Nuno Sá
2026-08-10 17:15 ` Andy Shevchenko
2026-08-11 8:46 ` Nuno Sá
2026-08-11 17:58 ` Vinod Koul
2026-08-12 9:08 ` Nuno Sá
2026-08-12 9:38 ` Nuno Sá
2026-08-12 9:50 ` Andy Shevchenko
2026-08-12 9:48 ` Andy Shevchenko
2026-08-12 12:18 ` Nuno Sá
2026-08-12 12:59 ` Nuno Sá
2026-08-13 6:30 ` Andy Shevchenko
2026-08-13 13:17 ` Nuno Sá [this message]
2026-08-10 15:06 ` [PATCH v2 2/9] dmaengine: dma-axi-dmac: Use bus width capability helpers Nuno Sá
2026-08-10 15:06 ` [PATCH v2 3/9] dmaengine: dw-axi-dmac: " Nuno Sá
2026-08-10 15:06 ` [PATCH v2 4/9] dmaengine: qcom: gpi: " Nuno Sá
2026-08-10 15:06 ` [PATCH v2 5/9] dmaengine: stm32-dma3: " Nuno Sá
2026-08-10 15:06 ` [PATCH v2 6/9] iio: buffer-dmaengine: Use dma_slave_caps bus width accessors Nuno Sá
2026-08-12 4:48 ` Jonathan Cameron
2026-08-10 15:06 ` [PATCH v2 7/9] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers Nuno Sá
2026-08-10 15:06 ` [PATCH v2 8/9] spi: dw: " Nuno Sá
2026-08-10 15:06 ` [PATCH v2 9/9] dmaengine: Drop legacy bus width fields from dma_slave_caps Nuno Sá
2026-08-10 16:56 ` 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=an3DWksPdKSZ_fOK@nsa \
--to=nuno.sa@analog.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=dlechner@baylibre.com \
--cc=dmaengine@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--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