Fix drm driver hang on tegra124-nyan-big
v2 cover Fix drm driver hang on tegra124-nyan-big
This patch was initially sent along with another one to fix a first hang in the nouveau drm driver[1]. I'm now sending it again as a separate patch as it's to fix a second hang which is not strictly related. It is hidden by the first hang though, as this happens later on during the driver initialisation.
The issue this is addressing is due to a rework[2] of the driver which apparently wasn't fully tested on tegra124 and possibly also on tegra210. The sor->clk_out is not used on these platforms as HDMI and DP are both not supported (but eDP is), so trying to assign the parent clock to clk_out does nothing. The driver then goes on to configure the clock and PLL registers in tegra_sor_edp_enable and this is where it hangs.
As this is hard to debug further without full documentation or a hardware debugger, this patch essentially makes the driver do what it used to do on these platforms before the rework (i.e. assign the parent clock to sor->clk instead). There might be a more correct way of fixing this, hence the RFC.
[1] https://patchwork.kernel.org/patch/10124637/
[2] e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock")
Guillaume Tucker (1):
drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out
drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--
2.11.0
RFC PATCH v2 1/1 drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out
When neither HDMI nor DP is supported such as on the tegra124, the sor->clk_out is not initialised and remains NULL. In this case, the parent clock can't be assigned to it so revert to the previous behaviour of assigning it to the main sor->clk instead.
This fixes a kernel hang on tegra124 and should also affect tegra210 as they both don't support HDMI and DP. Tested on tegra124 only.
--- drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/sor.c +1 -1
@@ -255,7 +255,7 @@ static int tegra_sor_set_parent_clock(struct tegra_sor *sor, struct clk *parent)clk_disable_unprepare (sor->clk); - err =clk_set_parent (sor->clk_out, parent); + err =clk_set_parent (sor->clk_out ? sor->clk_out : sor->clk, parent);if (err <0 )return err;
Signature · 1 line
2.11.0
Re: [RFC PATCH v2 1/1] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out
Quoted 8 lines · Guillaume Tucker
When neither HDMI nor DP is supported such as on the tegra124, the
sor->clk_outis not initialised and remains NULL. In this case, the parent clock can't be assigned to it so revert to the previous behaviour of assigning it to the mainsor->clkinstead.This fixes a kernel hang on tegra124 and should also affect tegra210 as they both don't support HDMI and DP. Tested on tegra124 only.
Quoted 6 lines
Fixes e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock")Signed-off-by Guillaume Tucker <[email protected]>CC Thierry Reding <[email protected]>--- drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
How about just the below instead? It's one more line than your patch, but it will automatically handle all occurrences of clk_out properly.
--- >8 ---
drivers/gpu/drm/tegra/sor.c +2 -0
@@ -3047,6 +3047,8 @@ static int tegra_sor_probe(struct platform_device *pdev) name, err); goto remove; } + }else { + sor->clk_out = sor->clk; } sor->clk_parent =devm_clk_get (&pdev->dev,"parent" );
--- >8 ---
That said, I suspect the SOR might be compatible from a clock point of view with later versions and perhaps we just didn't implement clocks correctly back in the Tegra124 timeframe.
Maybe Peter knows.
Thierry
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH v2 1/1] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out
Quoted 35 lines · Thierry Reding
Quoted 8 lines · Guillaume Tucker
When neither HDMI nor DP is supported such as on the tegra124, the
sor->clk_outis not initialised and remains NULL. In this case, the parent clock can't be assigned to it so revert to the previous behaviour of assigning it to the mainsor->clkinstead.This fixes a kernel hang on tegra124 and should also affect tegra210 as they both don't support HDMI and DP. Tested on tegra124 only.
Quoted 6 lines
Fixes e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock")Signed-off-by Guillaume Tucker <[email protected]>CC Thierry Reding <[email protected]>--- drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)How about just the below instead? It's one more line than your patch, but it will automatically handle all occurrences of
clk_outproperly.--- >8 ---
drivers/gpu/drm/tegra/sor.c +2
-1@@ -3047,6 +3047,8 @@ static int tegra_sor_probe(struct platform_device *pdev) name, err); goto remove; } + }else { + sor->clk_out = sor->clk; } sor->clk_parent =devm_clk_get (&pdev->dev,"parent" ); --- >8 ---
Quoted 5 lines
That said, I suspect the SOR might be compatible from a clock point of view with later versions and perhaps we just didn't implement clocks correctly back in the Tegra124 timeframe.
Maybe Peter knows.
So the above change from Thierry works for me and we need this for v4.15 (otherwise nyan-big does not boot) so you can have my ...
However, would be good to have Peter's ACK, especially seeing that Tegra210 sor0 does not support HDMI and DP. So we need to make sure this is correct for Tegra210 as well (although I have not seen any regressions for Tegra210).
Cheers
Jon
Signature · 5 lines
nvpublic _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH v2 1/1] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out
Quoted 46 lines · Jon Hunter
Quoted 35 lines · Thierry Reding
Quoted 8 lines · Guillaume Tucker
When neither HDMI nor DP is supported such as on the tegra124, the
sor->clk_outis not initialised and remains NULL. In this case, the parent clock can't be assigned to it so revert to the previous behaviour of assigning it to the mainsor->clkinstead.This fixes a kernel hang on tegra124 and should also affect tegra210 as they both don't support HDMI and DP. Tested on tegra124 only.
Quoted 6 lines
Fixes e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock")Signed-off-by Guillaume Tucker <[email protected]>CC Thierry Reding <[email protected]>--- drivers/gpu/drm/tegra/sor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)How about just the below instead? It's one more line than your patch, but it will automatically handle all occurrences of
clk_outproperly.--- >8 ---
drivers/gpu/drm/tegra/sor.c +2
-1@@ -3047,6 +3047,8 @@ static int tegra_sor_probe(struct platform_device *pdev) name, err); goto remove; } + }else { + sor->clk_out = sor->clk; } sor->clk_parent =devm_clk_get (&pdev->dev,"parent" ); --- >8 ---Quoted 5 lines
That said, I suspect the SOR might be compatible from a clock point of view with later versions and perhaps we just didn't implement clocks correctly back in the Tegra124 timeframe.
Maybe Peter knows.
So the above change from Thierry works for me and we need this for v4.15 (otherwise nyan-big does not boot) so you can have my ...
Quoted 6 lines
Tested-by Jon Hunter <[email protected]>However, would be good to have Peter's ACK, especially seeing that Tegra210 sor0 does not support HDMI and DP. So we need to make sure this is correct for Tegra210 as well (although I have not seen any regressions for Tegra210).
There are no Tegra210 boards with eDP or LVDS support, which are the only setups that are impacted by this.
I've sent out the above as a proper patch. I'll submit this for a late fixes pull request.
Thierry
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel