Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jyothi Kumar Seerapu" <jyothi.seerapu@oss.qualcomm.com>
Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	Frank.Li@kernel.org
Subject: Re: [PATCH 5/6] dmaengine: qcom: gpi: Add QSPI protocol support
Date: Fri, 06 Nov 2026 15:12:04 +0000	[thread overview]
Message-ID: <sashiko-outbox-201650@kernel.org> (raw)
In-Reply-To: <20261106-qspi_upstream_series-v1-5-21f43042dd60@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] dmaengine: qcom: gpi: endianness bug in
  gpi_create_i2c_tre() [1]
--

commit 9cdfe35f34d7a7a0d6e8622961798e1c9733ec6f
Author: Jyothi Kumar Seerapu <jyothi.seerapu@oss.qualcomm.com>

dmaengine: qcom: gpi: Add QSPI protocol support

This commit adds QSPI protocol support to the Qualcomm GPI DMA driver,
including QSPI transfer modes, dummy cycles, and sequential TX-then-RX
transactions.

> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> index a5055a6273af6..487e023287aa1 100644
> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
[ ... ]
> @@ -1736,7 +1742,12 @@ static int gpi_create_spi_tre(struct gchan *chan, struct gpi_desc *desc,
>  		tre = &desc->tre[tre_idx];
>  		tre_idx++;
>  
> -		tre->dword[0] = u32_encode_bits(spi->fragmentation, TRE_SPI_GO_FRAG);
> +		if (chan->protocol == QCOM_GPI_QSPI) {
> +			tre->dword[0] = u32_encode_bits(spi->fragmentation, TRE_QSPI_GO_FRAG);
> +			tre->dword[0] |= u32_encode_bits(spi->qspi_mode, TRE_QSPI_GO_MODE);
> +		} else {
> +			tre->dword[0] = u32_encode_bits(spi->fragmentation, TRE_SPI_GO_FRAG);
> +		}
>  		tre->dword[0] |= u32_encode_bits(spi->cs, TRE_SPI_GO_CS);
>  		tre->dword[0] |= u32_encode_bits(spi->cmd, TRE_SPI_GO_CMD);

[Severity: Critical]
This problem wasn't introduced by this patch, but should tre->dword[] be
written with cpu_to_le32() in gpi_create_spi_tre() and gpi_create_i2c_tre()
[1]?

Both functions populate tre->dword[] using host-endian values from
u32_encode_bits(), lower_32_bits(), and upper_32_bits():

drivers/dma/qcom/gpi.c:gpi_create_spi_tre() {
    ...
		tre->dword[0] = lower_32_bits(address);
		tre->dword[1] = upper_32_bits(address);

		tre->dword[2] = u32_encode_bits(len, TRE_DMA_LEN);
		tre->dword[3] = u32_encode_bits(TRE_TYPE_DMA, TRE_FLAGS_TYPE);
    ...
}

On big-endian hosts, the hardware receives byte-swapped descriptors, causing
DMA transfers to use corrupted configuration fields and invalid physical
addresses.

[1] https://sashiko.dev/#/bug/linux-b28be1ac-c36c-4aa8-a76a-58a19eaef473

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-qspi_upstream_series-v1-0-21f43042dd60@oss.qualcomm.com?part=5

  reply	other threads:[~2026-11-06 15:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 15:01 [PATCH 0/6] spi: qcom-geni: Add QSPI support over GPI DMA Jyothi Kumar Seerapu
2026-11-06 15:01 ` [PATCH 1/6] spi: spi-geni-qcom: Add transfer_one_message() support Jyothi Kumar Seerapu
2026-11-06 15:20   ` sashiko-bot
2026-11-06 15:01 ` [PATCH 2/6] dt-bindings: dma: qcom-gpi: Add QSPI protocol identifier Jyothi Kumar Seerapu
2026-11-09 13:42   ` Krzysztof Kozlowski
2026-11-09 14:33     ` Jyothi Kumar Seerapu
2026-11-11 12:37       ` Krzysztof Kozlowski
2026-11-06 15:01 ` [PATCH 3/6] dt-bindings: spi: qcom,spi-geni-qcom: Document QSPI support Jyothi Kumar Seerapu
2026-11-09 13:46   ` Krzysztof Kozlowski
2026-11-06 15:01 ` [PATCH 4/6] soc: qcom: geni-se: Define the QSPI firmware protocol Jyothi Kumar Seerapu
2026-11-09 13:44   ` Krzysztof Kozlowski
2026-11-09 14:43     ` Jyothi Kumar Seerapu
2026-11-11 12:40       ` Krzysztof Kozlowski
2026-11-09 14:47   ` Konrad Dybcio
2026-11-09 16:45     ` Jyothi Kumar Seerapu
2026-11-06 15:01 ` [PATCH 5/6] dmaengine: qcom: gpi: Add QSPI protocol support Jyothi Kumar Seerapu
2026-11-06 15:12   ` sashiko-bot [this message]
2026-11-06 15:01 ` [PATCH 6/6] spi: spi-geni-qcom: Add QSPI support over GPI DMA Jyothi Kumar Seerapu
2026-11-06 15:32   ` sashiko-bot
2026-11-08 15:18 ` [PATCH 0/6] spi: qcom-geni: " Mark Brown
2026-11-09  7:10   ` Jyothi Kumar Seerapu

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=sashiko-outbox-201650@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=jyothi.seerapu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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