2022-04-06 16:45:48

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 1/3] dmaengine: qcom: gpi: set chain and link flag for duplex

Newer platforms seem to have strict requirement for TRE flags which
causes transaction to timeout. This was resolved to missing chain and
link flag for duplex spi transaction.

So add these two flags.

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/dma/qcom/gpi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
index 94f3648f7483..3429ceccd13b 100644
--- a/drivers/dma/qcom/gpi.c
+++ b/drivers/dma/qcom/gpi.c
@@ -1754,10 +1754,14 @@ static int gpi_create_spi_tre(struct gchan *chan, struct gpi_desc *desc,
tre->dword[2] = u32_encode_bits(spi->rx_len, TRE_RX_LEN);

tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE);
- if (spi->cmd == SPI_RX)
+ if (spi->cmd == SPI_RX) {
tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB);
- else
+ } else if (spi->cmd == SPI_TX) {
+ tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
+ } else { /* SPI_DUPLEX */
tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
+ tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK);
+ }
}

/* create the dma tre */
--
2.34.1


2022-04-06 16:46:01

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: dmaengine: qcom: gpi: add compatible for sm8350/sm8350

Add the compatible for newer qcom socs with gpi dma i.e qcom sm8350 and
sm8450.

Signed-off-by: Vinod Koul <[email protected]>
---
Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
index e614fe3187bb..67f046a4a442 100644
--- a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
+++ b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
@@ -22,6 +22,8 @@ properties:
- qcom,sdm845-gpi-dma
- qcom,sm8150-gpi-dma
- qcom,sm8250-gpi-dma
+ - qcom,sm8350-gpi-dma
+ - qcom,sm8450-gpi-dma

reg:
maxItems: 1
--
2.34.1

2022-04-07 17:01:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: dmaengine: qcom: gpi: add compatible for sm8350/sm8350

On 06/04/2022 15:25, Vinod Koul wrote:
> Add the compatible for newer qcom socs with gpi dma i.e qcom sm8350 and
> sm8450.
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---
> Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>


Acked-by: Krzysztof Kozlowski <[email protected]>


Best regards,
Krzysztof

2022-04-13 00:07:57

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: dmaengine: qcom: gpi: add compatible for sm8350/sm8350

On Wed 06 Apr 06:25 PDT 2022, Vinod Koul wrote:

> Add the compatible for newer qcom socs with gpi dma i.e qcom sm8350 and
> sm8450.
>
> Signed-off-by: Vinod Koul <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>

> ---
> Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
> index e614fe3187bb..67f046a4a442 100644
> --- a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
> +++ b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml
> @@ -22,6 +22,8 @@ properties:
> - qcom,sdm845-gpi-dma
> - qcom,sm8150-gpi-dma
> - qcom,sm8250-gpi-dma
> + - qcom,sm8350-gpi-dma
> + - qcom,sm8450-gpi-dma
>
> reg:
> maxItems: 1
> --
> 2.34.1
>

2022-04-13 01:01:07

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/3] dmaengine: qcom: gpi: set chain and link flag for duplex

On Wed 06 Apr 06:25 PDT 2022, Vinod Koul wrote:

> Newer platforms seem to have strict requirement for TRE flags which
> causes transaction to timeout. This was resolved to missing chain and
> link flag for duplex spi transaction.
>
> So add these two flags.
>
> Signed-off-by: Vinod Koul <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>
Tested-by: Bjorn Andersson <[email protected]>

> ---
> drivers/dma/qcom/gpi.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> index 94f3648f7483..3429ceccd13b 100644
> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
> @@ -1754,10 +1754,14 @@ static int gpi_create_spi_tre(struct gchan *chan, struct gpi_desc *desc,
> tre->dword[2] = u32_encode_bits(spi->rx_len, TRE_RX_LEN);
>
> tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE);
> - if (spi->cmd == SPI_RX)
> + if (spi->cmd == SPI_RX) {
> tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB);
> - else
> + } else if (spi->cmd == SPI_TX) {
> + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
> + } else { /* SPI_DUPLEX */
> tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
> + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK);
> + }
> }
>
> /* create the dma tre */
> --
> 2.34.1
>

2022-04-14 15:06:23

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/3] dmaengine: qcom: gpi: set chain and link flag for duplex

On 06-04-22, 18:55, Vinod Koul wrote:
> Newer platforms seem to have strict requirement for TRE flags which
> causes transaction to timeout. This was resolved to missing chain and
> link flag for duplex spi transaction.
>
> So add these two flags.

Applied all, thanks

--
~Vinod