2022-11-15 09:55:09

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder

While doing some decoder tests with Fluster and Chrome's VDA tests, I
found that the Hantro G2 was failing, and there were IOMMU fault errors
in the kernel log.

Turns out the decoder is behind the IOMMU on the H6, as shown in the
user manual.

This series adds the "iommus" property to the binding and the dtsi.
Please have a look.


Thanks
ChenYu

Chen-Yu Tsai (2):
media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2

.../bindings/media/allwinner,sun50i-h6-vpu-g2.yaml | 5 +++++
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 1 +
2 files changed, 6 insertions(+)

--
2.38.1.493.g58b659f92b-goog



2022-11-15 09:59:37

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property

The Hantro G2 video decoder block sits behind an IOMMU. The device tree
binding needs a property to reference it. Without a reference for the
implementation to properly configure the IOMMU, it will fault and cause
the video decoder to fail.

Add an "iommus" property for referring to the IOMMU port. The master ID
in the example is taken from the IOMMU fault error message on Linux,
and the number seems to match the order in the user manual's IOMMU
diagram.

Fixes: fd6be12716c4 ("media: dt-bindings: allwinner: document H6 Hantro G2 binding")
Signed-off-by: Chen-Yu Tsai <[email protected]>
---
.../bindings/media/allwinner,sun50i-h6-vpu-g2.yaml | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml b/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
index 24d7bf21499e..9d44236f2deb 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
@@ -36,6 +36,9 @@ properties:
resets:
maxItems: 1

+ iommus:
+ maxItems: 1
+
required:
- compatible
- reg
@@ -43,6 +46,7 @@ required:
- clocks
- clock-names
- resets
+ - iommus

additionalProperties: false

@@ -59,6 +63,7 @@ examples:
clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
clock-names = "bus", "mod";
resets = <&ccu RST_BUS_VP9>;
+ iommus = <&iommu 5>;
};

...
--
2.38.1.493.g58b659f92b-goog


2022-11-15 14:25:47

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property

On 15/11/2022 10:06, Chen-Yu Tsai wrote:
> The Hantro G2 video decoder block sits behind an IOMMU. The device tree
> binding needs a property to reference it. Without a reference for the
> implementation to properly configure the IOMMU, it will fault and cause
> the video decoder to fail.
>
> Add an "iommus" property for referring to the IOMMU port. The master ID
> in the example is taken from the IOMMU fault error message on Linux,
> and the number seems to match the order in the user manual's IOMMU
> diagram.
>
> Fixes: fd6be12716c4 ("media: dt-bindings: allwinner: document H6 Hantro G2 binding")
> Signed-off-by: Chen-Yu Tsai <[email protected]>
> ---


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

Best regards,
Krzysztof


2022-11-15 21:40:51

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property

Dne torek, 15. november 2022 ob 10:06:43 CET je Chen-Yu Tsai napisal(a):
> The Hantro G2 video decoder block sits behind an IOMMU. The device tree
> binding needs a property to reference it. Without a reference for the
> implementation to properly configure the IOMMU, it will fault and cause
> the video decoder to fail.

Note, Hantro G2 can happily work without IOMMU, if it is disabled for whole
system, like disabling driver in kernel config. In such cases, it uses CMA.

Anyway, it's true that there should be proper reference in DT and bindings,
so:
Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej

>
> Add an "iommus" property for referring to the IOMMU port. The master ID
> in the example is taken from the IOMMU fault error message on Linux,
> and the number seems to match the order in the user manual's IOMMU
> diagram.
>
> Fixes: fd6be12716c4 ("media: dt-bindings: allwinner: document H6 Hantro G2
> binding") Signed-off-by: Chen-Yu Tsai <[email protected]>
> ---
> .../bindings/media/allwinner,sun50i-h6-vpu-g2.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git
> a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
> b/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
> index 24d7bf21499e..9d44236f2deb 100644
> ---
> a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
> +++
> b/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
> @@ -36,6 +36,9 @@ properties:
> resets:
> maxItems: 1
>
> + iommus:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> @@ -43,6 +46,7 @@ required:
> - clocks
> - clock-names
> - resets
> + - iommus
>
> additionalProperties: false
>
> @@ -59,6 +63,7 @@ examples:
> clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
> clock-names = "bus", "mod";
> resets = <&ccu RST_BUS_VP9>;
> + iommus = <&iommu 5>;
> };
>
> ...





2022-11-16 19:08:55

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder

Dne torek, 15. november 2022 ob 10:06:42 CET je Chen-Yu Tsai napisal(a):
> While doing some decoder tests with Fluster and Chrome's VDA tests, I
> found that the Hantro G2 was failing, and there were IOMMU fault errors
> in the kernel log.
>
> Turns out the decoder is behind the IOMMU on the H6, as shown in the
> user manual.
>
> This series adds the "iommus" property to the binding and the dtsi.
> Please have a look.

Applied, thanks!

Best regards,
Jernej

>
>
> Thanks
> ChenYu
>
> Chen-Yu Tsai (2):
> media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
> arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2
>
> .../bindings/media/allwinner,sun50i-h6-vpu-g2.yaml | 5 +++++
> arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 1 +
> 2 files changed, 6 insertions(+)
>
> --
> 2.38.1.493.g58b659f92b-goog