Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbeABScT (ORCPT + 1 other); Tue, 2 Jan 2018 13:32:19 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:8851 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbeABScR (ORCPT ); Tue, 2 Jan 2018 13:32:17 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 02 Jan 2018 10:32:17 -0800 Subject: Re: [RFC PATCH v2 1/1] drm/tegra: sor: Fix hang on tegra124 due to NULL clk_out To: Thierry Reding , Guillaume Tucker , Peter De Schrijver CC: Thierry Reding , Peter De Schrijver , David Airlie , , , References: <0f776b7500ee0e74b316b9803803b309779d2ff7.1513768618.git.guillaume.tucker@collabora.com> <20171220181520.GA9687@ulmo> From: Jon Hunter Message-ID: Date: Tue, 2 Jan 2018 18:32:11 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171220181520.GA9687@ulmo> X-Originating-IP: [10.21.132.149] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 20/12/17 18:15, Thierry Reding wrote: > On Wed, Dec 20, 2017 at 11:32:23AM +0000, Guillaume Tucker wrote: >> 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. >> >> Fixes: e1335e2f0cfc ("drm/tegra: sor: Reimplement pad clock") >> Signed-off-by: Guillaume Tucker >> CC: Thierry Reding >> --- >> 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 --- > diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c > index f6313c4d612e..4be9edf9c6fe 100644 > --- a/drivers/gpu/drm/tegra/sor.c > +++ b/drivers/gpu/drm/tegra/sor.c > @@ -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. 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 ... Tested-by: Jon Hunter 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 -- nvpublic