diff mbox series

[V2,1/2] cpufreq: scmi: Don't validate the frequency table twice

Message ID 442ecfd0a5bddf32c912c449b072d8a0139318fc.1522749887.git.viresh.kumar@linaro.org
State Accepted
Commit d983af9864b273e2fa19f564e6fa80d67638e539
Headers show
Series cpufreq: Stop validating cpufreq table in drivers | expand

Commit Message

Viresh Kumar April 3, 2018, 10:07 a.m. UTC
The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from scmi driver.

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

---
 drivers/cpufreq/scmi-cpufreq.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.15.0.194.g9af6a3dea062

Comments

Sudeep Holla April 4, 2018, 9:48 a.m. UTC | #1
(I have exact patches ready :), was on vacation)

On 03/04/18 11:07, Viresh Kumar wrote:
> The cpufreq core is already validating the CPU frequency table after

> calling the ->init() callback of the cpufreq drivers and the drivers

> don't need to do the same anymore. Though they need to set the

> policy->freq_table field directly from the ->init() callback now.

> 

> Stop validating the frequency table from scmi driver.

> 

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


Acked-by: Sudeep Holla <sudeep.holla@arm.com>


-- 
Regards,
Sudeep
Rafael J. Wysocki April 9, 2018, 11:39 a.m. UTC | #2
On Wed, Apr 4, 2018 at 11:48 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>

> (I have exact patches ready :), was on vacation)


What am I expected to do with this one?

> On 03/04/18 11:07, Viresh Kumar wrote:

>> The cpufreq core is already validating the CPU frequency table after

>> calling the ->init() callback of the cpufreq drivers and the drivers

>> don't need to do the same anymore. Though they need to set the

>> policy->freq_table field directly from the ->init() callback now.

>>

>> Stop validating the frequency table from scmi driver.

>>

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

>

> Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Sudeep Holla April 9, 2018, 1:20 p.m. UTC | #3
On 09/04/18 12:39, Rafael J. Wysocki wrote:
> On Wed, Apr 4, 2018 at 11:48 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:

>>

>> (I have exact patches ready :), was on vacation)

> 

> What am I expected to do with this one?

> 


Sorry for not being explicit. I assumed you can pick up this patch along
with 2/2 removing the function, that's why I just acked the patch. The
SCMI code is now merged.

>> On 03/04/18 11:07, Viresh Kumar wrote:

>>> The cpufreq core is already validating the CPU frequency table after

>>> calling the ->init() callback of the cpufreq drivers and the drivers

>>> don't need to do the same anymore. Though they need to set the

>>> policy->freq_table field directly from the ->init() callback now.

>>>

>>> Stop validating the frequency table from scmi driver.

>>>

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

>>

>> Acked-by: Sudeep Holla <sudeep.holla@arm.com>


-- 
Regards,
Sudeep
Rafael J. Wysocki April 10, 2018, 6:42 a.m. UTC | #4
On Mon, Apr 9, 2018 at 3:20 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>

>

> On 09/04/18 12:39, Rafael J. Wysocki wrote:

>> On Wed, Apr 4, 2018 at 11:48 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:

>>>

>>> (I have exact patches ready :), was on vacation)

>>

>> What am I expected to do with this one?

>>

>

> Sorry for not being explicit. I assumed you can pick up this patch along

> with 2/2 removing the function, that's why I just acked the patch. The

> SCMI code is now merged.


OK, applied now, thanks!
diff mbox series

Patch

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index 959a1dbe3835..b4dbc77459b6 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -159,13 +159,7 @@  static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 	priv->domain_id = handle->perf_ops->device_domain_id(cpu_dev);
 
 	policy->driver_data = priv;
-
-	ret = cpufreq_table_validate_and_show(policy, freq_table);
-	if (ret) {
-		dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__,
-			ret);
-		goto out_free_cpufreq_table;
-	}
+	policy->freq_table = freq_table;
 
 	/* SCMI allows DVFS request for any domain from any CPU */
 	policy->dvfs_possible_from_any_cpu = true;
@@ -179,8 +173,6 @@  static int scmi_cpufreq_init(struct cpufreq_policy *policy)
 	policy->fast_switch_possible = true;
 	return 0;
 
-out_free_cpufreq_table:
-	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
 out_free_priv:
 	kfree(priv);
 out_free_opp: