Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp518793ybh; Tue, 21 Jul 2020 00:46:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIX+CXH1oBoNF/uXG4yzne8wvV7oMOd7rN+pUhyBpioB+4ZVJOx+P+ap5tkBoKB5RFOiZB X-Received: by 2002:a05:6402:1a3c:: with SMTP id be28mr25517822edb.140.1595317568751; Tue, 21 Jul 2020 00:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595317568; cv=none; d=google.com; s=arc-20160816; b=Kl+7hTNrILj/JqRNEKdVBkgNd90BdR+uBgLLPBi1cbpsvgfyKC8di8gxCBtklx+Rqf ZBHxnczlClJcBds/74EbFDT+j+0vE6IYdbEJMaAnG9BFhPcbdexZqPcfS61/8nu86xVt Z/C1WvUTzc9yJjFFWiz3PLrojQu8+cvyiWCmihnfTFtlg1bhLBM2xWOQXGL7+9hGYDVk iBpTEHPNaxMbOok5GAfnSw2x2dCrpSrrHc5Nd6X7Scw4ceF7Xw/t9xwXlguxh8gq59Xn KskSVjsYZtPAm0KK3Htjs50srpOkQCERFNSGVri6AuY05/orkuqLmjo4vwDaZ7UFFmIE EmuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=e44rgnPGf4YzgWVznD18iryQGlC9JIUsRPIfaBYE+/s=; b=bflUsqAY+nslnGAIq8s3oMDOsnJYOf596V/TI1bJGrV3zymG9Qa/cNICgytaV1m0Pl 04Lh254yrckjZ4bOIDc4gAuQYwaZkUYlD/++kF1oMIu1qyv9TMVq8gsZAhrV5pzfRQbp MxKJRULedD0OpDDNaL42Akagi+MsZ8PV73KG4eIxQN92Nhwdv8283u1m/DeJDglLUgQ0 geaszp1i2wbS+exFFHWA1g0W0uv1Hg8OYoW1WSQeFFvasG1F8TSv5JR8uaMThg91J87j XTSgQcM1YFNrctE1pO6EBobcXgNrpi8o0lUj8KhqFwkvQyTmLa/1hzWL7wORvlJxKUxC PUMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WyksoiML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si13320132ejf.228.2020.07.21.00.45.46; Tue, 21 Jul 2020 00:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WyksoiML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbgGUHph (ORCPT + 99 others); Tue, 21 Jul 2020 03:45:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbgGUHpf (ORCPT ); Tue, 21 Jul 2020 03:45:35 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AAEFE20792; Tue, 21 Jul 2020 07:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595317534; bh=97y2zuXcVstRXdOrZNWE3KBD6w2VxtGXrPDl5D3CkIM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=WyksoiMLJAFq6dfdIMzZdi/o+mKSI6/xAJigf8NLmNQFNa40UCngkV7mj5gZP8OlV 5EhefaL/wrY6DxxzUBcQoifbQ40+G2RTcGzjdcdRlGYssjdiXpUpLq5aG3X6Qdu1Gc B5ktvVZkl+7EMYj/PpL9bRyU8DzvvjOeRZFYy/go= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1594796050-14511-1-git-send-email-tdas@codeaurora.org> References: <1594796050-14511-1-git-send-email-tdas@codeaurora.org> Subject: Re: [PATCH v0] clk: qcom: gcc: Update disp gpll0 branch for 7180/845 From: Stephen Boyd Cc: David Brown , Rajendra Nayak , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, evgreen@google.com, Taniya Das To: Michael Turquette , Taniya Das Date: Tue, 21 Jul 2020 00:45:33 -0700 Message-ID: <159531753391.3847286.4226820520237148758@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Taniya Das (2020-07-14 23:54:10) > The display gpll0 branch clock needs to be always left enabled, thus > move the clock ops to _aon branch ops. >=20 > Signed-off-by: Taniya Das I wanted to apply this but it needs more commit text. Here's the commit text I wrote. clk: qcom: gcc: Make disp gpll0 branch aon for sc7180/sdm845 The display gpll0 branch clock inside GCC needs to always be enabled. Otherwise the AHB clk (disp_cc_mdss_ahb_clk_src) for the display clk controller (dispcc) will stop clocking while sourcing from gpll0 when this branch inside GCC is turned off during unused clk disabling. We can never turn this branch off because the AHB clk for the display subsystem is needed to read/write any registers inside the display subsystem including clk related ones. This makes this branch a really easy way to turn off AHB access to the display subsystem and cause all sorts of mayhem. Let's just make the clk ops keep the clk enabled forever and ignore any attempts to disable this clk so that dispcc access keep working. Signed-off-by: Taniya Das Reported-by: Evan Green Link: https://lore.kernel.org/r/1594796050-14511-1-git-send-email-tdas@code= aurora.org Fixes: 17269568f726 ("clk: qcom: Add Global Clock controller (GCC) driver f= or SC7180") Fixes: 06391eddb60a ("clk: qcom: Add Global Clock controller (GCC) driver f= or SDM845") > --- > drivers/clk/qcom/gcc-sc7180.c | 2 +- > drivers/clk/qcom/gcc-sdm845.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/clk/qcom/gcc-sc7180.c b/drivers/clk/qcom/gcc-sc7180.c > index ca4383e..538677b 100644 > --- a/drivers/clk/qcom/gcc-sc7180.c > +++ b/drivers/clk/qcom/gcc-sc7180.c > @@ -1061,7 +1061,7 @@ static struct clk_branch gcc_disp_gpll0_clk_src =3D= { > .hw =3D &gpll0.clkr.hw, > }, > .num_parents =3D 1, > - .ops =3D &clk_branch2_ops, > + .ops =3D &clk_branch2_aon_ops, I'm worried that dispcc may probe before GCC and then this branch is disabled out of boot. Then we'll try to read dispcc registers to determine clk rates and blow up. I hope that doesn't happen and fixing it would need this patch plus the usage of PM clks in the dispcc driver. I suppose if we run into that problem we can use PM clks to make this branch turn on before accessing any dispcc clks.