From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey Hugo Subject: Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name Date: Wed, 5 Dec 2018 14:20:07 -0700 Message-ID: <14cad8f0-7388-16a0-b1ba-4cd5a469a17e@codeaurora.org> References: <1542314695-24071-1-git-send-email-jhugo@codeaurora.org> <1542314695-24071-2-git-send-email-jhugo@codeaurora.org> <0ba54ffd-1d47-5ae9-ae9c-4a03d57e6ff3@codeaurora.org> <20181205164843.GB1492@tuxbook-pro> <05b9ee40-d51e-3f80-8ca4-217fa6fbd51c@codeaurora.org> <154404384283.88331.2522037578224950651@swboyd.mtv.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <154404384283.88331.2522037578224950651@swboyd.mtv.corp.google.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stephen Boyd , Bjorn Andersson Cc: Andy Gross , MSM , Georgi Djakov , Linux ARM , Marc Gonzalez List-Id: linux-arm-msm@vger.kernel.org On 12/5/2018 2:04 PM, Stephen Boyd wrote: > Quoting Jeffrey Hugo (2018-12-05 09:03:54) >> On 12/5/2018 9:48 AM, Bjorn Andersson wrote: >>> On Wed 05 Dec 08:38 PST 2018, Jeffrey Hugo wrote: >>> >>>> On 12/5/2018 9:12 AM, Marc Gonzalez wrote: >>>>> On 15/11/2018 21:44, Jeffrey Hugo wrote: >>>>> >>>>>> The root parent clock of most msm8998 clock is the "xo" clock. The DT node >>>>>> is incorrectly named "xo_board", which prevents Linux from correctly >>>>>> parsing the clock tree, resulting in most clocks being unparented and >>>>>> unable to be manipulated. The end result is that we can't turn on clocks >>>>>> for peripherals like SD, so init usually fails. >>>>>> >>>>>> Fixes: 4807c71cc688 (arm64: dts: Add msm8998 SoC and MTP board support) >>>>>> Reviewed-by: Bjorn Andersson >>>>>> Signed-off-by: Jeffrey Hugo >>>>>> --- >>>>>> arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi >>>>>> index 78227cc..a948d4b 100644 >>>>>> --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi >>>>>> +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi >>>>>> @@ -53,7 +53,7 @@ >>>>>> }; >>>>>> clocks { >>>>>> - xo_board { >>>>>> + xo { >>>>>> compatible = "fixed-clock"; >>>>>> #clock-cells = <0>; >>>>>> clock-frequency = <19200000>; >>>>>> >>>>> >>>>> Isn't there going to be a problem for msm8998 in drivers/clk/qcom/clk-smd-rpm.c >>>>> which uses "xo_board" for parent_names? >>>> >>>> Looks like you are right. This doesn't seem to be the correct way to >>>> address the issue then. I'll have to dig in and take another look. >>>> >>> >>> The appropriate solution is to describe references between clock drivers >>> explicitly in DeviceTree and by that not rely on a global namespace. >>> That will also sort out any initialization ordering issues that we might >>> have. >>> >>> But this task has not yet made it off the todo lists where it lives... >> >> Ok, that sounds great, but doesn't seem like it helps anyone today. >> >> Looks like 8916 and 8974 explicitly register an xo clock off the >> xo_board clock in the respective gcc drivers. 8996 does not, but I >> don't know how functional 8996 really is on mainline. 845 seems to >> register the bi_tcxo clock (the 845 version of xo) in the rpmh driver, >> off of xo_board. >> >> Since both Marc and I are trying to get 8998 to work, it seems like one >> of those two solutions would be workable, short term. >> >> How do you suggest we proceed? >> > > I don't quite understand the patch in general. The xo_board clk should > always exist in DT and the fixed factor clk in GCC is there until the > rpm clk driver can control the XO clk state vote for the kernel. Sorry, this wasn't apparent. It doesn't seem like this "requirement" is captured anywhere. As far as the SD clocks are concerned, they are defined in GCC, and eventually have a root parent called "xo". "xo" isn't defined anywhere, so the SD clocks can't really be used, and the hardware doesn't come up. This patch "fixed" that, but I missed the link to the rpm driver that Marc pointed out. > > If anything, change the DT node to be named xo-board instead of xo_board > because that matches DT naming schemes and then add a clock-output-names > = "xo_board" property to it so that we keep the underscore. I see this now, and I agree with it, but then SD goes back to a broken state because there is "xo" clock for GCC. Its not quite clear to me how to make GCC (and thus SD) happy again with this change reverted/fixed. Bjorn mentioned offline he is going to take a look, but he has a few other things on his plate first. -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.