linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] Allow DMA consumers to pass a cookie to providers' of_xlate
@ 2025-07-30  9:33 Konrad Dybcio
  2025-07-30  9:33 ` [PATCH RFC 1/6] dt-bindings: dma: qcom,gpi: Retire passing the protocol ID Konrad Dybcio
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Konrad Dybcio @ 2025-07-30  9:33 UTC (permalink / raw)
  To: Vinod Koul, Sven Peter, Janne Grunau, Alyssa Rosenzweig,
	Neal Gompa, Ludovic Desroches, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Paul Cercueil, Eugeniy Paltsev, Viresh Kumar, Andy Shevchenko,
	Frank Li, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Taichi Sugaya, Takao Orito, Andreas Färber,
	Manivannan Sadhasivam, Daniel Mack, Haojian Zhuang,
	Robert Jarzmik, Geert Uytterhoeven, Magnus Damm, Patrice Chotard,
	Linus Walleij, Amélie Delaunay, Maxime Coquelin,
	Alexandre Torgue, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Laxman Dewangan, Jon Hunter, Thierry Reding, Peter Ujfalusi,
	Kunihiko Hayashi, Masami Hiramatsu, Michal Simek,
	Laurent Pinchart, Rob Herring, Saravana Kannan,
	Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Kuninori Morimoto, Mukesh Kumar Savaliya,
	Viken Dadhaniya, Andi Shyti, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio
  Cc: Marijn Suijten, dmaengine, linux-kernel, asahi, linux-arm-kernel,
	linux-rpi-kernel, linux-mips, imx, linux-actions, linux-arm-msm,
	linux-renesas-soc, linux-stm32, linux-sunxi, linux-tegra,
	devicetree, linux-sound, linux-i2c, linux-spi, Konrad Dybcio

The DMA subsystem attempts to make it theoretically possible to pair
any DMA block with any user. While that's convenient from a
codebase sanity perspective, some blocks are more intertwined.

One such case is the Qualcomm GENI, where each wrapper contains a
number of Serial Engine instances, each one of which can be programmed
to support a different protocol (such as I2C, I3C, SPI, UART, etc.).

The GPI DMA it's designed together with, needs to receive the ID of the
protocol that's in use, to adjust its behavior accordingly. Currently,
that's done through passing that ID through device tree, with each
Serial Engine expressed NUM_PROTOCOL times, resulting in terrible
dt-bindings that are full of useless copypasta.

Currently, the DT looks like:

i2c@foobar {
	compatible = "qcom,geni-i2c";
	dmas = <&gpi_dma1 0 0 QCOM_GPI_I2C>,
	       <&gpi_dma1 1 0 QCOM_GPI_I2C>;
	// actual hw description
};

spi@foobar {
        compatible = "qcom,geni-spi";
        dmas = <&gpi_dma1 0 1 QCOM_GPI_SPI>,
               <&gpi_dma1 1 1 QCOM_GPI_SPI>;
	// actual, identical hw description
};

Which is manageable when there's two of them. Unfortunately, we're
in the double digits range nowadays.

This series attempts to cut down on that through making the last cell
unnecessary, moving the purely-SW data that the current protocol ID is
into the driver.

The mass of_xlate signature change is a little unfortunate, let me know
if it can be avoided somehow..

Attaching the relevant dt-bindings change and converting one platform
over as an example.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Konrad Dybcio (6):
      dt-bindings: dma: qcom,gpi: Retire passing the protocol ID
      dmaengine: Make of_dma_request_slave_channel pass a cookie to of_xlate
      dmaengine: qcom: gpi: Accept protocol ID hints
      i2c: qcom-geni: Hint GENI protocol ID to GPI DMA
      spi: geni-qcom: Hint GENI protocol ID to GPI DMA
      arm64: dts: qcom: x1e80100: Remove GENI protocol ID from DMA cells

 .../devicetree/bindings/dma/qcom,gpi.yaml          |   5 +-
 arch/arm64/boot/dts/qcom/x1e80100.dtsi             | 198 ++++++++++-----------
 drivers/dma/amba-pl08x.c                           |   3 +-
 drivers/dma/apple-admac.c                          |   3 +-
 drivers/dma/at_hdmac.c                             |   6 +-
 drivers/dma/at_xdmac.c                             |   3 +-
 drivers/dma/bcm2835-dma.c                          |   3 +-
 drivers/dma/dma-jz4780.c                           |   3 +-
 drivers/dma/dmaengine.c                            |  20 ++-
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c     |   3 +-
 drivers/dma/dw/of.c                                |   3 +-
 drivers/dma/ep93xx_dma.c                           |   6 +-
 drivers/dma/fsl-edma-main.c                        |   6 +-
 drivers/dma/img-mdc-dma.c                          |   3 +-
 drivers/dma/imx-dma.c                              |   3 +-
 drivers/dma/imx-sdma.c                             |   3 +-
 drivers/dma/lgm/lgm-dma.c                          |   3 +-
 drivers/dma/milbeaut-hdmac.c                       |   4 +-
 drivers/dma/mmp_pdma.c                             |   3 +-
 drivers/dma/mmp_tdma.c                             |   3 +-
 drivers/dma/moxart-dma.c                           |   3 +-
 drivers/dma/mxs-dma.c                              |   3 +-
 drivers/dma/nbpfaxi.c                              |   3 +-
 drivers/dma/of-dma.c                               |  18 +-
 drivers/dma/owl-dma.c                              |   3 +-
 drivers/dma/pl330.c                                |   3 +-
 drivers/dma/pxa_dma.c                              |   3 +-
 drivers/dma/qcom/bam_dma.c                         |   3 +-
 drivers/dma/qcom/gpi.c                             |  16 +-
 drivers/dma/qcom/qcom_adm.c                        |   3 +-
 drivers/dma/sh/rcar-dmac.c                         |   3 +-
 drivers/dma/sh/rz-dmac.c                           |   3 +-
 drivers/dma/sh/usb-dmac.c                          |   3 +-
 drivers/dma/st_fdma.c                              |   3 +-
 drivers/dma/ste_dma40.c                            |   3 +-
 drivers/dma/stm32/stm32-dma.c                      |   3 +-
 drivers/dma/stm32/stm32-dma3.c                     |   4 +-
 drivers/dma/stm32/stm32-mdma.c                     |   3 +-
 drivers/dma/sun4i-dma.c                            |   3 +-
 drivers/dma/sun6i-dma.c                            |   3 +-
 drivers/dma/tegra186-gpc-dma.c                     |   3 +-
 drivers/dma/tegra20-apb-dma.c                      |   3 +-
 drivers/dma/tegra210-adma.c                        |   3 +-
 drivers/dma/ti/cppi41.c                            |   3 +-
 drivers/dma/ti/edma.c                              |   3 +-
 drivers/dma/ti/k3-udma.c                           |   3 +-
 drivers/dma/uniphier-xdmac.c                       |   3 +-
 drivers/dma/xilinx/xilinx_dma.c                    |   3 +-
 drivers/dma/xilinx/xilinx_dpdma.c                  |   3 +-
 drivers/dma/xilinx/zynqmp_dma.c                    |   3 +-
 drivers/i2c/busses/i2c-qcom-geni.c                 |   4 +-
 drivers/spi/spi-geni-qcom.c                        |   4 +-
 include/linux/dmaengine.h                          |   7 +
 include/linux/of_dma.h                             |  16 +-
 sound/soc/apple/mca.c                              |   2 +-
 sound/soc/renesas/rcar/dma.c                       |   2 +-
 56 files changed, 261 insertions(+), 177 deletions(-)
---
base-commit: 79fb37f39b77bbf9a56304e9af843cd93a7a1916
change-id: 20250714-topic-dma_genise_cookie-66dcb07f3fd9

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-08-05 22:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30  9:33 [RFC PATCH 0/6] Allow DMA consumers to pass a cookie to providers' of_xlate Konrad Dybcio
2025-07-30  9:33 ` [PATCH RFC 1/6] dt-bindings: dma: qcom,gpi: Retire passing the protocol ID Konrad Dybcio
2025-07-30 23:46   ` Rob Herring
2025-08-01 11:36     ` Konrad Dybcio
2025-07-30  9:33 ` [PATCH RFC 2/6] dmaengine: Make of_dma_request_slave_channel pass a cookie to of_xlate Konrad Dybcio
2025-07-30 16:39   ` Frank Li
2025-07-30 18:04     ` Laurent Pinchart
2025-07-30 18:37       ` Frank Li
2025-08-01 12:00         ` Laurent Pinchart
2025-08-02 12:37           ` Konrad Dybcio
2025-08-04 23:51             ` Laurent Pinchart
2025-08-05 14:04               ` Konrad Dybcio
2025-07-30  9:33 ` [PATCH RFC 3/6] dmaengine: qcom: gpi: Accept protocol ID hints Konrad Dybcio
2025-07-30 11:32   ` Geert Uytterhoeven
2025-08-02 12:39     ` Konrad Dybcio
2025-08-05 22:08     ` Andy Shevchenko
2025-07-30  9:33 ` [PATCH RFC 4/6] i2c: qcom-geni: Hint GENI protocol ID to GPI DMA Konrad Dybcio
2025-07-30  9:33 ` [PATCH RFC 5/6] spi: geni-qcom: " Konrad Dybcio
2025-07-30 10:19   ` Mark Brown
2025-07-30  9:33 ` [PATCH RFC 6/6] arm64: dts: qcom: x1e80100: Remove GENI protocol ID from DMA cells Konrad Dybcio

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).