2018-04-24 14:33:59

by Jakob Unterwurzacher

[permalink] [raw]
Subject: [regression, bisected] rockchip rk3399 video output breakage

I am working on getting HDMI output enabled in mainline Linux for our
RK3399-Q7 module. It works fine on v4.16, but testing with v4.17-rc2 I
get this, and the screen stays black:

> [ 7.142712] alloc_contig_range: [7f061, 7f062) PFNs busy
> [ 7.148862] alloc_contig_range: [7f066, 7f067) PFNs busy
> [ 7.155041] alloc_contig_range: [7f067, 7f068) PFNs busy
> [ 7.161139] alloc_contig_range: [7f070, 7f071) PFNs busy
> [ 7.167295] alloc_contig_range: [7f071, 7f072) PFNs busy
> [ 7.173413] alloc_contig_range: [7f072, 7f073) PFNs busy
> [ 7.181387] alloc_contig_range: [7f073, 7f074) PFNs busy
> [ 7.190623] alloc_contig_range: [7f074, 7f075) PFNs busy
> [ 7.196668] alloc_contig_range: [7f075, 7f076) PFNs busy
> [ 7.202793] alloc_contig_range: [7f076, 7f077) PFNs busy
> [ 7.254911] hub 7-1:1.0: USB hub found
> [ 7.259878] hub 7-1:1.0: 4 ports detected
> [ 7.322543] rockchip-drm display-subsystem: master bind failed: -12
> [ 7.329619] rockchip-vop: probe of ff900000.vop failed with error -12

Full dmesg:
https://gist.github.com/jakob-tsd/33cf395e355bf9bb6956c36438d999e7

I have bisected the "master bind failed" down to:

> commit 9176a303d971dc0fb35469c531c0d263667d2277
> Author: Jeffy Chen <[email protected]>
> Date: Fri Mar 23 15:38:10 2018 +0800
>
> iommu/rockchip: Use IOMMU device for dma mapping operations
>
> Use the first registered IOMMU device for dma mapping operations, and
> drop the domain platform device.
>
> This is similar to exynos iommu driver.
>
> Signed-off-by: Jeffy Chen <[email protected]>
> Reviewed-by: Tomasz Figa <[email protected]>
> Reviewed-by: Robin Murphy <[email protected]>
> Signed-off-by: Joerg Roedel <[email protected]>

Moving to one commit earlier brings the screen to life. Just with
colorful garbage, but I guess that's a different problem.

Is this a known issue with the IOMMU change?

Thanks,
Jakob


2018-04-24 12:48:35

by Jeffy Chen

[permalink] [raw]
Subject: Re: [regression, bisected] rockchip rk3399 video output breakage

Hi Jakob,

Thanks for your message.

On 04/24/2018 08:19 PM, Jakob Unterwurzacher wrote:
>
> Full dmesg:
> https://gist.github.com/jakob-tsd/33cf395e355bf9bb6956c36438d999e7
>
> I have bisected the "master bind failed" down to:
>
>> commit 9176a303d971dc0fb35469c531c0d263667d2277
>> Author: Jeffy Chen <[email protected]>
>> Date: Fri Mar 23 15:38:10 2018 +0800
>>
>> iommu/rockchip: Use IOMMU device for dma mapping operations
>>
>> Use the first registered IOMMU device for dma mapping operations, and
>> drop the domain platform device.
>>
>> This is similar to exynos iommu driver.
>>
>> Signed-off-by: Jeffy Chen <[email protected]>
>> Reviewed-by: Tomasz Figa <[email protected]>
>> Reviewed-by: Robin Murphy <[email protected]>
>> Signed-off-by: Joerg Roedel <[email protected]>
>
> Moving to one commit earlier brings the screen to life. Just with
> colorful garbage, but I guess that's a different problem.
>
> Is this a known issue with the IOMMU change?

right, i think it's a known issue, as the iommu failed to get clks:
[ 1.525153] rk_iommu ff8f3f00.iommu: Failed to get clk 'iface': -2
[ 1.525316] rk_iommu: probe of ff8f3f00.iommu failed with error -2
[ 1.525484] rk_iommu ff903f00.iommu: Failed to get clk 'iface': -2
[ 1.525643] rk_iommu: probe of ff903f00.iommu failed with error -2


there's a followed patch to add those clks to the dtsi, and also a fix
patch to make those clks optional(by heiko):

https://www.spinics.net/lists/arm-kernel/msg645696.html

http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020349.html

>
> Thanks,
> Jakob



2018-04-24 13:35:29

by Jeffy Chen

[permalink] [raw]
Subject: Re: [regression, bisected] rockchip rk3399 video output breakage

Hi Jokab,

Thanks for your reply.

On 04/24/2018 09:11 PM, Jakob Unterwurzacher wrote:
> On 24.04.18 14:37, JeffyChen wrote:
>>
>> right, i think it's a known issue, as the iommu failed to get clks:
>> [ 1.525153] rk_iommu ff8f3f00.iommu: Failed to get clk 'iface': -2
>> [ 1.525316] rk_iommu: probe of ff8f3f00.iommu failed with error -2
>> [ 1.525484] rk_iommu ff903f00.iommu: Failed to get clk 'iface': -2
>> [ 1.525643] rk_iommu: probe of ff903f00.iommu failed with error -2
>>
>>
>> there's a followed patch to add those clks to the dtsi, and also a fix
>> patch to make those clks optional(by heiko):
>>
>> https://www.spinics.net/lists/arm-kernel/msg645696.html
>>
>> http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020349.html
>>
>
> Thanks, I tested both, and both get the screen to display some kernel
> output!
>
> However, I am getting some nasty error messages and the screen seems to
> refresh only once every 30 seconds:
>
>> [ 15.586502] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
>> [CRTC:30:crtc-0] flip_done timed out
>> [ 25.826490] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
>> [CONNECTOR:37:HDMI-A-1] flip_done timed out
>> [ 36.066490] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR*
>> [PLANE:28:plane-0] flip_done timed out
>> [ 36.066504] [drm:drm_calc_timestamping_constants] crtc 30: hwmode:
>> htotal 2200, vtotal 1125, vdisplay 1080
>> [ 36.066508] [drm:drm_calc_timestamping_constants] crtc 30: clock
>> 148500 kHz framedur 16666666 linedur 14814
>> [ 36.076535] rockchip-vop ff8f0000.vop: [drm:vop_crtc_atomic_flush]
>> *ERROR* VOP vblank IRQ stuck for 10 ms
>> [ 36.076577] WARNING: CPU: 1 PID: 83 at
>> drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004
>> vop_crtc_atomic_flush+0x1c0/0x1c8

this looks like an issue recently reported by heiko, we found that might
due to an unbalanced irq disable in vop driver.

my test patch is:

+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1601,6 +1601,8 @@ static void vop_unbind(struct device *dev, struct
device *master, void *data)
{
struct vop *vop = dev_get_drvdata(dev);

+ // Pair with the initial disable_irq()
+ enable_irq(vop->irq);



and i think sandy would send the real patch soon(maybe already sent?)
>
> Full dmesg with patch "arm64: dts: rockchip: add clocks in iommu nodes":
> https://gist.github.com/jakob-tsd/3fd49894d52dcd8a409eb9e6136b2d39
>
> Full dmesg with patch "iommu/rockchip: make clock handling optional":
> https://gist.github.com/jakob-tsd/da96572a40d11f0f6dff3ee481098138
> (looks the same)
>
> Thanks,
> Jakob
>
>
>



2018-04-24 13:50:08

by Jakob Unterwurzacher

[permalink] [raw]
Subject: Re: [regression, bisected] rockchip rk3399 video output breakage

On 24.04.18 15:33, JeffyChen wrote:
>>> [   36.076577] WARNING: CPU: 1 PID: 83 at
>>> drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004
>>> vop_crtc_atomic_flush+0x1c0/0x1c8
>
> this looks like an issue recently reported by heiko, we found that might
> due to an unbalanced irq disable in vop driver.
>
> my test patch is:
>
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1601,6 +1601,8 @@ static void vop_unbind(struct device *dev, struct
> device *master, void *data)
>  {
>         struct vop *vop = dev_get_drvdata(dev);
>
> +       // Pair with the initial disable_irq()
> +       enable_irq(vop->irq);
>
>
>
> and i think sandy would send the real patch soon(maybe already sent?)

Works fine with your patch! Thank you very much Jeffy.

Best regards,
Jakob

2018-04-24 14:37:13

by Jakob Unterwurzacher

[permalink] [raw]
Subject: Re: [regression, bisected] rockchip rk3399 video output breakage

On 24.04.18 14:37, JeffyChen wrote:
>
> right, i think it's a known issue, as the iommu failed to get clks:
> [    1.525153] rk_iommu ff8f3f00.iommu: Failed to get clk 'iface': -2
> [    1.525316] rk_iommu: probe of ff8f3f00.iommu failed with error -2
> [    1.525484] rk_iommu ff903f00.iommu: Failed to get clk 'iface': -2
> [    1.525643] rk_iommu: probe of ff903f00.iommu failed with error -2
>
>
> there's a followed patch to add those clks to the dtsi, and also a fix
> patch to make those clks optional(by heiko):
>
> https://www.spinics.net/lists/arm-kernel/msg645696.html
>
> http://lists.infradead.org/pipermail/linux-rockchip/2018-April/020349.html

Thanks, I tested both, and both get the screen to display some kernel
output!

However, I am getting some nasty error messages and the screen seems to
refresh only once every 30 seconds:

> [ 15.586502] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:30:crtc-0] flip_done timed out
> [ 25.826490] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:37:HDMI-A-1] flip_done timed out
> [ 36.066490] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:28:plane-0] flip_done timed out
> [ 36.066504] [drm:drm_calc_timestamping_constants] crtc 30: hwmode: htotal 2200, vtotal 1125, vdisplay 1080
> [ 36.066508] [drm:drm_calc_timestamping_constants] crtc 30: clock 148500 kHz framedur 16666666 linedur 14814
> [ 36.076535] rockchip-vop ff8f0000.vop: [drm:vop_crtc_atomic_flush] *ERROR* VOP vblank IRQ stuck for 10 ms
> [ 36.076577] WARNING: CPU: 1 PID: 83 at drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1004 vop_crtc_atomic_flush+0x1c0/0x1c8

Full dmesg with patch "arm64: dts: rockchip: add clocks in iommu nodes":
https://gist.github.com/jakob-tsd/3fd49894d52dcd8a409eb9e6136b2d39

Full dmesg with patch "iommu/rockchip: make clock handling optional":
https://gist.github.com/jakob-tsd/da96572a40d11f0f6dff3ee481098138
(looks the same)

Thanks,
Jakob