Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1388929 > unrolled thread

[PATCH] cpufreq: st: enable selective initialization based on the platform

Started bySudeep Holla <sudeep.holla@arm.com>
First post2016-04-27 13:50 +0200
Last post2016-04-28 09:20 +0200
Articles 8 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] cpufreq: st: enable selective initialization based on the platform Sudeep Holla <sudeep.holla@arm.com> - 2016-04-27 13:50 +0200
    Re: [PATCH] cpufreq: st: enable selective initialization based on  the platform Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-27 13:50 +0200
      Re: [PATCH] cpufreq: st: enable selective initialization based on the  platform Sudeep Holla <sudeep.holla@arm.com> - 2016-04-27 14:50 +0200
    Re: [PATCH] cpufreq: st: enable selective initialization based on  the platform Lee Jones <lee.jones@linaro.org> - 2016-04-27 18:10 +0200
      Re: [PATCH] cpufreq: st: enable selective initialization based on the  platform Sudeep Holla <sudeep.holla@arm.com> - 2016-04-27 18:20 +0200
    [PATCH v2] cpufreq: st: enable selective initialization based on the platform Sudeep Holla <sudeep.holla@arm.com> - 2016-04-27 18:20 +0200
      Re: [PATCH v2] cpufreq: st: enable selective initialization based on  the platform Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-28 04:20 +0200
      Re: [PATCH v2] cpufreq: st: enable selective initialization based on  the platform Lee Jones <lee.jones@linaro.org> - 2016-04-28 09:20 +0200

#1388929 — [PATCH] cpufreq: st: enable selective initialization based on the platform

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-04-27 13:50 +0200
Subject[PATCH] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsw8G-s1-7@gated-at.bofh.it>
The sti-cpufreq does unconditional registration of the cpufreq-dt driver
which causes issue on an multi-platform build. For example, on Vexpress
TC2 platform, we get the following error on boot:

cpu cpu0: OPP-v2 not supported
cpu cpu0: Not doing voltage scaling
cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
	for cpu:0, -19
cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
...
arm_big_little: bL_cpufreq_register: Failed registering platform driver:
		vexpress-spc, err: -17

The actual driver fails to initialise as cpufreq-dt is probed
successfully, which is incorrect. This issue can happen to any platform
not using cpufreq-dt in a multi-platform build.

This patch adds a check to do selective initialization of the driver.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpufreq/sti-cpufreq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
index a9c659f58974..5fce58712a97 100644
--- a/drivers/cpufreq/sti-cpufreq.c
+++ b/drivers/cpufreq/sti-cpufreq.c
@@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
 {
 	int ret;
 
+	if ((!of_machine_is_compatible("st,stih407-b2120")) &&
+		(!of_machine_is_compatible("st,stih407")))
+		return -ENODEV;
+
 	ddata.cpu = get_cpu_device(0);
 	if (!ddata.cpu) {
 		dev_err(ddata.cpu, "Failed to get device for CPU0\n");
-- 
1.9.1

[toc] | [next] | [standalone]


#1388933 — Re: [PATCH] cpufreq: st: enable selective initialization based on the platform

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-27 13:50 +0200
SubjectRe: [PATCH] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsw8G-s1-23@gated-at.bofh.it>
In reply to#1388929
On 27-04-16, 12:40, Sudeep Holla wrote:
> The sti-cpufreq does unconditional registration of the cpufreq-dt driver
> which causes issue on an multi-platform build. For example, on Vexpress
> TC2 platform, we get the following error on boot:
> 
> cpu cpu0: OPP-v2 not supported
> cpu cpu0: Not doing voltage scaling
> cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
> 	for cpu:0, -19
> cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
> ...
> arm_big_little: bL_cpufreq_register: Failed registering platform driver:
> 		vexpress-spc, err: -17
> 
> The actual driver fails to initialise as cpufreq-dt is probed
> successfully, which is incorrect. This issue can happen to any platform
> not using cpufreq-dt in a multi-platform build.
> 
> This patch adds a check to do selective initialization of the driver.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/sti-cpufreq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
> index a9c659f58974..5fce58712a97 100644
> --- a/drivers/cpufreq/sti-cpufreq.c
> +++ b/drivers/cpufreq/sti-cpufreq.c
> @@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
>  {
>  	int ret;
>  
> +	if ((!of_machine_is_compatible("st,stih407-b2120")) &&
> +		(!of_machine_is_compatible("st,stih407")))

Isn't just testing this for stih407 enough? instead of two ?

> +		return -ENODEV;
> +
>  	ddata.cpu = get_cpu_device(0);
>  	if (!ddata.cpu) {
>  		dev_err(ddata.cpu, "Failed to get device for CPU0\n");
> -- 
> 1.9.1

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1388994 — Re: [PATCH] cpufreq: st: enable selective initialization based on the platform

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-04-27 14:50 +0200
SubjectRe: [PATCH] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsx4J-1jL-17@gated-at.bofh.it>
In reply to#1388933

On 27/04/16 12:47, Viresh Kumar wrote:
> On 27-04-16, 12:40, Sudeep Holla wrote:
>> The sti-cpufreq does unconditional registration of the cpufreq-dt driver
>> which causes issue on an multi-platform build. For example, on Vexpress
>> TC2 platform, we get the following error on boot:
>>
>> cpu cpu0: OPP-v2 not supported
>> cpu cpu0: Not doing voltage scaling
>> cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
>> 	for cpu:0, -19
>> cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
>> ...
>> arm_big_little: bL_cpufreq_register: Failed registering platform driver:
>> 		vexpress-spc, err: -17
>>
>> The actual driver fails to initialise as cpufreq-dt is probed
>> successfully, which is incorrect. This issue can happen to any platform
>> not using cpufreq-dt in a multi-platform build.
>>
>> This patch adds a check to do selective initialization of the driver.
>>
>> Cc: Lee Jones <lee.jones@linaro.org>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: linux-pm@vger.kernel.org
>> Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>   drivers/cpufreq/sti-cpufreq.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
>> index a9c659f58974..5fce58712a97 100644
>> --- a/drivers/cpufreq/sti-cpufreq.c
>> +++ b/drivers/cpufreq/sti-cpufreq.c
>> @@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
>>   {
>>   	int ret;
>>
>> +	if ((!of_machine_is_compatible("st,stih407-b2120")) &&
>> +		(!of_machine_is_compatible("st,stih407")))
>
> Isn't just testing this for stih407 enough? instead of two ?
>

Yes that should be sufficient but it would be good if Lee confirms the
same., just played safe :)

-- 
Regards,
Sudeep

[toc] | [prev] | [next] | [standalone]


#1389305 — Re: [PATCH] cpufreq: st: enable selective initialization based on the platform

FromLee Jones <lee.jones@linaro.org>
Date2016-04-27 18:10 +0200
SubjectRe: [PATCH] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsAci-3X0-9@gated-at.bofh.it>
In reply to#1388929
On Wed, 27 Apr 2016, Sudeep Holla wrote:

> The sti-cpufreq does unconditional registration of the cpufreq-dt driver
> which causes issue on an multi-platform build. For example, on Vexpress
> TC2 platform, we get the following error on boot:
> 
> cpu cpu0: OPP-v2 not supported
> cpu cpu0: Not doing voltage scaling
> cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
> 	for cpu:0, -19
> cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
> ...
> arm_big_little: bL_cpufreq_register: Failed registering platform driver:
> 		vexpress-spc, err: -17
> 
> The actual driver fails to initialise as cpufreq-dt is probed
> successfully, which is incorrect. This issue can happen to any platform
> not using cpufreq-dt in a multi-platform build.

Ah yes.  One of the pitfalls of not requiring platform registration.

> This patch adds a check to do selective initialization of the driver.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/sti-cpufreq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
> index a9c659f58974..5fce58712a97 100644
> --- a/drivers/cpufreq/sti-cpufreq.c
> +++ b/drivers/cpufreq/sti-cpufreq.c
> @@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
>  {
>  	int ret;
>  
> +	if ((!of_machine_is_compatible("st,stih407-b2120")) &&
> +		(!of_machine_is_compatible("st,stih407")))
> +		return -ENODEV;

You need to check for "st,stih407" and "st,stih410".

>  	ddata.cpu = get_cpu_device(0);
>  	if (!ddata.cpu) {
>  		dev_err(ddata.cpu, "Failed to get device for CPU0\n");

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1389309 — Re: [PATCH] cpufreq: st: enable selective initialization based on the platform

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-04-27 18:20 +0200
SubjectRe: [PATCH] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsAlX-41b-1@gated-at.bofh.it>
In reply to#1389305

On 27/04/16 17:07, Lee Jones wrote:
> On Wed, 27 Apr 2016, Sudeep Holla wrote:
>

[...]

>>
>> +	if ((!of_machine_is_compatible("st,stih407-b2120")) &&
>> +		(!of_machine_is_compatible("st,stih407")))
>> +		return -ENODEV;
>
> You need to check for "st,stih407" and "st,stih410".
>

Thanks, will fix it and post new version soon.

-- 
Regards,
Sudeep

[toc] | [prev] | [next] | [standalone]


#1389313 — [PATCH v2] cpufreq: st: enable selective initialization based on the platform

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-04-27 18:20 +0200
Subject[PATCH v2] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsAlY-41b-21@gated-at.bofh.it>
In reply to#1388929
The sti-cpufreq does unconditional registration of the cpufreq-dt driver
which causes issue on an multi-platform build. For example, on Vexpress
TC2 platform, we get the following error on boot:

cpu cpu0: OPP-v2 not supported
cpu cpu0: Not doing voltage scaling
cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
	for cpu:0, -19
cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
...
arm_big_little: bL_cpufreq_register: Failed registering platform driver:
		vexpress-spc, err: -17

The actual driver fails to initialise as cpufreq-dt is probed
successfully, which is incorrect. This issue can happen to any platform
not using cpufreq-dt in a multi-platform build.

This patch adds a check to do selective initialization of the driver.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpufreq/sti-cpufreq.c | 4 ++++
 1 file changed, 4 insertions(+)

v1->v2:
	- Updated compatible strings as per Lee's confirmation

diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
index a9c659f58974..04042038ec4b 100644
--- a/drivers/cpufreq/sti-cpufreq.c
+++ b/drivers/cpufreq/sti-cpufreq.c
@@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
 {
 	int ret;

+	if ((!of_machine_is_compatible("st,stih407")) &&
+		(!of_machine_is_compatible("st,stih410")))
+		return -ENODEV;
+
 	ddata.cpu = get_cpu_device(0);
 	if (!ddata.cpu) {
 		dev_err(ddata.cpu, "Failed to get device for CPU0\n");
--
1.9.1

[toc] | [prev] | [next] | [standalone]


#1389770 — Re: [PATCH v2] cpufreq: st: enable selective initialization based on the platform

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-28 04:20 +0200
SubjectRe: [PATCH v2] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsJIB-3C4-11@gated-at.bofh.it>
In reply to#1389313
On 27-04-16, 17:18, Sudeep Holla wrote:
> The sti-cpufreq does unconditional registration of the cpufreq-dt driver
> which causes issue on an multi-platform build. For example, on Vexpress
> TC2 platform, we get the following error on boot:
> 
> cpu cpu0: OPP-v2 not supported
> cpu cpu0: Not doing voltage scaling
> cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
> 	for cpu:0, -19
> cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
> ...
> arm_big_little: bL_cpufreq_register: Failed registering platform driver:
> 		vexpress-spc, err: -17
> 
> The actual driver fails to initialise as cpufreq-dt is probed
> successfully, which is incorrect. This issue can happen to any platform
> not using cpufreq-dt in a multi-platform build.
> 
> This patch adds a check to do selective initialization of the driver.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/sti-cpufreq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> v1->v2:
> 	- Updated compatible strings as per Lee's confirmation
> 
> diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
> index a9c659f58974..04042038ec4b 100644
> --- a/drivers/cpufreq/sti-cpufreq.c
> +++ b/drivers/cpufreq/sti-cpufreq.c
> @@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
>  {
>  	int ret;
> 
> +	if ((!of_machine_is_compatible("st,stih407")) &&
> +		(!of_machine_is_compatible("st,stih410")))
> +		return -ENODEV;
> +
>  	ddata.cpu = get_cpu_device(0);
>  	if (!ddata.cpu) {
>  		dev_err(ddata.cpu, "Failed to get device for CPU0\n");

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1389816 — Re: [PATCH v2] cpufreq: st: enable selective initialization based on the platform

FromLee Jones <lee.jones@linaro.org>
Date2016-04-28 09:20 +0200
SubjectRe: [PATCH v2] cpufreq: st: enable selective initialization based on the platform
Message-ID<rsOoV-7xj-5@gated-at.bofh.it>
In reply to#1389313
On Wed, 27 Apr 2016, Sudeep Holla wrote:

> The sti-cpufreq does unconditional registration of the cpufreq-dt driver
> which causes issue on an multi-platform build. For example, on Vexpress
> TC2 platform, we get the following error on boot:
> 
> cpu cpu0: OPP-v2 not supported
> cpu cpu0: Not doing voltage scaling
> cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
> 	for cpu:0, -19
> cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
> ...
> arm_big_little: bL_cpufreq_register: Failed registering platform driver:
> 		vexpress-spc, err: -17
> 
> The actual driver fails to initialise as cpufreq-dt is probed
> successfully, which is incorrect. This issue can happen to any platform
> not using cpufreq-dt in a multi-platform build.
> 
> This patch adds a check to do selective initialization of the driver.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/sti-cpufreq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> v1->v2:
> 	- Updated compatible strings as per Lee's confirmation

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
> index a9c659f58974..04042038ec4b 100644
> --- a/drivers/cpufreq/sti-cpufreq.c
> +++ b/drivers/cpufreq/sti-cpufreq.c
> @@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
>  {
>  	int ret;
> 
> +	if ((!of_machine_is_compatible("st,stih407")) &&
> +		(!of_machine_is_compatible("st,stih410")))
> +		return -ENODEV;
> +
>  	ddata.cpu = get_cpu_device(0);
>  	if (!ddata.cpu) {
>  		dev_err(ddata.cpu, "Failed to get device for CPU0\n");

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web