All of lore.kernel.org
 help / color / mirror / Atom feed
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 8/9] spi: dw: Use dma_slave_caps bus width helpers
Date: Thu, 30 Jul 2026 14:31:43 -0500	[thread overview]
Message-ID: <amumn1HJAcxVEWt5@SMW015318> (raw)
In-Reply-To: <20260730-dmaengine-support-wider-dma-masks-v1-8-3732f1f9d9ca@analog.com>

On Thu, Jul 30, 2026 at 03:23:15PM +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>
>
> Store the common TX destination and RX source bus widths in a
> driver-owned DMA bus width bitmap and populate it through the
> dma_slave_caps helper.
>
> This avoids depending on the legacy src_addr_widths and dst_addr_widths
> masks returned by dma_get_slave_caps().
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/spi/spi-dw-dma.c | 6 +++---
>  drivers/spi/spi-dw.h     | 3 ++-
>  2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
> index fe726b9b1780..2e23ead4a94f 100644
> --- a/drivers/spi/spi-dw-dma.c
> +++ b/drivers/spi/spi-dw-dma.c
> @@ -100,10 +100,10 @@ static int dw_spi_dma_caps_init(struct dw_spi *dws)
>
>         /*
>          * Assuming both channels belong to the same DMA controller hence the
> -        * peripheral side address width capabilities most likely would be
> +        * peripheral side bus width capabilities most likely would be
>          * the same.
>          */
> -       dws->dma_addr_widths = tx.dst_addr_widths & rx.src_addr_widths;
> +       dma_slave_caps_intersect_widths(&tx, &rx, dws->dma_bus_widths);
>
>         return 0;
>  }
> @@ -253,7 +253,7 @@ static bool dw_spi_can_dma(struct spi_controller *ctlr,
>
>         dma_bus_width = dw_spi_dma_convert_width(dws->n_bytes);
>
> -       return dws->dma_addr_widths & BIT(dma_bus_width);
> +       return test_bit(dma_bus_width, dws->dma_bus_widths);
>  }
>
>  static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)
> diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
> index 9cc79c566a70..9111ffc5e9d7 100644
> --- a/drivers/spi/spi-dw.h
> +++ b/drivers/spi/spi-dw.h
> @@ -10,6 +10,7 @@
>  #include <linux/scatterlist.h>
>  #include <linux/spi/spi-mem.h>
>  #include <linux/bitfield.h>
> +#include <linux/dmaengine.h>
>
>  /* Synopsys DW SSI IP-core virtual IDs */
>  #define DW_PSSI_ID                     0
> @@ -190,7 +191,7 @@ struct dw_spi {
>         struct dma_chan         *rxchan;
>         u32                     rxburst;
>         u32                     dma_sg_burst;
> -       u32                     dma_addr_widths;
> +       DECLARE_DMA_BUS_WIDTHS(dma_bus_widths);
>         unsigned long           dma_chan_busy;
>         dma_addr_t              dma_addr; /* phy address of the Data register */
>         const struct dw_spi_dma_ops *dma_ops;
>
> --
> 2.55.0
>
>

  parent reply	other threads:[~2026-07-30 19:31 UTC|newest]

Thread overview: 36+ 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 ` Nuno Sá
2026-07-30 14:23 ` [PATCH 1/9] " Nuno Sá via B4 Relay
2026-07-30 14:23   ` Nuno Sá
2026-07-30 14:38   ` sashiko-bot
2026-07-30 19:16   ` Frank Li
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 14:23   ` Nuno Sá
2026-07-30 14:39   ` sashiko-bot
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 14:23   ` Nuno Sá
2026-07-30 14:36   ` sashiko-bot
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 14:23   ` Nuno Sá
2026-07-30 14:43   ` sashiko-bot
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 14:23   ` Nuno Sá
2026-07-30 14:35   ` sashiko-bot
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 14:23   ` Nuno Sá
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 14:23   ` Nuno Sá
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 14:23   ` Nuno Sá
2026-07-30 14:43   ` sashiko-bot
2026-07-30 19:31   ` Frank Li [this message]
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 14:23   ` Nuno Sá
2026-07-30 19:34   ` Frank Li
2026-07-30 19:05 ` [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above 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=amumn1HJAcxVEWt5@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.