* [PATCH 0/2] media: rockchip: rga: Add rk3568 support @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The RGA2 on the Rockchip rk3568 is the same core as the RGA2 on the Rockchip rk3288. This series adds the necessary device tree binding and node in the device tree to enable the RGA2 on the Rockchip rk3568. I tested the driver with the GStreamer v4l2convert element on a ROCK3A board. Michael Michael Tretter (2): media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga arm64: dts: rockchip: Add RGA2 support to rk356x .../devicetree/bindings/media/rockchip-rga.yaml | 4 +++- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) -- 2.30.2 ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 0/2] media: rockchip: rga: Add rk3568 support @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The RGA2 on the Rockchip rk3568 is the same core as the RGA2 on the Rockchip rk3288. This series adds the necessary device tree binding and node in the device tree to enable the RGA2 on the Rockchip rk3568. I tested the driver with the GStreamer v4l2convert element on a ROCK3A board. Michael Michael Tretter (2): media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga arm64: dts: rockchip: Add RGA2 support to rk356x .../devicetree/bindings/media/rockchip-rga.yaml | 4 +++- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 0/2] media: rockchip: rga: Add rk3568 support @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The RGA2 on the Rockchip rk3568 is the same core as the RGA2 on the Rockchip rk3288. This series adds the necessary device tree binding and node in the device tree to enable the RGA2 on the Rockchip rk3568. I tested the driver with the GStreamer v4l2convert element on a ROCK3A board. Michael Michael Tretter (2): media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga arm64: dts: rockchip: Add RGA2 support to rk356x .../devicetree/bindings/media/rockchip-rga.yaml | 4 +++- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) -- 2.30.2 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga 2022-11-21 15:17 ` Michael Tretter (?) @ 2022-11-21 15:17 ` Michael Tretter -1 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel Add a new compatible for the rk3568 Rockchip SoC, which also features an RGA, which is called RGA2 in the TRM Part2. It is the same core as used on the rk3288, which documents the same RGA2. Specify a new compatible for the rk3568 to be able to handle unknown SoC-specific differences in the driver. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- Documentation/devicetree/bindings/media/rockchip-rga.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/rockchip-rga.yaml b/Documentation/devicetree/bindings/media/rockchip-rga.yaml index dd645ddccb07..ea2342222408 100644 --- a/Documentation/devicetree/bindings/media/rockchip-rga.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-rga.yaml @@ -21,7 +21,9 @@ properties: - const: rockchip,rk3288-rga - const: rockchip,rk3399-rga - items: - - const: rockchip,rk3228-rga + - enum: + - rockchip,rk3228-rga + - rockchip,rk3568-rga - const: rockchip,rk3288-rga reg: -- 2.30.2 ^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel Add a new compatible for the rk3568 Rockchip SoC, which also features an RGA, which is called RGA2 in the TRM Part2. It is the same core as used on the rk3288, which documents the same RGA2. Specify a new compatible for the rk3568 to be able to handle unknown SoC-specific differences in the driver. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- Documentation/devicetree/bindings/media/rockchip-rga.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/rockchip-rga.yaml b/Documentation/devicetree/bindings/media/rockchip-rga.yaml index dd645ddccb07..ea2342222408 100644 --- a/Documentation/devicetree/bindings/media/rockchip-rga.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-rga.yaml @@ -21,7 +21,9 @@ properties: - const: rockchip,rk3288-rga - const: rockchip,rk3399-rga - items: - - const: rockchip,rk3228-rga + - enum: + - rockchip,rk3228-rga + - rockchip,rk3568-rga - const: rockchip,rk3288-rga reg: -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel Add a new compatible for the rk3568 Rockchip SoC, which also features an RGA, which is called RGA2 in the TRM Part2. It is the same core as used on the rk3288, which documents the same RGA2. Specify a new compatible for the rk3568 to be able to handle unknown SoC-specific differences in the driver. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- Documentation/devicetree/bindings/media/rockchip-rga.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/rockchip-rga.yaml b/Documentation/devicetree/bindings/media/rockchip-rga.yaml index dd645ddccb07..ea2342222408 100644 --- a/Documentation/devicetree/bindings/media/rockchip-rga.yaml +++ b/Documentation/devicetree/bindings/media/rockchip-rga.yaml @@ -21,7 +21,9 @@ properties: - const: rockchip,rk3288-rga - const: rockchip,rk3399-rga - items: - - const: rockchip,rk3228-rga + - enum: + - rockchip,rk3228-rga + - rockchip,rk3568-rga - const: rockchip,rk3288-rga reg: -- 2.30.2 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga 2022-11-21 15:17 ` Michael Tretter (?) @ 2022-11-21 16:26 ` Krzysztof Kozlowski -1 siblings, 0 replies; 42+ messages in thread From: Krzysztof Kozlowski @ 2022-11-21 16:26 UTC (permalink / raw) To: Michael Tretter, devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, kernel On 21/11/2022 16:17, Michael Tretter wrote: > Add a new compatible for the rk3568 Rockchip SoC, which also features an > RGA, which is called RGA2 in the TRM Part2. It is the same core as used > on the rk3288, which documents the same RGA2. > > Specify a new compatible for the rk3568 to be able to handle unknown > SoC-specific differences in the driver. > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga @ 2022-11-21 16:26 ` Krzysztof Kozlowski 0 siblings, 0 replies; 42+ messages in thread From: Krzysztof Kozlowski @ 2022-11-21 16:26 UTC (permalink / raw) To: Michael Tretter, devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, kernel On 21/11/2022 16:17, Michael Tretter wrote: > Add a new compatible for the rk3568 Rockchip SoC, which also features an > RGA, which is called RGA2 in the TRM Part2. It is the same core as used > on the rk3288, which documents the same RGA2. > > Specify a new compatible for the rk3568 to be able to handle unknown > SoC-specific differences in the driver. > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga @ 2022-11-21 16:26 ` Krzysztof Kozlowski 0 siblings, 0 replies; 42+ messages in thread From: Krzysztof Kozlowski @ 2022-11-21 16:26 UTC (permalink / raw) To: Michael Tretter, devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, kernel On 21/11/2022 16:17, Michael Tretter wrote: > Add a new compatible for the rk3568 Rockchip SoC, which also features an > RGA, which is called RGA2 in the TRM Part2. It is the same core as used > on the rk3288, which documents the same RGA2. > > Specify a new compatible for the rk3568 to be able to handle unknown > SoC-specific differences in the driver. > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 15:17 ` Michael Tretter (?) @ 2022-11-21 15:17 ` Michael Tretter -1 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The rk3568 also features a RGA2 block. Add the necessary device tree node. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 164708f1eb67..0b281e2260d9 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -612,6 +612,17 @@ vdpu_mmu: iommu@fdea0800 { #iommu-cells = <0>; }; + rga: rga@fdeb0000 { + compatible = "rockchip,rk3568-rga", "rockchip,rk3288-rga"; + reg = <0x0 0xfdeb0000 0x0 0x180>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru CLK_RGA_CORE>; + clock-names = "aclk", "hclk", "sclk"; + resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>; + reset-names = "core", "axi", "ahb"; + power-domains = <&power RK3568_PD_RGA>; + }; + vepu: video-codec@fdee0000 { compatible = "rockchip,rk3568-vepu"; reg = <0x0 0xfdee0000 0x0 0x800>; -- 2.30.2 ^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The rk3568 also features a RGA2 block. Add the necessary device tree node. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 164708f1eb67..0b281e2260d9 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -612,6 +612,17 @@ vdpu_mmu: iommu@fdea0800 { #iommu-cells = <0>; }; + rga: rga@fdeb0000 { + compatible = "rockchip,rk3568-rga", "rockchip,rk3288-rga"; + reg = <0x0 0xfdeb0000 0x0 0x180>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru CLK_RGA_CORE>; + clock-names = "aclk", "hclk", "sclk"; + resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>; + reset-names = "core", "axi", "ahb"; + power-domains = <&power RK3568_PD_RGA>; + }; + vepu: video-codec@fdee0000 { compatible = "rockchip,rk3568-vepu"; reg = <0x0 0xfdee0000 0x0 0x800>; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 15:17 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 15:17 UTC (permalink / raw) To: devicetree, linux-rockchip, jacob-chen, ezequiel, robh+dt Cc: krzysztof.kozlowski+dt, heiko, michael.riesch, linux-arm-kernel, m.tretter, kernel The rk3568 also features a RGA2 block. Add the necessary device tree node. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 164708f1eb67..0b281e2260d9 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -612,6 +612,17 @@ vdpu_mmu: iommu@fdea0800 { #iommu-cells = <0>; }; + rga: rga@fdeb0000 { + compatible = "rockchip,rk3568-rga", "rockchip,rk3288-rga"; + reg = <0x0 0xfdeb0000 0x0 0x180>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru CLK_RGA_CORE>; + clock-names = "aclk", "hclk", "sclk"; + resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>; + reset-names = "core", "axi", "ahb"; + power-domains = <&power RK3568_PD_RGA>; + }; + vepu: video-codec@fdee0000 { compatible = "rockchip,rk3568-vepu"; reg = <0x0 0xfdee0000 0x0 0x800>; -- 2.30.2 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 15:17 ` Michael Tretter (?) @ 2022-11-21 16:01 ` Shengyu Qu -1 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 16:01 UTC (permalink / raw) To: m.tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hello Michael, Someone from pine64 discord found that RGA2 doesn't work properly on over 4GB memory RK3568 devices. Are you sure current driver works now? Shengyu ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 16:01 ` Shengyu Qu 0 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 16:01 UTC (permalink / raw) To: m.tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hello Michael, Someone from pine64 discord found that RGA2 doesn't work properly on over 4GB memory RK3568 devices. Are you sure current driver works now? Shengyu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 16:01 ` Shengyu Qu 0 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 16:01 UTC (permalink / raw) To: m.tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hello Michael, Someone from pine64 discord found that RGA2 doesn't work properly on over 4GB memory RK3568 devices. Are you sure current driver works now? Shengyu _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 16:01 ` Shengyu Qu (?) @ 2022-11-21 16:41 ` Michael Tretter -1 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 16:41 UTC (permalink / raw) To: Shengyu Qu Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > Someone from pine64 discord found that RGA2 doesn't work properly on over > > 4GB memory RK3568 devices. Are you sure current driver works now? I am absolutely sure that the driver works on a 2GB ROCK3A board. Unfortunately, I don't have a device with 4GB or more memory and I cannot test the driver with such a device. As the documentation for the RGA2 is the same in the TRM of the rk3288 and rk3568, I would guess that the driver doesn't work on a rk3288 with more than 4GB (if there is such a thing) either and the driver needs to be fixed for both SoCs. Michael ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 16:41 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 16:41 UTC (permalink / raw) To: Shengyu Qu Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > Someone from pine64 discord found that RGA2 doesn't work properly on over > > 4GB memory RK3568 devices. Are you sure current driver works now? I am absolutely sure that the driver works on a 2GB ROCK3A board. Unfortunately, I don't have a device with 4GB or more memory and I cannot test the driver with such a device. As the documentation for the RGA2 is the same in the TRM of the rk3288 and rk3568, I would guess that the driver doesn't work on a rk3288 with more than 4GB (if there is such a thing) either and the driver needs to be fixed for both SoCs. Michael _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 16:41 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-21 16:41 UTC (permalink / raw) To: Shengyu Qu Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > Someone from pine64 discord found that RGA2 doesn't work properly on over > > 4GB memory RK3568 devices. Are you sure current driver works now? I am absolutely sure that the driver works on a 2GB ROCK3A board. Unfortunately, I don't have a device with 4GB or more memory and I cannot test the driver with such a device. As the documentation for the RGA2 is the same in the TRM of the rk3288 and rk3568, I would guess that the driver doesn't work on a rk3288 with more than 4GB (if there is such a thing) either and the driver needs to be fixed for both SoCs. Michael _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 16:41 ` Michael Tretter (?) @ 2022-11-21 17:13 ` Shengyu Qu -1 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 17:13 UTC (permalink / raw) To: Michael Tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. Shengyu 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: >Hi, > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: >> Someone from pine64 discord found that RGA2 doesn't work properly on over >> >> 4GB memory RK3568 devices. Are you sure current driver works now? > >I am absolutely sure that the driver works on a 2GB ROCK3A board. >Unfortunately, I don't have a device with 4GB or more memory and I cannot test >the driver with such a device. > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and >rk3568, I would guess that the driver doesn't work on a rk3288 with more than >4GB (if there is such a thing) either and the driver needs to be fixed for >both SoCs. > >Michael ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 17:13 ` Shengyu Qu 0 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 17:13 UTC (permalink / raw) To: Michael Tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. Shengyu 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: >Hi, > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: >> Someone from pine64 discord found that RGA2 doesn't work properly on over >> >> 4GB memory RK3568 devices. Are you sure current driver works now? > >I am absolutely sure that the driver works on a 2GB ROCK3A board. >Unfortunately, I don't have a device with 4GB or more memory and I cannot test >the driver with such a device. > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and >rk3568, I would guess that the driver doesn't work on a rk3288 with more than >4GB (if there is such a thing) either and the driver needs to be fixed for >both SoCs. > >Michael _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 17:13 ` Shengyu Qu 0 siblings, 0 replies; 42+ messages in thread From: Shengyu Qu @ 2022-11-21 17:13 UTC (permalink / raw) To: Michael Tretter Cc: devicetree, ezequiel, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi, I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. Shengyu 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: >Hi, > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: >> Someone from pine64 discord found that RGA2 doesn't work properly on over >> >> 4GB memory RK3568 devices. Are you sure current driver works now? > >I am absolutely sure that the driver works on a 2GB ROCK3A board. >Unfortunately, I don't have a device with 4GB or more memory and I cannot test >the driver with such a device. > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and >rk3568, I would guess that the driver doesn't work on a rk3288 with more than >4GB (if there is such a thing) either and the driver needs to be fixed for >both SoCs. > >Michael _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 17:13 ` Shengyu Qu (?) @ 2022-11-21 17:30 ` Ezequiel Garcia -1 siblings, 0 replies; 42+ messages in thread From: Ezequiel Garcia @ 2022-11-21 17:30 UTC (permalink / raw) To: Shengyu Qu Cc: Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi Shengyu, Michael, On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > Hi, > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > Shengyu > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > >Hi, > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > >> > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > >the driver with such a device. > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > >4GB (if there is such a thing) either and the driver needs to be fixed for > >both SoCs. > > In any case, if there's some kind of issue it must be in the driver, and not in the device tree binding (i.e. this patchset). Regards, Ezequiel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 17:30 ` Ezequiel Garcia 0 siblings, 0 replies; 42+ messages in thread From: Ezequiel Garcia @ 2022-11-21 17:30 UTC (permalink / raw) To: Shengyu Qu Cc: Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi Shengyu, Michael, On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > Hi, > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > Shengyu > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > >Hi, > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > >> > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > >the driver with such a device. > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > >4GB (if there is such a thing) either and the driver needs to be fixed for > >both SoCs. > > In any case, if there's some kind of issue it must be in the driver, and not in the device tree binding (i.e. this patchset). Regards, Ezequiel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 17:30 ` Ezequiel Garcia 0 siblings, 0 replies; 42+ messages in thread From: Ezequiel Garcia @ 2022-11-21 17:30 UTC (permalink / raw) To: Shengyu Qu Cc: Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt Hi Shengyu, Michael, On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > Hi, > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > Shengyu > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > >Hi, > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > >> > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > >the driver with such a device. > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > >4GB (if there is such a thing) either and the driver needs to be fixed for > >both SoCs. > > In any case, if there's some kind of issue it must be in the driver, and not in the device tree binding (i.e. this patchset). Regards, Ezequiel _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 17:30 ` Ezequiel Garcia (?) @ 2022-11-21 23:10 ` Peter Geis -1 siblings, 0 replies; 42+ messages in thread From: Peter Geis @ 2022-11-21 23:10 UTC (permalink / raw) To: Ezequiel Garcia Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote: > > Hi Shengyu, Michael, > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > Hi, > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > Shengyu > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > >Hi, > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > >> > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > >the driver with such a device. > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > >both SoCs. > > > > > In any case, if there's some kind of issue it must be in the driver, > and not in the device tree binding (i.e. this patchset). An unfortunate number of Rockchip drivers break on rk356x boards with more than 4GB of ram. I've found requesting memory allocations with the GFP_DMA flag solves the problem, as the kernel only allocates 32bit addresses for DMA on rk356x. This is similar to the bug with the ITS MSI allocations. > > Regards, > Ezequiel > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 23:10 ` Peter Geis 0 siblings, 0 replies; 42+ messages in thread From: Peter Geis @ 2022-11-21 23:10 UTC (permalink / raw) To: Ezequiel Garcia Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote: > > Hi Shengyu, Michael, > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > Hi, > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > Shengyu > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > >Hi, > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > >> > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > >the driver with such a device. > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > >both SoCs. > > > > > In any case, if there's some kind of issue it must be in the driver, > and not in the device tree binding (i.e. this patchset). An unfortunate number of Rockchip drivers break on rk356x boards with more than 4GB of ram. I've found requesting memory allocations with the GFP_DMA flag solves the problem, as the kernel only allocates 32bit addresses for DMA on rk356x. This is similar to the bug with the ITS MSI allocations. > > Regards, > Ezequiel > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-21 23:10 ` Peter Geis 0 siblings, 0 replies; 42+ messages in thread From: Peter Geis @ 2022-11-21 23:10 UTC (permalink / raw) To: Ezequiel Garcia Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote: > > Hi Shengyu, Michael, > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > Hi, > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > Shengyu > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > >Hi, > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > >> > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > >the driver with such a device. > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > >both SoCs. > > > > > In any case, if there's some kind of issue it must be in the driver, > and not in the device tree binding (i.e. this patchset). An unfortunate number of Rockchip drivers break on rk356x boards with more than 4GB of ram. I've found requesting memory allocations with the GFP_DMA flag solves the problem, as the kernel only allocates 32bit addresses for DMA on rk356x. This is similar to the bug with the ITS MSI allocations. > > Regards, > Ezequiel > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-21 23:10 ` Peter Geis (?) @ 2022-11-22 19:47 ` Nicolas Frattaroli -1 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2022-11-22 19:47 UTC (permalink / raw) To: Ezequiel Garcia, linux-rockchip Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt, Peter Geis On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > <ezequiel@vanguardiasur.com.ar> wrote: > > > > Hi Shengyu, Michael, > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > Hi, > > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > > > Shengyu > > > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > >Hi, > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > >> > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > >the driver with such a device. > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > >both SoCs. > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > and not in the device tree binding (i.e. this patchset). > > An unfortunate number of Rockchip drivers break on rk356x boards with > more than 4GB of ram. I've found requesting memory allocations with > the GFP_DMA flag solves the problem, as the kernel only allocates > 32bit addresses for DMA on rk356x. This is similar to the bug with the > ITS MSI allocations. Hello, the problem in this case at least partly seems to be down to the driver assuming 32 bit addresses, see e.g. [1] (if I understand the code correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat about this, Robin Murphy remarked: <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse - in that particular instance I'd be inclined to replace {src,dst}_mmu_pages with proper coherent DMA buffers So the driver in general needs some cleanup, which contributes to the problem. But as was said, this isn't a problem with the device tree, so it should still make it in. It just means that the driver is broken on 8GB RK356x. Regards, Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > > > > > Regards, > > Ezequiel > > > > _______________________________________________ > > Linux-rockchip mailing list > > Linux-rockchip@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-rockchip > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip > ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-22 19:47 ` Nicolas Frattaroli 0 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2022-11-22 19:47 UTC (permalink / raw) To: Ezequiel Garcia, linux-rockchip Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt, Peter Geis On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > <ezequiel@vanguardiasur.com.ar> wrote: > > > > Hi Shengyu, Michael, > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > Hi, > > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > > > Shengyu > > > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > >Hi, > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > >> > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > >the driver with such a device. > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > >both SoCs. > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > and not in the device tree binding (i.e. this patchset). > > An unfortunate number of Rockchip drivers break on rk356x boards with > more than 4GB of ram. I've found requesting memory allocations with > the GFP_DMA flag solves the problem, as the kernel only allocates > 32bit addresses for DMA on rk356x. This is similar to the bug with the > ITS MSI allocations. Hello, the problem in this case at least partly seems to be down to the driver assuming 32 bit addresses, see e.g. [1] (if I understand the code correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat about this, Robin Murphy remarked: <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse - in that particular instance I'd be inclined to replace {src,dst}_mmu_pages with proper coherent DMA buffers So the driver in general needs some cleanup, which contributes to the problem. But as was said, this isn't a problem with the device tree, so it should still make it in. It just means that the driver is broken on 8GB RK356x. Regards, Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > > > > > Regards, > > Ezequiel > > > > _______________________________________________ > > Linux-rockchip mailing list > > Linux-rockchip@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-rockchip > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-22 19:47 ` Nicolas Frattaroli 0 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2022-11-22 19:47 UTC (permalink / raw) To: Ezequiel Garcia, linux-rockchip Cc: Shengyu Qu, Michael Tretter, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, linux-rockchip, michael.riesch, robh+dt, Peter Geis On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > <ezequiel@vanguardiasur.com.ar> wrote: > > > > Hi Shengyu, Michael, > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > Hi, > > > I remember someone said that rga2 has only 32bit address space but not having a mmu or mmu needs to be configured. Better ask by yourself in pine64 discord since I'm not sure about that. > > > > > > Shengyu > > > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > >Hi, > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > >> > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > >the driver with such a device. > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > >both SoCs. > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > and not in the device tree binding (i.e. this patchset). > > An unfortunate number of Rockchip drivers break on rk356x boards with > more than 4GB of ram. I've found requesting memory allocations with > the GFP_DMA flag solves the problem, as the kernel only allocates > 32bit addresses for DMA on rk356x. This is similar to the bug with the > ITS MSI allocations. Hello, the problem in this case at least partly seems to be down to the driver assuming 32 bit addresses, see e.g. [1] (if I understand the code correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat about this, Robin Murphy remarked: <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse - in that particular instance I'd be inclined to replace {src,dst}_mmu_pages with proper coherent DMA buffers So the driver in general needs some cleanup, which contributes to the problem. But as was said, this isn't a problem with the device tree, so it should still make it in. It just means that the driver is broken on 8GB RK356x. Regards, Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > > > > > Regards, > > Ezequiel > > > > _______________________________________________ > > Linux-rockchip mailing list > > Linux-rockchip@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-rockchip > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip > _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-22 19:47 ` Nicolas Frattaroli (?) @ 2022-11-23 9:28 ` Michael Tretter -1 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-23 9:28 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > <ezequiel@vanguardiasur.com.ar> wrote: > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > I remember someone said that rga2 has only 32bit address space but not > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > pine64 discord since I'm not sure about that. > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > >> > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > >the driver with such a device. > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > >both SoCs. > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > and not in the device tree binding (i.e. this patchset). > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > more than 4GB of ram. I've found requesting memory allocations with > > the GFP_DMA flag solves the problem, as the kernel only allocates > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > ITS MSI allocations. > > the problem in this case at least partly seems to be down to the driver > assuming 32 bit addresses, see e.g. [1] (if I understand the code > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > about this, Robin Murphy remarked: > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > - in that particular instance I'd be inclined to replace > {src,dst}_mmu_pages with proper coherent DMA buffers > > So the driver in general needs some cleanup, which contributes to the > problem. As far as I understand the 4GB are a hardware limitation. According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within 4GB memory. And within the MMU TLB, the addresses are 32 bit as well (unless I am missing something important). Unfortunately, I couldn't find any documentation for the TLB. The downstream driver writes only 32 bit addresses to the TLB as well. Thus, I assume that all video buffers must be located within 4GB memory, too. While I agree that the driver needs some cleanup and may use correct types for handling the bit size limitation, I think this isn't some driver limitation. Maybe the driver should set the dma mask to 32 bits and should be explicitly aware of the 32 bit limit. Michael > > But as was said, this isn't a problem with the device tree, so it should > still make it in. It just means that the driver is broken on 8GB RK356x. > > Regards, > Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli > > [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 > [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-23 9:28 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-23 9:28 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > <ezequiel@vanguardiasur.com.ar> wrote: > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > I remember someone said that rga2 has only 32bit address space but not > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > pine64 discord since I'm not sure about that. > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > >> > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > >the driver with such a device. > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > >both SoCs. > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > and not in the device tree binding (i.e. this patchset). > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > more than 4GB of ram. I've found requesting memory allocations with > > the GFP_DMA flag solves the problem, as the kernel only allocates > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > ITS MSI allocations. > > the problem in this case at least partly seems to be down to the driver > assuming 32 bit addresses, see e.g. [1] (if I understand the code > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > about this, Robin Murphy remarked: > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > - in that particular instance I'd be inclined to replace > {src,dst}_mmu_pages with proper coherent DMA buffers > > So the driver in general needs some cleanup, which contributes to the > problem. As far as I understand the 4GB are a hardware limitation. According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within 4GB memory. And within the MMU TLB, the addresses are 32 bit as well (unless I am missing something important). Unfortunately, I couldn't find any documentation for the TLB. The downstream driver writes only 32 bit addresses to the TLB as well. Thus, I assume that all video buffers must be located within 4GB memory, too. While I agree that the driver needs some cleanup and may use correct types for handling the bit size limitation, I think this isn't some driver limitation. Maybe the driver should set the dma mask to 32 bits and should be explicitly aware of the 32 bit limit. Michael > > But as was said, this isn't a problem with the device tree, so it should > still make it in. It just means that the driver is broken on 8GB RK356x. > > Regards, > Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli > > [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 > [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2022-11-23 9:28 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2022-11-23 9:28 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > <ezequiel@vanguardiasur.com.ar> wrote: > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > I remember someone said that rga2 has only 32bit address space but not > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > pine64 discord since I'm not sure about that. > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > >> > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > >the driver with such a device. > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > >both SoCs. > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > and not in the device tree binding (i.e. this patchset). > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > more than 4GB of ram. I've found requesting memory allocations with > > the GFP_DMA flag solves the problem, as the kernel only allocates > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > ITS MSI allocations. > > the problem in this case at least partly seems to be down to the driver > assuming 32 bit addresses, see e.g. [1] (if I understand the code > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > about this, Robin Murphy remarked: > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > - in that particular instance I'd be inclined to replace > {src,dst}_mmu_pages with proper coherent DMA buffers > > So the driver in general needs some cleanup, which contributes to the > problem. As far as I understand the 4GB are a hardware limitation. According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within 4GB memory. And within the MMU TLB, the addresses are 32 bit as well (unless I am missing something important). Unfortunately, I couldn't find any documentation for the TLB. The downstream driver writes only 32 bit addresses to the TLB as well. Thus, I assume that all video buffers must be located within 4GB memory, too. While I agree that the driver needs some cleanup and may use correct types for handling the bit size limitation, I think this isn't some driver limitation. Maybe the driver should set the dma mask to 32 bits and should be explicitly aware of the 32 bit limit. Michael > > But as was said, this isn't a problem with the device tree, so it should > still make it in. It just means that the driver is broken on 8GB RK356x. > > Regards, > Nicolas "someone from PINE64 discord (who was actually on IRC)" Frattaroli > > [1]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga.c#L888 > [2]: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/media/platform/rockchip/rga/rga-buf.c#L120 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2022-11-23 9:28 ` Michael Tretter (?) @ 2023-01-17 12:41 ` Michael Tretter -1 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2023-01-17 12:41 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > pine64 discord since I'm not sure about that. > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > >> > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > >the driver with such a device. > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > >both SoCs. > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > and not in the device tree binding (i.e. this patchset). > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > more than 4GB of ram. I've found requesting memory allocations with > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > ITS MSI allocations. > > > > the problem in this case at least partly seems to be down to the driver > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > about this, Robin Murphy remarked: > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > - in that particular instance I'd be inclined to replace > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > So the driver in general needs some cleanup, which contributes to the > > problem. > > As far as I understand the 4GB are a hardware limitation. > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > 4GB memory. > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > something important). Unfortunately, I couldn't find any documentation for the > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > Thus, I assume that all video buffers must be located within 4GB memory, too. > > While I agree that the driver needs some cleanup and may use correct types for > handling the bit size limitation, I think this isn't some driver limitation. > Maybe the driver should set the dma mask to 32 bits and should be explicitly > aware of the 32 bit limit. > > > > > But as was said, this isn't a problem with the device tree, so it should > > still make it in. It just means that the driver is broken on 8GB RK356x. Nicolas: Is this your Acked-By? Who would pick up the patch? Heiko? Michael ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-17 12:41 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2023-01-17 12:41 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > pine64 discord since I'm not sure about that. > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > >> > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > >the driver with such a device. > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > >both SoCs. > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > and not in the device tree binding (i.e. this patchset). > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > more than 4GB of ram. I've found requesting memory allocations with > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > ITS MSI allocations. > > > > the problem in this case at least partly seems to be down to the driver > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > about this, Robin Murphy remarked: > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > - in that particular instance I'd be inclined to replace > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > So the driver in general needs some cleanup, which contributes to the > > problem. > > As far as I understand the 4GB are a hardware limitation. > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > 4GB memory. > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > something important). Unfortunately, I couldn't find any documentation for the > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > Thus, I assume that all video buffers must be located within 4GB memory, too. > > While I agree that the driver needs some cleanup and may use correct types for > handling the bit size limitation, I think this isn't some driver limitation. > Maybe the driver should set the dma mask to 32 bits and should be explicitly > aware of the 32 bit limit. > > > > > But as was said, this isn't a problem with the device tree, so it should > > still make it in. It just means that the driver is broken on 8GB RK356x. Nicolas: Is this your Acked-By? Who would pick up the patch? Heiko? Michael _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-17 12:41 ` Michael Tretter 0 siblings, 0 replies; 42+ messages in thread From: Michael Tretter @ 2023-01-17 12:41 UTC (permalink / raw) To: Nicolas Frattaroli Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > pine64 discord since I'm not sure about that. > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > >> > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > >the driver with such a device. > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > >both SoCs. > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > and not in the device tree binding (i.e. this patchset). > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > more than 4GB of ram. I've found requesting memory allocations with > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > ITS MSI allocations. > > > > the problem in this case at least partly seems to be down to the driver > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > about this, Robin Murphy remarked: > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > - in that particular instance I'd be inclined to replace > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > So the driver in general needs some cleanup, which contributes to the > > problem. > > As far as I understand the 4GB are a hardware limitation. > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > 4GB memory. > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > something important). Unfortunately, I couldn't find any documentation for the > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > Thus, I assume that all video buffers must be located within 4GB memory, too. > > While I agree that the driver needs some cleanup and may use correct types for > handling the bit size limitation, I think this isn't some driver limitation. > Maybe the driver should set the dma mask to 32 bits and should be explicitly > aware of the 32 bit limit. > > > > > But as was said, this isn't a problem with the device tree, so it should > > still make it in. It just means that the driver is broken on 8GB RK356x. Nicolas: Is this your Acked-By? Who would pick up the patch? Heiko? Michael _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2023-01-17 12:41 ` Michael Tretter (?) @ 2023-01-18 0:01 ` Nicolas Frattaroli -1 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2023-01-18 0:01 UTC (permalink / raw) To: Michael Tretter Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > pine64 discord since I'm not sure about that. > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > >> > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > >the driver with such a device. > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > ITS MSI allocations. > > > > > > the problem in this case at least partly seems to be down to the driver > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > about this, Robin Murphy remarked: > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > - in that particular instance I'd be inclined to replace > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > So the driver in general needs some cleanup, which contributes to the > > > problem. > > > > As far as I understand the 4GB are a hardware limitation. > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > 4GB memory. > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > something important). Unfortunately, I couldn't find any documentation for the > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > While I agree that the driver needs some cleanup and may use correct types for > > handling the bit size limitation, I think this isn't some driver limitation. > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > aware of the 32 bit limit. > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > Nicolas: Is this your Acked-By? > > Who would pick up the patch? Heiko? > > Michael > Sure, Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> Though I'm not sure how much weight my Acked-by carries here. For applying the patch, yes that would be done by Heiko. Cheers, Nicolas Frattaroli _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-18 0:01 ` Nicolas Frattaroli 0 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2023-01-18 0:01 UTC (permalink / raw) To: Michael Tretter Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > pine64 discord since I'm not sure about that. > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > >> > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > >the driver with such a device. > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > ITS MSI allocations. > > > > > > the problem in this case at least partly seems to be down to the driver > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > about this, Robin Murphy remarked: > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > - in that particular instance I'd be inclined to replace > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > So the driver in general needs some cleanup, which contributes to the > > > problem. > > > > As far as I understand the 4GB are a hardware limitation. > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > 4GB memory. > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > something important). Unfortunately, I couldn't find any documentation for the > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > While I agree that the driver needs some cleanup and may use correct types for > > handling the bit size limitation, I think this isn't some driver limitation. > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > aware of the 32 bit limit. > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > Nicolas: Is this your Acked-By? > > Who would pick up the patch? Heiko? > > Michael > Sure, Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> Though I'm not sure how much weight my Acked-by carries here. For applying the patch, yes that would be done by Heiko. Cheers, Nicolas Frattaroli ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-18 0:01 ` Nicolas Frattaroli 0 siblings, 0 replies; 42+ messages in thread From: Nicolas Frattaroli @ 2023-01-18 0:01 UTC (permalink / raw) To: Michael Tretter Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, heiko, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch, robh+dt, Peter Geis On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > pine64 discord since I'm not sure about that. > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > >> > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > >the driver with such a device. > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > ITS MSI allocations. > > > > > > the problem in this case at least partly seems to be down to the driver > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > about this, Robin Murphy remarked: > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > - in that particular instance I'd be inclined to replace > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > So the driver in general needs some cleanup, which contributes to the > > > problem. > > > > As far as I understand the 4GB are a hardware limitation. > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > 4GB memory. > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > something important). Unfortunately, I couldn't find any documentation for the > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > While I agree that the driver needs some cleanup and may use correct types for > > handling the bit size limitation, I think this isn't some driver limitation. > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > aware of the 32 bit limit. > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > Nicolas: Is this your Acked-By? > > Who would pick up the patch? Heiko? > > Michael > Sure, Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> Though I'm not sure how much weight my Acked-by carries here. For applying the patch, yes that would be done by Heiko. Cheers, Nicolas Frattaroli _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x 2023-01-18 0:01 ` Nicolas Frattaroli (?) @ 2023-01-19 12:15 ` Heiko Stuebner -1 siblings, 0 replies; 42+ messages in thread From: Heiko Stuebner @ 2023-01-19 12:15 UTC (permalink / raw) To: Michael Tretter, Nicolas Frattaroli, robh+dt, Peter Geis Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch Hi, Am Mittwoch, 18. Januar 2023, 01:01:48 CET schrieb Nicolas Frattaroli: > On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > > pine64 discord since I'm not sure about that. > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > > >> > > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > > >the driver with such a device. > > > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > > ITS MSI allocations. > > > > > > > > the problem in this case at least partly seems to be down to the driver > > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > > about this, Robin Murphy remarked: > > > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > > - in that particular instance I'd be inclined to replace > > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > > > So the driver in general needs some cleanup, which contributes to the > > > > problem. > > > > > > As far as I understand the 4GB are a hardware limitation. > > > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > > 4GB memory. > > > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > > something important). Unfortunately, I couldn't find any documentation for the > > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > > > While I agree that the driver needs some cleanup and may use correct types for > > > handling the bit size limitation, I think this isn't some driver limitation. > > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > > aware of the 32 bit limit. > > > > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > > > Nicolas: Is this your Acked-By? > > > > Who would pick up the patch? Heiko? > > > > Michael > > > > Sure, > > Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> > > Though I'm not sure how much weight my Acked-by carries here. > > For applying the patch, yes that would be done by Heiko. Hmm, normally the binding goes through the relevant subsystem tree (media in this case), after which I'd normally pick the dts patch. Media is always pretty hard, as one never really knows if and when said patches get applied. I don't really see media-people in the Cc list as well, so don't really know what's the plan. I guess you might want to resend with Reviews appended and include the media people + list for the binding. (Or I'd need an Ack from someone from media for me to take the binding) Heiko ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-19 12:15 ` Heiko Stuebner 0 siblings, 0 replies; 42+ messages in thread From: Heiko Stuebner @ 2023-01-19 12:15 UTC (permalink / raw) To: Michael Tretter, Nicolas Frattaroli, robh+dt, Peter Geis Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch Hi, Am Mittwoch, 18. Januar 2023, 01:01:48 CET schrieb Nicolas Frattaroli: > On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > > pine64 discord since I'm not sure about that. > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > > >> > > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > > >the driver with such a device. > > > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > > ITS MSI allocations. > > > > > > > > the problem in this case at least partly seems to be down to the driver > > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > > about this, Robin Murphy remarked: > > > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > > - in that particular instance I'd be inclined to replace > > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > > > So the driver in general needs some cleanup, which contributes to the > > > > problem. > > > > > > As far as I understand the 4GB are a hardware limitation. > > > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > > 4GB memory. > > > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > > something important). Unfortunately, I couldn't find any documentation for the > > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > > > While I agree that the driver needs some cleanup and may use correct types for > > > handling the bit size limitation, I think this isn't some driver limitation. > > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > > aware of the 32 bit limit. > > > > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > > > Nicolas: Is this your Acked-By? > > > > Who would pick up the patch? Heiko? > > > > Michael > > > > Sure, > > Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> > > Though I'm not sure how much weight my Acked-by carries here. > > For applying the patch, yes that would be done by Heiko. Hmm, normally the binding goes through the relevant subsystem tree (media in this case), after which I'd normally pick the dts patch. Media is always pretty hard, as one never really knows if and when said patches get applied. I don't really see media-people in the Cc list as well, so don't really know what's the plan. I guess you might want to resend with Reviews appended and include the media people + list for the binding. (Or I'd need an Ack from someone from media for me to take the binding) Heiko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x @ 2023-01-19 12:15 ` Heiko Stuebner 0 siblings, 0 replies; 42+ messages in thread From: Heiko Stuebner @ 2023-01-19 12:15 UTC (permalink / raw) To: Michael Tretter, Nicolas Frattaroli, robh+dt, Peter Geis Cc: Ezequiel Garcia, linux-rockchip, Shengyu Qu, devicetree, jacob-chen, kernel, krzysztof.kozlowski+dt, linux-arm-kernel, michael.riesch Hi, Am Mittwoch, 18. Januar 2023, 01:01:48 CET schrieb Nicolas Frattaroli: > On Dienstag, 17. Januar 2023 13:41:14 CET Michael Tretter wrote: > > On Wed, 23 Nov 2022 10:28:41 +0100, Michael Tretter wrote: > > > On Tue, 22 Nov 2022 20:47:49 +0100, Nicolas Frattaroli wrote: > > > > On Dienstag, 22. November 2022 00:10:25 CET Peter Geis wrote: > > > > > On Mon, Nov 21, 2022 at 12:34 PM Ezequiel Garcia > > > > > <ezequiel@vanguardiasur.com.ar> wrote: > > > > > > On Mon, Nov 21, 2022 at 2:13 PM Shengyu Qu <wiagn233@outlook.com> wrote: > > > > > > > I remember someone said that rga2 has only 32bit address space but not > > > > > > > having a mmu or mmu needs to be configured. Better ask by yourself in > > > > > > > pine64 discord since I'm not sure about that. > > > > > > > 于 2022年11月22日 GMT+08:00 上午12:41:16, Michael Tretter <m.tretter@pengutronix.de> 写到: > > > > > > > >On Tue, 22 Nov 2022 00:01:28 +0800, Shengyu Qu wrote: > > > > > > > >> Someone from pine64 discord found that RGA2 doesn't work properly on over > > > > > > > >> > > > > > > > >> 4GB memory RK3568 devices. Are you sure current driver works now? > > > > > > > > > > > > > > > >I am absolutely sure that the driver works on a 2GB ROCK3A board. > > > > > > > >Unfortunately, I don't have a device with 4GB or more memory and I cannot test > > > > > > > >the driver with such a device. > > > > > > > > > > > > > > > >As the documentation for the RGA2 is the same in the TRM of the rk3288 and > > > > > > > >rk3568, I would guess that the driver doesn't work on a rk3288 with more than > > > > > > > >4GB (if there is such a thing) either and the driver needs to be fixed for > > > > > > > >both SoCs. > > > > > > > > > > > > > > > > > > > > In any case, if there's some kind of issue it must be in the driver, > > > > > > and not in the device tree binding (i.e. this patchset). > > > > > > > > > > An unfortunate number of Rockchip drivers break on rk356x boards with > > > > > more than 4GB of ram. I've found requesting memory allocations with > > > > > the GFP_DMA flag solves the problem, as the kernel only allocates > > > > > 32bit addresses for DMA on rk356x. This is similar to the bug with the > > > > > ITS MSI allocations. > > > > > > > > the problem in this case at least partly seems to be down to the driver > > > > assuming 32 bit addresses, see e.g. [1] (if I understand the code > > > > correctly) and [2]. When I asked in the #armlinux IRC on Libera.chat > > > > about this, Robin Murphy remarked: > > > > > > > > <robmur01> yeesh, the virt_to_phys/dma_sync abuse is even worse > > > > - in that particular instance I'd be inclined to replace > > > > {src,dst}_mmu_pages with proper coherent DMA buffers > > > > > > > > So the driver in general needs some cleanup, which contributes to the > > > > problem. > > > > > > As far as I understand the 4GB are a hardware limitation. > > > > > > According to the rk3568 TRM, the RGA2_MMU_SRC_BASE has 28 bits for the upper > > > 28 bits of the address of the MMU TLB. Thus the MMU TLB must be located within > > > 4GB memory. > > > > > > And within the MMU TLB, the addresses are 32 bit as well (unless I am missing > > > something important). Unfortunately, I couldn't find any documentation for the > > > TLB. The downstream driver writes only 32 bit addresses to the TLB as well. > > > Thus, I assume that all video buffers must be located within 4GB memory, too. > > > > > > While I agree that the driver needs some cleanup and may use correct types for > > > handling the bit size limitation, I think this isn't some driver limitation. > > > Maybe the driver should set the dma mask to 32 bits and should be explicitly > > > aware of the 32 bit limit. > > > > > > > > > > > But as was said, this isn't a problem with the device tree, so it should > > > > still make it in. It just means that the driver is broken on 8GB RK356x. > > > > Nicolas: Is this your Acked-By? > > > > Who would pick up the patch? Heiko? > > > > Michael > > > > Sure, > > Acked-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com> > > Though I'm not sure how much weight my Acked-by carries here. > > For applying the patch, yes that would be done by Heiko. Hmm, normally the binding goes through the relevant subsystem tree (media in this case), after which I'd normally pick the dts patch. Media is always pretty hard, as one never really knows if and when said patches get applied. I don't really see media-people in the Cc list as well, so don't really know what's the plan. I guess you might want to resend with Reviews appended and include the media people + list for the binding. (Or I'd need an Ack from someone from media for me to take the binding) Heiko _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2023-01-19 12:17 UTC | newest] Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-11-21 15:17 [PATCH 0/2] media: rockchip: rga: Add rk3568 support Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 15:17 ` [PATCH 1/2] media: dt-bindings: media: rockchip-rga: add rockchip,rk3568-rga Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 16:26 ` Krzysztof Kozlowski 2022-11-21 16:26 ` Krzysztof Kozlowski 2022-11-21 16:26 ` Krzysztof Kozlowski 2022-11-21 15:17 ` [PATCH 2/2] arm64: dts: rockchip: Add RGA2 support to rk356x Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 15:17 ` Michael Tretter 2022-11-21 16:01 ` Shengyu Qu 2022-11-21 16:01 ` Shengyu Qu 2022-11-21 16:01 ` Shengyu Qu 2022-11-21 16:41 ` Michael Tretter 2022-11-21 16:41 ` Michael Tretter 2022-11-21 16:41 ` Michael Tretter 2022-11-21 17:13 ` Shengyu Qu 2022-11-21 17:13 ` Shengyu Qu 2022-11-21 17:13 ` Shengyu Qu 2022-11-21 17:30 ` Ezequiel Garcia 2022-11-21 17:30 ` Ezequiel Garcia 2022-11-21 17:30 ` Ezequiel Garcia 2022-11-21 23:10 ` Peter Geis 2022-11-21 23:10 ` Peter Geis 2022-11-21 23:10 ` Peter Geis 2022-11-22 19:47 ` Nicolas Frattaroli 2022-11-22 19:47 ` Nicolas Frattaroli 2022-11-22 19:47 ` Nicolas Frattaroli 2022-11-23 9:28 ` Michael Tretter 2022-11-23 9:28 ` Michael Tretter 2022-11-23 9:28 ` Michael Tretter 2023-01-17 12:41 ` Michael Tretter 2023-01-17 12:41 ` Michael Tretter 2023-01-17 12:41 ` Michael Tretter 2023-01-18 0:01 ` Nicolas Frattaroli 2023-01-18 0:01 ` Nicolas Frattaroli 2023-01-18 0:01 ` Nicolas Frattaroli 2023-01-19 12:15 ` Heiko Stuebner 2023-01-19 12:15 ` Heiko Stuebner 2023-01-19 12:15 ` Heiko Stuebner
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.