lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250730-topic-dma_genise_cookie-v1-0-b505c1238f9f@oss.qualcomm.com>
Date: Wed, 30 Jul 2025 11:33:27 +0200
From: Konrad Dybcio <konradybcio@...nel.org>
To: Vinod Koul <vkoul@...nel.org>, Sven Peter <sven@...nel.org>, 
 Janne Grunau <j@...nau.net>, Alyssa Rosenzweig <alyssa@...enzweig.io>, 
 Neal Gompa <neal@...pa.dev>, 
 Ludovic Desroches <ludovic.desroches@...rochip.com>, 
 Florian Fainelli <florian.fainelli@...adcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>, 
 Ray Jui <rjui@...adcom.com>, Scott Branden <sbranden@...adcom.com>, 
 Paul Cercueil <paul@...pouillou.net>, 
 Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>, 
 Viresh Kumar <vireshk@...nel.org>, 
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
 Frank Li <Frank.Li@....com>, Shawn Guo <shawnguo@...nel.org>, 
 Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>, 
 Taichi Sugaya <sugaya.taichi@...ionext.com>, 
 Takao Orito <orito.takao@...ionext.com>, 
 Andreas Färber <afaerber@...e.de>, 
 Manivannan Sadhasivam <mani@...nel.org>, Daniel Mack <daniel@...que.org>, 
 Haojian Zhuang <haojian.zhuang@...il.com>, 
 Robert Jarzmik <robert.jarzmik@...e.fr>, 
 Geert Uytterhoeven <geert+renesas@...der.be>, 
 Magnus Damm <magnus.damm@...il.com>, 
 Patrice Chotard <patrice.chotard@...s.st.com>, 
 Linus Walleij <linus.walleij@...aro.org>, 
 Amélie Delaunay <amelie.delaunay@...s.st.com>, 
 Maxime Coquelin <mcoquelin.stm32@...il.com>, 
 Alexandre Torgue <alexandre.torgue@...s.st.com>, 
 Chen-Yu Tsai <wens@...e.org>, Jernej Skrabec <jernej.skrabec@...il.com>, 
 Samuel Holland <samuel@...lland.org>, 
 Laxman Dewangan <ldewangan@...dia.com>, Jon Hunter <jonathanh@...dia.com>, 
 Thierry Reding <thierry.reding@...il.com>, 
 Peter Ujfalusi <peter.ujfalusi@...il.com>, 
 Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>, 
 Masami Hiramatsu <mhiramat@...nel.org>, Michal Simek <michal.simek@....com>, 
 Laurent Pinchart <laurent.pinchart@...asonboard.com>, 
 Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>, 
 Martin Povišer <povik+lin@...ebit.org>, 
 Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, 
 Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>, 
 Mukesh Kumar Savaliya <quic_msavaliy@...cinc.com>, 
 Viken Dadhaniya <quic_vdadhani@...cinc.com>, 
 Andi Shyti <andi.shyti@...nel.org>, 
 Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Bjorn Andersson <andersson@...nel.org>, 
 Konrad Dybcio <konradybcio@...nel.org>
Cc: Marijn Suijten <marijn.suijten@...ainline.org>, 
 dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org, 
 asahi@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, 
 linux-rpi-kernel@...ts.infradead.org, linux-mips@...r.kernel.org, 
 imx@...ts.linux.dev, linux-actions@...ts.infradead.org, 
 linux-arm-msm@...r.kernel.org, linux-renesas-soc@...r.kernel.org, 
 linux-stm32@...md-mailman.stormreply.com, linux-sunxi@...ts.linux.dev, 
 linux-tegra@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-sound@...r.kernel.org, linux-i2c@...r.kernel.org, 
 linux-spi@...r.kernel.org, Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Subject: [RFC PATCH 0/6] Allow DMA consumers to pass a cookie to providers'
 of_xlate

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@...bar {
	compatible = "qcom,geni-i2c";
	dmas = <&gpi_dma1 0 0 QCOM_GPI_I2C>,
	       <&gpi_dma1 1 0 QCOM_GPI_I2C>;
	// actual hw description
};

spi@...bar {
        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@....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@....qualcomm.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ