devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: msm8916: Move smem below hwlock
@ 2016-02-23 17:21 Georgi Djakov
  2016-02-23 17:29 ` Srinivas Kandagatla
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Georgi Djakov @ 2016-02-23 17:21 UTC (permalink / raw)
  To: andy.gross
  Cc: devicetree, linux-arm-msm, linux-soc, linux-kernel, georgi.djakov

When the SMEM is probed it defers as it depends on the hardware lock, which
is not available yet. But the SMD bus and RPM regulators and clocks depend
on SMEM and they defer too. The problem with this is that the order of
registering the devices is not optimal and also we may end with messed
up serial console as the RPM clocks are not registered yet..

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 7705207872a5..c497c7b1ae70 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -113,15 +113,6 @@
 		};
 	};
 
-	smem {
-		compatible = "qcom,smem";
-
-		memory-region = <&smem_mem>;
-		qcom,rpm-msg-ram = <&rpm_msg_ram>;
-
-		hwlocks = <&tcsr_mutex 3>;
-	};
-
 	soc: soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -512,6 +503,16 @@
 		};
 	};
 
+	smem {
+		compatible = "qcom,smem";
+
+		memory-region = <&smem_mem>;
+		qcom,rpm-msg-ram = <&rpm_msg_ram>;
+
+		hwlocks = <&tcsr_mutex 3>;
+	};
+
+
 	smd {
 		compatible = "qcom,smd";
 

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 17:21 [PATCH] arm64: dts: msm8916: Move smem below hwlock Georgi Djakov
@ 2016-02-23 17:29 ` Srinivas Kandagatla
  2016-02-23 18:47   ` Georgi Djakov
  2016-02-23 17:39 ` Mark Rutland
  2016-02-24  6:00 ` Bjorn Andersson
  2 siblings, 1 reply; 9+ messages in thread
From: Srinivas Kandagatla @ 2016-02-23 17:29 UTC (permalink / raw)
  To: Georgi Djakov, andy.gross
  Cc: devicetree, linux-arm-msm, linux-soc, linux-kernel



On 23/02/16 17:21, Georgi Djakov wrote:
> When the SMEM is probed it defers as it depends on the hardware lock, which
> is not available yet. But the SMD bus and RPM regulators and clocks depend
> on SMEM and they defer too. The problem with this is that the order of
> registering the devices is not optimal and also we may end with messed
> up serial console as the RPM clocks are not registered yet..
I noticed the same issue but was wondering why would we end up with 
messed up serial console?

Could you add more details on why serial console is messed up?

I thought, serial driver has nothing to do with the rpm clocks directly!

--srini
>
> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
> ---
>   arch/arm64/boot/dts/qcom/msm8916.dtsi |   19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 7705207872a5..c497c7b1ae70 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -113,15 +113,6 @@
>   		};
>   	};
>
> -	smem {
> -		compatible = "qcom,smem";
> -
> -		memory-region = <&smem_mem>;
> -		qcom,rpm-msg-ram = <&rpm_msg_ram>;
> -
> -		hwlocks = <&tcsr_mutex 3>;
> -	};
> -
>   	soc: soc {
>   		#address-cells = <1>;
>   		#size-cells = <1>;
> @@ -512,6 +503,16 @@
>   		};
>   	};
>
> +	smem {
> +		compatible = "qcom,smem";
> +
> +		memory-region = <&smem_mem>;
> +		qcom,rpm-msg-ram = <&rpm_msg_ram>;
> +
> +		hwlocks = <&tcsr_mutex 3>;
> +	};
> +
> +
>   	smd {
>   		compatible = "qcom,smd";
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 17:21 [PATCH] arm64: dts: msm8916: Move smem below hwlock Georgi Djakov
  2016-02-23 17:29 ` Srinivas Kandagatla
@ 2016-02-23 17:39 ` Mark Rutland
  2016-02-24  6:00 ` Bjorn Andersson
  2 siblings, 0 replies; 9+ messages in thread
From: Mark Rutland @ 2016-02-23 17:39 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: andy.gross, devicetree, linux-arm-msm, linux-soc, linux-kernel

On Tue, Feb 23, 2016 at 07:21:11PM +0200, Georgi Djakov wrote:
> When the SMEM is probed it defers as it depends on the hardware lock, which
> is not available yet. But the SMD bus and RPM regulators and clocks depend
> on SMEM and they defer too. The problem with this is that the order of
> registering the devices is not optimal and also we may end with messed
> up serial console as the RPM clocks are not registered yet..

Re-ordering the DT is fragile at best, and not a real solution to this
class of problem.

Why can the drivers not defer probing in this case?

Mark.

> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/msm8916.dtsi |   19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 7705207872a5..c497c7b1ae70 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -113,15 +113,6 @@
>  		};
>  	};
>  
> -	smem {
> -		compatible = "qcom,smem";
> -
> -		memory-region = <&smem_mem>;
> -		qcom,rpm-msg-ram = <&rpm_msg_ram>;
> -
> -		hwlocks = <&tcsr_mutex 3>;
> -	};
> -
>  	soc: soc {
>  		#address-cells = <1>;
>  		#size-cells = <1>;
> @@ -512,6 +503,16 @@
>  		};
>  	};
>  
> +	smem {
> +		compatible = "qcom,smem";
> +
> +		memory-region = <&smem_mem>;
> +		qcom,rpm-msg-ram = <&rpm_msg_ram>;
> +
> +		hwlocks = <&tcsr_mutex 3>;
> +	};
> +
> +
>  	smd {
>  		compatible = "qcom,smd";
>  
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 17:29 ` Srinivas Kandagatla
@ 2016-02-23 18:47   ` Georgi Djakov
       [not found]     ` <56CCA95C.9070207-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2016-02-23 19:28     ` Srinivas Kandagatla
  0 siblings, 2 replies; 9+ messages in thread
From: Georgi Djakov @ 2016-02-23 18:47 UTC (permalink / raw)
  To: Srinivas Kandagatla, andy.gross
  Cc: devicetree, linux-arm-msm, linux-soc, linux-kernel

On 23.02.16 г. 19:29, Srinivas Kandagatla wrote:
> 
> 
> On 23/02/16 17:21, Georgi Djakov wrote:
>> When the SMEM is probed it defers as it depends on the hardware lock, which
>> is not available yet. But the SMD bus and RPM regulators and clocks depend
>> on SMEM and they defer too. The problem with this is that the order of
>> registering the devices is not optimal and also we may end with messed
>> up serial console as the RPM clocks are not registered yet..
> I noticed the same issue but was wondering why would we end up with messed up serial console?
> 
> Could you add more details on why serial console is messed up?
> 
> I thought, serial driver has nothing to do with the rpm clocks directly!
> 

If we don't have the rpm clocks registered, the uart clock is an orphan
and when clk_get_rate() is called on orphan clocks it returns 0 as rate.
In our case the msm_serial driver calls clk_get_rate() and gets 0 rate
as the parent rpm clock has not registered yet. The result is that the
baudrate is set incorrectly.

BR,
Georgi

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
       [not found]     ` <56CCA95C.9070207-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2016-02-23 19:03       ` Andy Gross
  2016-02-24 10:31         ` Georgi Djakov
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Gross @ 2016-02-23 19:03 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: Srinivas Kandagatla, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	linux-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, Feb 23, 2016 at 08:47:56PM +0200, Georgi Djakov wrote:
> On 23.02.16 г. 19:29, Srinivas Kandagatla wrote:
> > 
> > 
> > On 23/02/16 17:21, Georgi Djakov wrote:
> >> When the SMEM is probed it defers as it depends on the hardware lock, which
> >> is not available yet. But the SMD bus and RPM regulators and clocks depend
> >> on SMEM and they defer too. The problem with this is that the order of
> >> registering the devices is not optimal and also we may end with messed
> >> up serial console as the RPM clocks are not registered yet..
> > I noticed the same issue but was wondering why would we end up with messed up serial console?
> > 
> > Could you add more details on why serial console is messed up?
> > 
> > I thought, serial driver has nothing to do with the rpm clocks directly!
> > 
> 
> If we don't have the rpm clocks registered, the uart clock is an orphan
> and when clk_get_rate() is called on orphan clocks it returns 0 as rate.
> In our case the msm_serial driver calls clk_get_rate() and gets 0 rate
> as the parent rpm clock has not registered yet. The result is that the
> baudrate is set incorrectly.

This isn't a probe defer issue w/ the SMEM and hwspinlock.  That works properly.
This is an issue with the msm_serial either not probe deferring to wait for the
rpm clocks or not handling the case of the clk framework giving us a 'bogus'
clock.  Can we queue off the clk_get_rate being 0 to probe defer for the rpm
clocks? (although that is hacky).

Regards,

Andy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 18:47   ` Georgi Djakov
       [not found]     ` <56CCA95C.9070207-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2016-02-23 19:28     ` Srinivas Kandagatla
  2016-02-23 20:18       ` Georgi Djakov
  1 sibling, 1 reply; 9+ messages in thread
From: Srinivas Kandagatla @ 2016-02-23 19:28 UTC (permalink / raw)
  To: Georgi Djakov, andy.gross
  Cc: devicetree, linux-arm-msm, linux-soc, linux-kernel



On 23/02/16 18:47, Georgi Djakov wrote:
> On 23.02.16 г. 19:29, Srinivas Kandagatla wrote:
>>
>>
>> On 23/02/16 17:21, Georgi Djakov wrote:
>>> When the SMEM is probed it defers as it depends on the hardware lock, which
>>> is not available yet. But the SMD bus and RPM regulators and clocks depend
>>> on SMEM and they defer too. The problem with this is that the order of
>>> registering the devices is not optimal and also we may end with messed
>>> up serial console as the RPM clocks are not registered yet..
>> I noticed the same issue but was wondering why would we end up with messed up serial console?
>>
>> Could you add more details on why serial console is messed up?
>>
>> I thought, serial driver has nothing to do with the rpm clocks directly!
>>
>
> If we don't have the rpm clocks registered, the uart clock is an orphan
> and when clk_get_rate() is called on orphan clocks it returns 0 as rate.
Shouldn't the actual uart clk provider registration fail/defer probe due 
to missing parent in this case?

--srini
> In our case the msm_serial driver calls clk_get_rate() and gets 0 rate
> as the parent rpm clock has not registered yet. The result is that the
> baudrate is set incorrectly.
>
> BR,
> Georgi
>

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 19:28     ` Srinivas Kandagatla
@ 2016-02-23 20:18       ` Georgi Djakov
  0 siblings, 0 replies; 9+ messages in thread
From: Georgi Djakov @ 2016-02-23 20:18 UTC (permalink / raw)
  To: Srinivas Kandagatla, andy.gross
  Cc: Georgi Djakov, devicetree, linux-arm-msm, linux-soc, linux-kernel

On 23.02.16 г. 21:28, Srinivas Kandagatla wrote:
> 
> 
> On 23/02/16 18:47, Georgi Djakov wrote:
>> On 23.02.16 г. 19:29, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 23/02/16 17:21, Georgi Djakov wrote:
>>>> When the SMEM is probed it defers as it depends on the hardware lock, which
>>>> is not available yet. But the SMD bus and RPM regulators and clocks depend
>>>> on SMEM and they defer too. The problem with this is that the order of
>>>> registering the devices is not optimal and also we may end with messed
>>>> up serial console as the RPM clocks are not registered yet..
>>> I noticed the same issue but was wondering why would we end up with messed up serial console?
>>>
>>> Could you add more details on why serial console is messed up?
>>>
>>> I thought, serial driver has nothing to do with the rpm clocks directly!
>>>
>>
>> If we don't have the rpm clocks registered, the uart clock is an orphan
>> and when clk_get_rate() is called on orphan clocks it returns 0 as rate.
> Shouldn't the actual uart clk provider registration fail/defer probe due to missing parent in this case?
> 

Yes, this is a known issue and people are currently working on it.
http://www.spinics.net/lists/linux-clk/msg00065.html
http://www.spinics.net/lists/arm-kernel/msg475910.html

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 17:21 [PATCH] arm64: dts: msm8916: Move smem below hwlock Georgi Djakov
  2016-02-23 17:29 ` Srinivas Kandagatla
  2016-02-23 17:39 ` Mark Rutland
@ 2016-02-24  6:00 ` Bjorn Andersson
  2 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2016-02-24  6:00 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: andy.gross, devicetree, linux-arm-msm, linux-soc, linux-kernel

On Tue 23 Feb 09:21 PST 2016, Georgi Djakov wrote:

> When the SMEM is probed it defers as it depends on the hardware lock, which
> is not available yet. But the SMD bus and RPM regulators and clocks depend
> on SMEM and they defer too. The problem with this is that the order of
> registering the devices is not optimal and also we may end with messed
> up serial console as the RPM clocks are not registered yet..
> 
> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>

Not only do you need the probe order to be "correct", you also need some
luck to have the smd code execute its two workers to initialise the
rpmcc driver before your serial driver is probed. So I don't think we
should merge this upstream.


I tried this on my linux-next tree on db410c and it doesn't hide the
problem for me.

Regards,
Bjorn

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

* Re: [PATCH] arm64: dts: msm8916: Move smem below hwlock
  2016-02-23 19:03       ` Andy Gross
@ 2016-02-24 10:31         ` Georgi Djakov
  0 siblings, 0 replies; 9+ messages in thread
From: Georgi Djakov @ 2016-02-24 10:31 UTC (permalink / raw)
  To: Andy Gross
  Cc: Srinivas Kandagatla, devicetree, linux-arm-msm, linux-soc,
	linux-kernel, mark.rutland

On 02/23/2016 09:03 PM, Andy Gross wrote:
> On Tue, Feb 23, 2016 at 08:47:56PM +0200, Georgi Djakov wrote:
>> On 23.02.16 г. 19:29, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 23/02/16 17:21, Georgi Djakov wrote:
>>>> When the SMEM is probed it defers as it depends on the hardware lock, which
>>>> is not available yet. But the SMD bus and RPM regulators and clocks depend
>>>> on SMEM and they defer too. The problem with this is that the order of
>>>> registering the devices is not optimal and also we may end with messed
>>>> up serial console as the RPM clocks are not registered yet..
>>> I noticed the same issue but was wondering why would we end up with messed up serial console?
>>>
>>> Could you add more details on why serial console is messed up?
>>>
>>> I thought, serial driver has nothing to do with the rpm clocks directly!
>>>
>>
>> If we don't have the rpm clocks registered, the uart clock is an orphan
>> and when clk_get_rate() is called on orphan clocks it returns 0 as rate.
>> In our case the msm_serial driver calls clk_get_rate() and gets 0 rate
>> as the parent rpm clock has not registered yet. The result is that the
>> baudrate is set incorrectly.
> 
> This isn't a probe defer issue w/ the SMEM and hwspinlock.  That works properly.

Ok, agree.

> This is an issue with the msm_serial either not probe deferring to wait for the
> rpm clocks or not handling the case of the clk framework giving us a 'bogus'
> clock.  Can we queue off the clk_get_rate being 0 to probe defer for the rpm
> clocks? (although that is hacky).

The proper solution would be to handle this in the clock framework.

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

end of thread, other threads:[~2016-02-24 10:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23 17:21 [PATCH] arm64: dts: msm8916: Move smem below hwlock Georgi Djakov
2016-02-23 17:29 ` Srinivas Kandagatla
2016-02-23 18:47   ` Georgi Djakov
     [not found]     ` <56CCA95C.9070207-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-02-23 19:03       ` Andy Gross
2016-02-24 10:31         ` Georgi Djakov
2016-02-23 19:28     ` Srinivas Kandagatla
2016-02-23 20:18       ` Georgi Djakov
2016-02-23 17:39 ` Mark Rutland
2016-02-24  6:00 ` Bjorn Andersson

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