linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder
@ 2022-11-15  9:06 Chen-Yu Tsai
  2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2022-11-15  9:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Jernej Skrabec, Samuel Holland, Hans Verkuil
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

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


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

* [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
  2022-11-15  9:06 [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Chen-Yu Tsai
@ 2022-11-15  9:06 ` Chen-Yu Tsai
  2022-11-15 14:11   ` Krzysztof Kozlowski
  2022-11-15 21:30   ` Jernej Škrabec
  2022-11-15  9:06 ` [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 Chen-Yu Tsai
  2022-11-16 18:31 ` [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Jernej Škrabec
  2 siblings, 2 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2022-11-15  9:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Jernej Skrabec, Samuel Holland, Hans Verkuil
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

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 <wenst@chromium.org>
---
 .../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


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

* [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2
  2022-11-15  9:06 [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Chen-Yu Tsai
  2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
@ 2022-11-15  9:06 ` Chen-Yu Tsai
  2022-11-15 21:31   ` Jernej Škrabec
  2022-11-16 18:31 ` [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Jernej Škrabec
  2 siblings, 1 reply; 7+ messages in thread
From: Chen-Yu Tsai @ 2022-11-15  9:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Jernej Skrabec, Samuel Holland, Hans Verkuil
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

The Hantro G2 video decoder block sits behind the IOMMU. Without a
reference for the system to properly configure the IOMMU, it will fault
and cause the video decoder to fail.

Add a proper reference to the IOMMU port. The master ID 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: 0baddea60e8d ("arm64: dts: allwinner: h6: Add Hantro G2 node")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 53f6660656ac..ca1d287a0a01 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -161,6 +161,7 @@ video-codec-g2@1c00000 {
 			clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
 			clock-names = "bus", "mod";
 			resets = <&ccu RST_BUS_VP9>;
+			iommus = <&iommu 5>;
 		};
 
 		video-codec@1c0e000 {
-- 
2.38.1.493.g58b659f92b-goog


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

* Re: [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
  2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
@ 2022-11-15 14:11   ` Krzysztof Kozlowski
  2022-11-15 21:30   ` Jernej Škrabec
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-15 14:11 UTC (permalink / raw)
  To: Chen-Yu Tsai, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Jernej Skrabec, Samuel Holland,
	Hans Verkuil
  Cc: linux-media, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel

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 <wenst@chromium.org>
> ---


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
  2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
  2022-11-15 14:11   ` Krzysztof Kozlowski
@ 2022-11-15 21:30   ` Jernej Škrabec
  1 sibling, 0 replies; 7+ messages in thread
From: Jernej Škrabec @ 2022-11-15 21:30 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Samuel Holland, Hans Verkuil, Chen-Yu Tsai
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

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 <jernej.skrabec@gmail.com>

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 <wenst@chromium.org>
> ---
>  .../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>;
>      };
> 
>  ...





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

* Re: [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2
  2022-11-15  9:06 ` [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 Chen-Yu Tsai
@ 2022-11-15 21:31   ` Jernej Škrabec
  0 siblings, 0 replies; 7+ messages in thread
From: Jernej Škrabec @ 2022-11-15 21:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Samuel Holland, Hans Verkuil, Chen-Yu Tsai
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

Dne torek, 15. november 2022 ob 10:06:44 CET je Chen-Yu Tsai napisal(a):
> The Hantro G2 video decoder block sits behind the IOMMU. Without a
> reference for the system to properly configure the IOMMU, it will fault
> and cause the video decoder to fail.
> 
> Add a proper reference to the IOMMU port. The master ID 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: 0baddea60e8d ("arm64: dts: allwinner: h6: Add Hantro G2 node")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



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

* Re: [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder
  2022-11-15  9:06 [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Chen-Yu Tsai
  2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
  2022-11-15  9:06 ` [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 Chen-Yu Tsai
@ 2022-11-16 18:31 ` Jernej Škrabec
  2 siblings, 0 replies; 7+ messages in thread
From: Jernej Škrabec @ 2022-11-16 18:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Samuel Holland, Hans Verkuil, Chen-Yu Tsai
  Cc: Chen-Yu Tsai, linux-media, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel

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



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

end of thread, other threads:[~2022-11-16 18:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  9:06 [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Chen-Yu Tsai
2022-11-15  9:06 ` [PATCH 1/2] media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property Chen-Yu Tsai
2022-11-15 14:11   ` Krzysztof Kozlowski
2022-11-15 21:30   ` Jernej Škrabec
2022-11-15  9:06 ` [PATCH 2/2] arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2 Chen-Yu Tsai
2022-11-15 21:31   ` Jernej Škrabec
2022-11-16 18:31 ` [PATCH 0/2] arm64: allwinner: h6: Add IOMMU reference to Hantro G2 decoder Jernej Škrabec

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