linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234
@ 2025-05-06 17:58 Vishwaroop A
  2025-05-06 18:12 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Vishwaroop A @ 2025-05-06 17:58 UTC (permalink / raw)
  To: va, krzk, broonie, robh, krzk+dt, conor+dt, thierry.reding,
	jonathanh, skomatineni, ldewangan, kyarlagadda, smangipudi,
	linux-spi, devicetree, linux-tegra, linux-kernel

The Tegra210 Quad SPI controller uses internal DMA engines to efficiently transfer data between system memory and the SPI bus. On Tegra234 platform, DMA transactions must be properly mapped and protected through IOMMU to ensure system security and functional correctness. Tegra241 uses external DMA and doesn't require IOMMU.

Add the iommus property to the device tree binding, making it required only for Tegra234 platform while explicitly disallowing it for other platforms including Tegra241.

Signed-off-by: Vishwaroop A <va@nvidia.com>
---
 .../bindings/spi/nvidia,tegra210-quad.yaml    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
index 48e97e240265..ac79cb19c81a 100644
--- a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
+++ b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
@@ -12,6 +12,25 @@ maintainers:
 
 allOf:
   - $ref: spi-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra234-qspi
+    then:
+      required:
+        - iommus
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra210-qspi
+            - nvidia,tegra186-qspi
+            - nvidia,tegra194-qspi
+            - nvidia,tegra241-qspi
+    then:
+      properties:
+        iommus: false
 
 properties:
   compatible:
@@ -47,6 +66,9 @@ properties:
       - const: rx
       - const: tx
 
+  iommus:
+    maxItems: 1
+
 patternProperties:
   "@[0-9a-f]+$":
     type: object
-- 
2.17.1


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

* [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234
@ 2025-05-06 18:08 Vishwaroop A
  2025-05-06 18:14 ` Krzysztof Kozlowski
  2025-05-14 19:01 ` Rob Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Vishwaroop A @ 2025-05-06 18:08 UTC (permalink / raw)
  To: va, krzk, broonie, robh, krzk+dt, conor+dt, thierry.reding,
	jonathanh, skomatineni, ldewangan, kyarlagadda, smangipudi,
	linux-spi, devicetree, linux-tegra, linux-kernel

The Tegra210 Quad SPI controller uses internal DMA engines to efficiently
transfer data between system memory and the SPI bus. On Tegra234 platform,
DMA transactions must be properly mapped and protected through IOMMU to
ensure system security and functional correctness. Tegra241 uses external
DMA and doesn't require IOMMU.

Add the iommus property to the device tree binding, making it required
only for Tegra234 platform while explicitly disallowing it for other
platforms including Tegra241.

Signed-off-by: Vishwaroop A <va@nvidia.com>
---
 .../bindings/spi/nvidia,tegra210-quad.yaml    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
index 48e97e240265..ac79cb19c81a 100644
--- a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
+++ b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
@@ -12,6 +12,25 @@ maintainers:
 
 allOf:
   - $ref: spi-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra234-qspi
+    then:
+      required:
+        - iommus
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra210-qspi
+            - nvidia,tegra186-qspi
+            - nvidia,tegra194-qspi
+            - nvidia,tegra241-qspi
+    then:
+      properties:
+        iommus: false
 
 properties:
   compatible:
@@ -47,6 +66,9 @@ properties:
       - const: rx
       - const: tx
 
+  iommus:
+    maxItems: 1
+
 patternProperties:
   "@[0-9a-f]+$":
     type: object
-- 
2.17.1


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

* Re: [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234
  2025-05-06 17:58 [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234 Vishwaroop A
@ 2025-05-06 18:12 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-06 18:12 UTC (permalink / raw)
  To: Vishwaroop A, broonie, robh, krzk+dt, conor+dt, thierry.reding,
	jonathanh, skomatineni, ldewangan, kyarlagadda, smangipudi,
	linux-spi, devicetree, linux-tegra, linux-kernel

On 06/05/2025 19:58, Vishwaroop A wrote:
> The Tegra210 Quad SPI controller uses internal DMA engines to efficiently transfer data between system memory and the SPI bus. On Tegra234 platform, DMA transactions must be properly mapped and protected through IOMMU to ensure system security and functional correctness. Tegra241 uses external DMA and doesn't require IOMMU.


Please wrap commit message according to Linux coding style / submission
process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597

I don't think you read the review, just skimmed. I explained there how
to construct subject prefix and gave a link explaining it better.

Can you reach to your colleagues to help in upstreaming process to avoid
easy mistakes? Many companies have internal checklists or internal
guides helping in that...

> 
> Add the iommus property to the device tree binding, making it required only for Tegra234 platform while explicitly disallowing it for other platforms including Tegra241.

Why requiring it for Tegra234? Do not explain what you did - we see it
easily. Explain what we do not see, so why you are breaking ABI.


Best regards,
Krzysztof

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

* Re: [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234
  2025-05-06 18:08 Vishwaroop A
@ 2025-05-06 18:14 ` Krzysztof Kozlowski
  2025-05-14 19:01 ` Rob Herring
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-06 18:14 UTC (permalink / raw)
  To: Vishwaroop A, broonie, robh, krzk+dt, conor+dt, thierry.reding,
	jonathanh, skomatineni, ldewangan, kyarlagadda, smangipudi,
	linux-spi, devicetree, linux-tegra, linux-kernel

On 06/05/2025 20:08, Vishwaroop A wrote:
> The Tegra210 Quad SPI controller uses internal DMA engines to efficiently
> transfer data between system memory and the SPI bus. On Tegra234 platform,
> DMA transactions must be properly mapped and protected through IOMMU to
> ensure system security and functional correctness. Tegra241 uses external
> DMA and doesn't require IOMMU.
> 
> Add the iommus property to the device tree binding, making it required
> only for Tegra234 platform while explicitly disallowing it for other
> platforms including Tegra241.
> 
> Signed-off-by: Vishwaroop A <va@nvidia.com>
That's another v2? I reviewed one. Some of my comments are still valid.
Can you slow down with new versions and spend some time to read the
feedback you receive?

Best regards,
Krzysztof

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

* Re: [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234
  2025-05-06 18:08 Vishwaroop A
  2025-05-06 18:14 ` Krzysztof Kozlowski
@ 2025-05-14 19:01 ` Rob Herring
  1 sibling, 0 replies; 5+ messages in thread
From: Rob Herring @ 2025-05-14 19:01 UTC (permalink / raw)
  To: Vishwaroop A
  Cc: krzk, broonie, krzk+dt, conor+dt, thierry.reding, jonathanh,
	skomatineni, ldewangan, kyarlagadda, smangipudi, linux-spi,
	devicetree, linux-tegra, linux-kernel

On Tue, May 06, 2025 at 06:08:48PM +0000, Vishwaroop A wrote:
> The Tegra210 Quad SPI controller uses internal DMA engines to efficiently
> transfer data between system memory and the SPI bus. On Tegra234 platform,
> DMA transactions must be properly mapped and protected through IOMMU to
> ensure system security and functional correctness. Tegra241 uses external
> DMA and doesn't require IOMMU.
> 
> Add the iommus property to the device tree binding, making it required
> only for Tegra234 platform while explicitly disallowing it for other
> platforms including Tegra241.
> 
> Signed-off-by: Vishwaroop A <va@nvidia.com>
> ---
>  .../bindings/spi/nvidia,tegra210-quad.yaml    | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
> index 48e97e240265..ac79cb19c81a 100644
> --- a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
> +++ b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
> @@ -12,6 +12,25 @@ maintainers:
>  
>  allOf:
>    - $ref: spi-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:

Use 'contains' here so if this is ever a fallback, it works for that 
case.

> +          enum:
> +            - nvidia,tegra234-qspi
> +    then:
> +      required:
> +        - iommus
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - nvidia,tegra210-qspi
> +            - nvidia,tegra186-qspi
> +            - nvidia,tegra194-qspi
> +            - nvidia,tegra241-qspi

Shouldn't this just be an 'else'? I suppose sometimes an IOMMU might not 
be enabled, but that's policy. Either the h/w has an IOMMU or it 
doesn't.

> +    then:
> +      properties:
> +        iommus: false
>  
>  properties:
>    compatible:
> @@ -47,6 +66,9 @@ properties:
>        - const: rx
>        - const: tx
>  
> +  iommus:
> +    maxItems: 1
> +
>  patternProperties:
>    "@[0-9a-f]+$":
>      type: object
> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2025-05-14 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 17:58 [PATCH v2] dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234 Vishwaroop A
2025-05-06 18:12 ` Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2025-05-06 18:08 Vishwaroop A
2025-05-06 18:14 ` Krzysztof Kozlowski
2025-05-14 19:01 ` Rob Herring

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