linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
       [not found] ` <1542314695-24071-2-git-send-email-jhugo@codeaurora.org>
@ 2018-12-05 16:12   ` Marc Gonzalez
  2018-12-05 16:38     ` Jeffrey Hugo
  0 siblings, 1 reply; 12+ messages in thread
From: Marc Gonzalez @ 2018-12-05 16:12 UTC (permalink / raw)
  To: Jeffrey Hugo
  Cc: Stephen Boyd, MSM, Bjorn Andersson, Andy Gross, Georgi Djakov,
	Linux ARM

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 <bjorn.andersson@linaro.org>
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---
>  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?

Regards.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 16:12   ` [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name Marc Gonzalez
@ 2018-12-05 16:38     ` Jeffrey Hugo
  2018-12-05 16:48       ` Bjorn Andersson
  0 siblings, 1 reply; 12+ messages in thread
From: Jeffrey Hugo @ 2018-12-05 16:38 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Stephen Boyd, MSM, Bjorn Andersson, Andy Gross, Georgi Djakov,
	Linux ARM

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 <bjorn.andersson@linaro.org>
>> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
>> ---
>>   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.


-- 
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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 16:38     ` Jeffrey Hugo
@ 2018-12-05 16:48       ` Bjorn Andersson
  2018-12-05 17:03         ` Jeffrey Hugo
  0 siblings, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2018-12-05 16:48 UTC (permalink / raw)
  To: Jeffrey Hugo
  Cc: Marc Gonzalez, Stephen Boyd, MSM, Andy Gross, Georgi Djakov,
	Linux ARM

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 <bjorn.andersson@linaro.org>
> > > Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> > > ---
> > >   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...

Regards,
Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 16:48       ` Bjorn Andersson
@ 2018-12-05 17:03         ` Jeffrey Hugo
  2018-12-05 21:04           ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Jeffrey Hugo @ 2018-12-05 17:03 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Marc Gonzalez, Stephen Boyd, MSM, Andy Gross, Georgi Djakov,
	Linux ARM

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 <bjorn.andersson@linaro.org>
>>>> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
>>>> ---
>>>>    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?

-- 
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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 17:03         ` Jeffrey Hugo
@ 2018-12-05 21:04           ` Stephen Boyd
  2018-12-05 21:20             ` Jeffrey Hugo
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2018-12-05 21:04 UTC (permalink / raw)
  To: Bjorn Andersson, Jeffrey Hugo
  Cc: Andy Gross, MSM, Georgi Djakov, Linux ARM, Marc Gonzalez

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 <bjorn.andersson@linaro.org>
> >>>> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> >>>> ---
> >>>>    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.

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.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 21:04           ` Stephen Boyd
@ 2018-12-05 21:20             ` Jeffrey Hugo
  2018-12-05 21:42               ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Jeffrey Hugo @ 2018-12-05 21:20 UTC (permalink / raw)
  To: Stephen Boyd, Bjorn Andersson
  Cc: Andy Gross, MSM, Georgi Djakov, Linux ARM, Marc Gonzalez

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 <bjorn.andersson@linaro.org>
>>>>>> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
>>>>>> ---
>>>>>>     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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 21:20             ` Jeffrey Hugo
@ 2018-12-05 21:42               ` Stephen Boyd
  2018-12-05 23:04                 ` Jeffrey Hugo
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2018-12-05 21:42 UTC (permalink / raw)
  To: Bjorn Andersson, Jeffrey Hugo
  Cc: Andy Gross, MSM, Georgi Djakov, Linux ARM, Marc Gonzalez

Quoting Jeffrey Hugo (2018-12-05 13:20:07)
> On 12/5/2018 2:04 PM, Stephen Boyd wrote:
> > Quoting Jeffrey Hugo (2018-12-05 09:03:54)
> > 
> > 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.

Agreed!

> 
> 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.

Hmm ok. The SD DT node should just point to the xo_board clk for now and
later on it can be changed to use the rpm clk when the rpm node is
created.

> 
> 
> > 
> > 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.
> 

There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
do the same here until rpm can handle this. I'll pack this patch up and
merge it to clk-next soon.

----8<----
diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c
index c3bb9fffd040..d72b908137e2 100644
--- a/drivers/clk/qcom/gcc-msm8998.c
+++ b/drivers/clk/qcom/gcc-msm8998.c
@@ -117,6 +117,17 @@ static const char * const gcc_parent_names_5[] = {
 	"core_bi_pll_test_se",
 };
 
+static struct clk_fixed_factor xo = {
+	.mult = 1,
+	.div = 1,
+	.hw.init = &(struct clk_init_data){
+		.name = "xo",
+		.parent_names = (const char *[]){ "xo_board" },
+		.num_parents = 1,
+		.ops = &clk_fixed_factor_ops,
+	},
+};
+
 static struct pll_vco fabia_vco[] = {
 	{ 250000000, 2000000000, 0 },
 	{ 125000000, 1000000000, 1 },
@@ -2798,6 +2809,10 @@ static int gcc_msm8998_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	ret = devm_clk_hw_register(&pdev->dev, &xo.hw);
+	if (ret)
+		return ret;
+
 	return qcom_cc_really_probe(pdev, &gcc_msm8998_desc, regmap);
 }
 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 21:42               ` Stephen Boyd
@ 2018-12-05 23:04                 ` Jeffrey Hugo
  2018-12-06 18:34                   ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Jeffrey Hugo @ 2018-12-05 23:04 UTC (permalink / raw)
  To: Stephen Boyd, Bjorn Andersson, Andy Gross
  Cc: MSM, Georgi Djakov, Linux ARM, Marc Gonzalez

On 12/5/2018 2:42 PM, Stephen Boyd wrote:
> Quoting Jeffrey Hugo (2018-12-05 13:20:07)
>> On 12/5/2018 2:04 PM, Stephen Boyd wrote:
>>> Quoting Jeffrey Hugo (2018-12-05 09:03:54)
>>>
>>> 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.
> 
> Agreed!
> 
>>
>> 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.
> 
> Hmm ok. The SD DT node should just point to the xo_board clk for now and
> later on it can be changed to use the rpm clk when the rpm node is
> created.
> 
>>
>>
>>>
>>> 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.
>>
> 
> There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
> do the same here until rpm can handle this. I'll pack this patch up and
> merge it to clk-next soon.

Thanks.  I pulled in the below change into my tree, and fixed up the DT 
based on the discussion we had.  SD works, and things look sane to me 
per clk_summary in debugfs.

Feel free to throw my tested-by on if you want.

Andy,
How would you like this little mess from my patch series to be fixed? 
It looks like you picked up a hybrid of v1 and v2 in your tree, and it 
would appear that went in a pull request to the ARM maintainers.  Do you 
want fixes based upon your next branch?

> 
> ----8<----
> diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c
> index c3bb9fffd040..d72b908137e2 100644
> --- a/drivers/clk/qcom/gcc-msm8998.c
> +++ b/drivers/clk/qcom/gcc-msm8998.c
> @@ -117,6 +117,17 @@ static const char * const gcc_parent_names_5[] = {
>   	"core_bi_pll_test_se",
>   };
>   
> +static struct clk_fixed_factor xo = {
> +	.mult = 1,
> +	.div = 1,
> +	.hw.init = &(struct clk_init_data){
> +		.name = "xo",
> +		.parent_names = (const char *[]){ "xo_board" },
> +		.num_parents = 1,
> +		.ops = &clk_fixed_factor_ops,
> +	},
> +};
> +
>   static struct pll_vco fabia_vco[] = {
>   	{ 250000000, 2000000000, 0 },
>   	{ 125000000, 1000000000, 1 },
> @@ -2798,6 +2809,10 @@ static int gcc_msm8998_probe(struct platform_device *pdev)
>   	if (ret)
>   		return ret;
>   
> +	ret = devm_clk_hw_register(&pdev->dev, &xo.hw);
> +	if (ret)
> +		return ret;
> +
>   	return qcom_cc_really_probe(pdev, &gcc_msm8998_desc, regmap);
>   }
>   


-- 
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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-05 23:04                 ` Jeffrey Hugo
@ 2018-12-06 18:34                   ` Stephen Boyd
  2018-12-07  9:03                     ` Marc Gonzalez
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2018-12-06 18:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Jeffrey Hugo
  Cc: MSM, Georgi Djakov, Linux ARM, Marc Gonzalez

Quoting Jeffrey Hugo (2018-12-05 15:04:01)
> On 12/5/2018 2:42 PM, Stephen Boyd wrote:
> > Quoting Jeffrey Hugo (2018-12-05 13:20:07)
> >> On 12/5/2018 2:04 PM, Stephen Boyd wrote:
> >>> Quoting Jeffrey Hugo (2018-12-05 09:03:54)
> >>>
> >>> 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.
> > 
> > Agreed!
> > 
> >>
> >> 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.
> > 
> > Hmm ok. The SD DT node should just point to the xo_board clk for now and
> > later on it can be changed to use the rpm clk when the rpm node is
> > created.
> > 
> >>
> >>
> >>>
> >>> 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.
> >>
> > 
> > There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
> > do the same here until rpm can handle this. I'll pack this patch up and
> > merge it to clk-next soon.
> 
> Thanks.  I pulled in the below change into my tree, and fixed up the DT 
> based on the discussion we had.  SD works, and things look sane to me 
> per clk_summary in debugfs.
> 
> Feel free to throw my tested-by on if you want.

Thanks. I did so and merged it up to clk-next.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-06 18:34                   ` Stephen Boyd
@ 2018-12-07  9:03                     ` Marc Gonzalez
  2018-12-07 14:58                       ` Jeffrey Hugo
  0 siblings, 1 reply; 12+ messages in thread
From: Marc Gonzalez @ 2018-12-07  9:03 UTC (permalink / raw)
  To: Stephen Boyd, Andy Gross
  Cc: Jeffrey Hugo, MSM, Georgi Djakov, Linux ARM, Bjorn Andersson

On 06/12/2018 19:34, Stephen Boyd wrote:
> Quoting Jeffrey Hugo (2018-12-05 15:04:01)
>> On 12/5/2018 2:42 PM, Stephen Boyd wrote:
>>> Quoting Jeffrey Hugo (2018-12-05 13:20:07)
>>>> On 12/5/2018 2:04 PM, Stephen Boyd wrote:
>>>>> Quoting Jeffrey Hugo (2018-12-05 09:03:54)
>>>>>
>>>>> 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.
>>>
>>> Agreed!
>>>
>>>>
>>>> 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.
>>>
>>> Hmm ok. The SD DT node should just point to the xo_board clk for now and
>>> later on it can be changed to use the rpm clk when the rpm node is
>>> created.
>>>
>>>>
>>>>
>>>>>
>>>>> 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.
>>>>
>>>
>>> There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
>>> do the same here until rpm can handle this. I'll pack this patch up and
>>> merge it to clk-next soon.
>>
>> Thanks.  I pulled in the below change into my tree, and fixed up the DT 
>> based on the discussion we had.  SD works, and things look sane to me 
>> per clk_summary in debugfs.
>>
>> Feel free to throw my tested-by on if you want.
> 
> Thanks. I did so and merged it up to clk-next.

@Andy, don't you still need to revert 634da3307b083ee83eb9b377081fdfd6416a148a
("arm64: dts: qcom: msm8998: correct xo clock name") in for-next?

Regards.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-07  9:03                     ` Marc Gonzalez
@ 2018-12-07 14:58                       ` Jeffrey Hugo
  2018-12-07 18:23                         ` Andy Gross
  0 siblings, 1 reply; 12+ messages in thread
From: Jeffrey Hugo @ 2018-12-07 14:58 UTC (permalink / raw)
  To: Marc Gonzalez, Stephen Boyd, Andy Gross
  Cc: MSM, Georgi Djakov, Linux ARM, Bjorn Andersson

On 12/7/2018 2:03 AM, Marc Gonzalez wrote:
> On 06/12/2018 19:34, Stephen Boyd wrote:
>> Quoting Jeffrey Hugo (2018-12-05 15:04:01)
>>> On 12/5/2018 2:42 PM, Stephen Boyd wrote:
>>>> Quoting Jeffrey Hugo (2018-12-05 13:20:07)
>>>>> On 12/5/2018 2:04 PM, Stephen Boyd wrote:
>>>>>> Quoting Jeffrey Hugo (2018-12-05 09:03:54)
>>>>>>
>>>>>> 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.
>>>>
>>>> Agreed!
>>>>
>>>>>
>>>>> 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.
>>>>
>>>> Hmm ok. The SD DT node should just point to the xo_board clk for now and
>>>> later on it can be changed to use the rpm clk when the rpm node is
>>>> created.
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> 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.
>>>>>
>>>>
>>>> There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
>>>> do the same here until rpm can handle this. I'll pack this patch up and
>>>> merge it to clk-next soon.
>>>
>>> Thanks.  I pulled in the below change into my tree, and fixed up the DT
>>> based on the discussion we had.  SD works, and things look sane to me
>>> per clk_summary in debugfs.
>>>
>>> Feel free to throw my tested-by on if you want.
>>
>> Thanks. I did so and merged it up to clk-next.
> 
> @Andy, don't you still need to revert 634da3307b083ee83eb9b377081fdfd6416a148a
> ("arm64: dts: qcom: msm8998: correct xo clock name") in for-next?

Yes, and no.  The SD changes kind of depend on that, so those would need 
to get sorted as well.

I still haven't heard from Andy, but I guess I'll go ahead and create a 
fixup patch.


-- 
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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name
  2018-12-07 14:58                       ` Jeffrey Hugo
@ 2018-12-07 18:23                         ` Andy Gross
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Gross @ 2018-12-07 18:23 UTC (permalink / raw)
  To: Jeffrey Hugo
  Cc: Marc Gonzalez, Stephen Boyd, MSM, Bjorn Andersson, Georgi Djakov,
	Linux ARM

On Fri, Dec 07, 2018 at 07:58:52AM -0700, Jeffrey Hugo wrote:
> On 12/7/2018 2:03 AM, Marc Gonzalez wrote:
> >On 06/12/2018 19:34, Stephen Boyd wrote:
> >>Quoting Jeffrey Hugo (2018-12-05 15:04:01)
> >>>On 12/5/2018 2:42 PM, Stephen Boyd wrote:
> >>>>Quoting Jeffrey Hugo (2018-12-05 13:20:07)
> >>>>>On 12/5/2018 2:04 PM, Stephen Boyd wrote:
> >>>>>>Quoting Jeffrey Hugo (2018-12-05 09:03:54)
> >>>>>>
> >>>>>>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.
> >>>>
> >>>>Agreed!
> >>>>
> >>>>>
> >>>>>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.
> >>>>
> >>>>Hmm ok. The SD DT node should just point to the xo_board clk for now and
> >>>>later on it can be changed to use the rpm clk when the rpm node is
> >>>>created.
> >>>>
> >>>>>
> >>>>>
> >>>>>>
> >>>>>>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.
> >>>>>
> >>>>
> >>>>There is an XO clk created in drivers/clk/qcom/gcc-msm8996.c, we should
> >>>>do the same here until rpm can handle this. I'll pack this patch up and
> >>>>merge it to clk-next soon.
> >>>
> >>>Thanks.  I pulled in the below change into my tree, and fixed up the DT
> >>>based on the discussion we had.  SD works, and things look sane to me
> >>>per clk_summary in debugfs.
> >>>
> >>>Feel free to throw my tested-by on if you want.
> >>
> >>Thanks. I did so and merged it up to clk-next.
> >
> >@Andy, don't you still need to revert 634da3307b083ee83eb9b377081fdfd6416a148a
> >("arm64: dts: qcom: msm8998: correct xo clock name") in for-next?

I'll send a fix for this.  I think we want to keep the xo label, and just change
it to xo: xo_board.  So instead of a revert, it'll be that + a Fixes line.

That ok?


Andy

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-07 18:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1542314695-24071-1-git-send-email-jhugo@codeaurora.org>
     [not found] ` <1542314695-24071-2-git-send-email-jhugo@codeaurora.org>
2018-12-05 16:12   ` [PATCH v2 1/3] arm64: dts: qcom: msm8998: correct xo clock name Marc Gonzalez
2018-12-05 16:38     ` Jeffrey Hugo
2018-12-05 16:48       ` Bjorn Andersson
2018-12-05 17:03         ` Jeffrey Hugo
2018-12-05 21:04           ` Stephen Boyd
2018-12-05 21:20             ` Jeffrey Hugo
2018-12-05 21:42               ` Stephen Boyd
2018-12-05 23:04                 ` Jeffrey Hugo
2018-12-06 18:34                   ` Stephen Boyd
2018-12-07  9:03                     ` Marc Gonzalez
2018-12-07 14:58                       ` Jeffrey Hugo
2018-12-07 18:23                         ` Andy Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).