Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1624559 > unrolled thread
| Started by | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| First post | 2017-04-17 08:10 +0200 |
| Last post | 2017-04-24 12:50 +0200 |
| Articles | 17 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 06/17] thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state() Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 09/17] thermal: cpu_cooling: store cpufreq policy Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 07/17] thermal: cpu_cooling: use cpufreq_policy to register cooling device Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 04/17] thermal: cpu_cooling: replace cool_dev with cdev Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 10/17] thermal: cpu_cooling: OPPs are registered for all CPUs Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 02/17] thermal: cpu_cooling: rearrange globals Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
[PATCH V2 12/17] thermal: cpu_cooling: merge frequency and power tables Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-17 08:10 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Eduardo Valentin <edubezval@gmail.com> - 2017-04-17 19:40 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Eduardo Valentin <edubezval@gmail.com> - 2017-04-17 20:00 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Lukasz Luba <lukasz.luba@arm.com> - 2017-04-18 09:30 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-18 12:40 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Lukasz Luba <lukasz.luba@arm.com> - 2017-04-18 16:50 +0200
[PATCH] thermal: fix cpu cooling initialization Lukasz Luba <lukasz.luba@arm.com> - 2017-04-18 17:00 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-19 07:30 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Viresh Kumar <viresh.kumar@linaro.org> - 2017-04-24 12:50 +0200
Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Lukasz Luba <lukasz.luba@arm.com> - 2017-04-24 12:50 +0200
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <tx81j-5DY-3@gated-at.bofh.it> |
Hi Guys, The cpu_cooling driver is designed to use CPU frequency scaling to avoid high thermal states for a platform. But it wasn't glued really well with cpufreq core. This series tries to improve interactions between cpufreq core and cpu_cooling driver and does some fixes/cleanups to the cpu_cooling driver. I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have pushed them for 0-day build bot and kernel CI testing as well. We should know if something is broken with these. @Javi: It would be good if you can give them a test, specially because of your work on the "power" specific bits in the driver. Pushed here as well: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling V1->V2: - Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo). -- viresh Viresh Kumar (17): thermal: cpu_cooling: Avoid accessing potentially freed structures thermal: cpu_cooling: rearrange globals thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdev thermal: cpu_cooling: replace cool_dev with cdev thermal: cpu_cooling: remove cpufreq_cooling_get_level() thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state() thermal: cpu_cooling: use cpufreq_policy to register cooling device cpufreq: create cpufreq_table_count_valid_entries() thermal: cpu_cooling: store cpufreq policy thermal: cpu_cooling: OPPs are registered for all CPUs thermal: cpu_cooling: get rid of 'allowed_cpus' thermal: cpu_cooling: merge frequency and power tables thermal: cpu_cooling: create structure for idle time stats thermal: cpu_cooling: get_level() can't fail thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdev thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power() thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device drivers/cpufreq/arm_big_little.c | 2 +- drivers/cpufreq/cpufreq-dt.c | 2 +- drivers/cpufreq/cpufreq_stats.c | 13 +- drivers/cpufreq/dbx500-cpufreq.c | 2 +- drivers/cpufreq/mt8173-cpufreq.c | 4 +- drivers/cpufreq/qoriq-cpufreq.c | 3 +- drivers/thermal/cpu_cooling.c | 579 ++++++++------------- drivers/thermal/imx_thermal.c | 22 +- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 22 +- include/linux/cpu_cooling.h | 32 +- include/linux/cpufreq.h | 14 + 11 files changed, 297 insertions(+), 398 deletions(-) -- 2.12.0.432.g71c3a4f4ba37
[toc] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 06/17] thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state() |
| Message-ID | <tx81l-5DY-53@gated-at.bofh.it> |
| In reply to | #1624559 |
'cpu' is used at only one place and there is no need to keep a separate
variable for it.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 1f4b6a719d05..002b48dc6bea 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -456,7 +456,6 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
unsigned long state)
{
struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
- unsigned int cpu = cpumask_any(&cpufreq_cdev->allowed_cpus);
unsigned int clip_freq;
/* Request state should be less than max_level */
@@ -471,7 +470,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
cpufreq_cdev->cpufreq_state = state;
cpufreq_cdev->clipped_freq = clip_freq;
- cpufreq_update_policy(cpu);
+ cpufreq_update_policy(cpumask_any(&cpufreq_cdev->allowed_cpus));
return 0;
}
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 09/17] thermal: cpu_cooling: store cpufreq policy |
| Message-ID | <tx81l-5DY-55@gated-at.bofh.it> |
| In reply to | #1624559 |
The cpufreq policy can be used by the cpu_cooling driver, lets store it
in the cpufreq_cooling_device structure.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 48fc5447bbf6..bc018c628c93 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -67,6 +67,7 @@ struct power_table {
* registered.
* @cdev: thermal_cooling_device pointer to keep track of the
* registered cooling device.
+ * @policy: cpufreq policy.
* @cpufreq_state: integer value representing the current state of cpufreq
* cooling devices.
* @clipped_freq: integer value representing the absolute value of the clipped
@@ -91,6 +92,7 @@ struct power_table {
struct cpufreq_cooling_device {
int id;
struct thermal_cooling_device *cdev;
+ struct cpufreq_policy *policy;
unsigned int cpufreq_state;
unsigned int clipped_freq;
unsigned int max_level;
@@ -827,6 +829,7 @@ __cpufreq_cooling_register(struct device_node *np,
cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0];
cpufreq_cdev->cdev = cdev;
+ cpufreq_cdev->policy = policy;
mutex_lock(&cooling_list_lock);
/* Register the notifier for first cpufreq cooling device */
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 07/17] thermal: cpu_cooling: use cpufreq_policy to register cooling device |
| Message-ID | <tx81l-5DY-57@gated-at.bofh.it> |
| In reply to | #1624559 |
The CPU cooling driver uses the cpufreq policy, to get clip_cpus, the
frequency table, etc. Most of the callers of CPU cooling driver's
registration routines have the cpufreq policy with them, but they only
pass the policy->related_cpus cpumask. The __cpufreq_cooling_register()
routine then gets the policy by itself and uses it.
It would be much better if the callers can pass the policy instead
directly. This also fixes a basic design flaw, where the policy can be
freed while the CPU cooling driver is still active.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/arm_big_little.c | 2 +-
drivers/cpufreq/cpufreq-dt.c | 2 +-
drivers/cpufreq/dbx500-cpufreq.c | 2 +-
drivers/cpufreq/mt8173-cpufreq.c | 4 +-
drivers/cpufreq/qoriq-cpufreq.c | 3 +-
drivers/thermal/cpu_cooling.c | 60 ++++++++--------------
drivers/thermal/imx_thermal.c | 22 ++++++--
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 22 +++++---
include/linux/cpu_cooling.h | 26 +++++-----
9 files changed, 71 insertions(+), 72 deletions(-)
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 418042201e6d..ea6d62547b10 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -540,7 +540,7 @@ static void bL_cpufreq_ready(struct cpufreq_policy *policy)
&power_coefficient);
cdev[cur_cluster] = of_cpufreq_power_cooling_register(np,
- policy->related_cpus, power_coefficient, NULL);
+ policy, power_coefficient, NULL);
if (IS_ERR(cdev[cur_cluster])) {
dev_err(cpu_dev,
"running cpufreq without cooling device: %ld\n",
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index c943787d761e..fef3c2160691 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -326,7 +326,7 @@ static void cpufreq_ready(struct cpufreq_policy *policy)
&power_coefficient);
priv->cdev = of_cpufreq_power_cooling_register(np,
- policy->related_cpus, power_coefficient, NULL);
+ policy, power_coefficient, NULL);
if (IS_ERR(priv->cdev)) {
dev_err(priv->cpu_dev,
"running cpufreq without cooling device: %ld\n",
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 3575b82210ba..4ee0431579c1 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -43,7 +43,7 @@ static int dbx500_cpufreq_exit(struct cpufreq_policy *policy)
static void dbx500_cpufreq_ready(struct cpufreq_policy *policy)
{
- cdev = cpufreq_cooling_register(policy->cpus);
+ cdev = cpufreq_cooling_register(policy);
if (IS_ERR(cdev))
pr_err("Failed to register cooling device %ld\n", PTR_ERR(cdev));
else
diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c
index fd1886faf33a..f9f00fb4bc3a 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mt8173-cpufreq.c
@@ -320,9 +320,7 @@ static void mtk_cpufreq_ready(struct cpufreq_policy *policy)
of_property_read_u32(np, DYNAMIC_POWER, &capacitance);
info->cdev = of_cpufreq_power_cooling_register(np,
- policy->related_cpus,
- capacitance,
- NULL);
+ policy, capacitance, NULL);
if (IS_ERR(info->cdev)) {
dev_err(info->cpu_dev,
diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
index e2ea433a5f9c..4ada55b8856e 100644
--- a/drivers/cpufreq/qoriq-cpufreq.c
+++ b/drivers/cpufreq/qoriq-cpufreq.c
@@ -278,8 +278,7 @@ static void qoriq_cpufreq_ready(struct cpufreq_policy *policy)
struct device_node *np = of_get_cpu_node(policy->cpu, NULL);
if (of_find_property(np, "#cooling-cells", NULL)) {
- cpud->cdev = of_cpufreq_cooling_register(np,
- policy->related_cpus);
+ cpud->cdev = of_cpufreq_cooling_register(np, policy);
if (IS_ERR(cpud->cdev) && PTR_ERR(cpud->cdev) != -ENOSYS) {
pr_err("cpu%d is not running as cooling device: %ld\n",
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 002b48dc6bea..23b0d3cf853a 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -717,7 +717,7 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
/**
* __cpufreq_cooling_register - helper function to create cpufreq cooling device
* @np: a valid struct device_node to the cooling device device tree node
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen.
+ * @policy: cpufreq policy
* Normally this should be same as cpufreq policy->related_cpus.
* @capacitance: dynamic power coefficient for these cpus
* @plat_static_func: function to calculate the static power consumed by these
@@ -733,45 +733,29 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
*/
static struct thermal_cooling_device *
__cpufreq_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus, u32 capacitance,
+ struct cpufreq_policy *policy, u32 capacitance,
get_static_t plat_static_func)
{
- struct cpufreq_policy *policy;
struct thermal_cooling_device *cdev;
struct cpufreq_cooling_device *cpufreq_cdev;
char dev_name[THERMAL_NAME_LENGTH];
struct cpufreq_frequency_table *pos, *table;
- cpumask_var_t temp_mask;
unsigned int freq, i, num_cpus;
int ret;
struct thermal_cooling_device_ops *cooling_ops;
bool first;
- if (!alloc_cpumask_var(&temp_mask, GFP_KERNEL))
- return ERR_PTR(-ENOMEM);
-
- cpumask_and(temp_mask, clip_cpus, cpu_online_mask);
- policy = cpufreq_cpu_get(cpumask_first(temp_mask));
- if (!policy) {
- pr_debug("%s: CPUFreq policy not found\n", __func__);
- cdev = ERR_PTR(-EPROBE_DEFER);
- goto free_cpumask;
- }
-
table = policy->freq_table;
if (!table) {
pr_debug("%s: CPUFreq table not found\n", __func__);
- cdev = ERR_PTR(-ENODEV);
- goto put_policy;
+ return ERR_PTR(-ENODEV);
}
cpufreq_cdev = kzalloc(sizeof(*cpufreq_cdev), GFP_KERNEL);
- if (!cpufreq_cdev) {
- cdev = ERR_PTR(-ENOMEM);
- goto put_policy;
- }
+ if (!cpufreq_cdev)
+ return ERR_PTR(-ENOMEM);
- num_cpus = cpumask_weight(clip_cpus);
+ num_cpus = cpumask_weight(policy->related_cpus);
cpufreq_cdev->time_in_idle = kcalloc(num_cpus,
sizeof(*cpufreq_cdev->time_in_idle),
GFP_KERNEL);
@@ -802,7 +786,7 @@ __cpufreq_cooling_register(struct device_node *np,
/* max_level is an index, not a counter */
cpufreq_cdev->max_level--;
- cpumask_copy(&cpufreq_cdev->allowed_cpus, clip_cpus);
+ cpumask_copy(&cpufreq_cdev->allowed_cpus, policy->related_cpus);
if (capacitance) {
cpufreq_cdev->plat_get_static_power = plat_static_func;
@@ -858,7 +842,7 @@ __cpufreq_cooling_register(struct device_node *np,
cpufreq_register_notifier(&thermal_cpufreq_notifier_block,
CPUFREQ_POLICY_NOTIFIER);
- goto put_policy;
+ return cdev;
remove_ida:
ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id);
@@ -872,16 +856,12 @@ __cpufreq_cooling_register(struct device_node *np,
kfree(cpufreq_cdev->time_in_idle);
free_cdev:
kfree(cpufreq_cdev);
-put_policy:
- cpufreq_cpu_put(policy);
-free_cpumask:
- free_cpumask_var(temp_mask);
return cdev;
}
/**
* cpufreq_cooling_register - function to create cpufreq cooling device.
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen.
+ * @policy: cpufreq policy
*
* This interface function registers the cpufreq cooling device with the name
* "thermal-cpufreq-%x". This api can support multiple instances of cpufreq
@@ -891,16 +871,16 @@ __cpufreq_cooling_register(struct device_node *np,
* on failure, it returns a corresponding ERR_PTR().
*/
struct thermal_cooling_device *
-cpufreq_cooling_register(const struct cpumask *clip_cpus)
+cpufreq_cooling_register(struct cpufreq_policy *policy)
{
- return __cpufreq_cooling_register(NULL, clip_cpus, 0, NULL);
+ return __cpufreq_cooling_register(NULL, policy, 0, NULL);
}
EXPORT_SYMBOL_GPL(cpufreq_cooling_register);
/**
* of_cpufreq_cooling_register - function to create cpufreq cooling device.
* @np: a valid struct device_node to the cooling device device tree node
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen.
+ * @policy: cpufreq policy
*
* This interface function registers the cpufreq cooling device with the name
* "thermal-cpufreq-%x". This api can support multiple instances of cpufreq
@@ -912,18 +892,18 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_register);
*/
struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus)
+ struct cpufreq_policy *policy)
{
if (!np)
return ERR_PTR(-EINVAL);
- return __cpufreq_cooling_register(np, clip_cpus, 0, NULL);
+ return __cpufreq_cooling_register(np, policy, 0, NULL);
}
EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register);
/**
* cpufreq_power_cooling_register() - create cpufreq cooling device with power extensions
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen
+ * @policy: cpufreq policy
* @capacitance: dynamic power coefficient for these cpus
* @plat_static_func: function to calculate the static power consumed by these
* cpus (optional)
@@ -943,10 +923,10 @@ EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register);
* on failure, it returns a corresponding ERR_PTR().
*/
struct thermal_cooling_device *
-cpufreq_power_cooling_register(const struct cpumask *clip_cpus, u32 capacitance,
+cpufreq_power_cooling_register(struct cpufreq_policy *policy, u32 capacitance,
get_static_t plat_static_func)
{
- return __cpufreq_cooling_register(NULL, clip_cpus, capacitance,
+ return __cpufreq_cooling_register(NULL, policy, capacitance,
plat_static_func);
}
EXPORT_SYMBOL(cpufreq_power_cooling_register);
@@ -954,7 +934,7 @@ EXPORT_SYMBOL(cpufreq_power_cooling_register);
/**
* of_cpufreq_power_cooling_register() - create cpufreq cooling device with power extensions
* @np: a valid struct device_node to the cooling device device tree node
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen
+ * @policy: cpufreq policy
* @capacitance: dynamic power coefficient for these cpus
* @plat_static_func: function to calculate the static power consumed by these
* cpus (optional)
@@ -976,14 +956,14 @@ EXPORT_SYMBOL(cpufreq_power_cooling_register);
*/
struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus,
+ struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func)
{
if (!np)
return ERR_PTR(-EINVAL);
- return __cpufreq_cooling_register(np, clip_cpus, capacitance,
+ return __cpufreq_cooling_register(np, policy, capacitance,
plat_static_func);
}
EXPORT_SYMBOL(of_cpufreq_power_cooling_register);
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index fb648a45754e..f7ec39f46ee4 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -8,6 +8,7 @@
*/
#include <linux/clk.h>
+#include <linux/cpufreq.h>
#include <linux/cpu_cooling.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -88,6 +89,7 @@ static struct thermal_soc_data thermal_imx6sx_data = {
};
struct imx_thermal_data {
+ struct cpufreq_policy *policy;
struct thermal_zone_device *tz;
struct thermal_cooling_device *cdev;
enum thermal_device_mode mode;
@@ -525,13 +527,18 @@ static int imx_thermal_probe(struct platform_device *pdev)
regmap_write(map, MISC0 + REG_SET, MISC0_REFTOP_SELBIASOFF);
regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_POWER_DOWN);
- data->cdev = cpufreq_cooling_register(cpu_present_mask);
+ data->policy = cpufreq_cpu_get(0);
+ if (!data->policy) {
+ pr_debug("%s: CPUFreq policy not found\n", __func__);
+ return -EPROBE_DEFER;
+ }
+
+ data->cdev = cpufreq_cooling_register(data->policy);
if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev);
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev,
- "failed to register cpufreq cooling device: %d\n",
- ret);
+ dev_err(&pdev->dev,
+ "failed to register cpufreq cooling device: %d\n", ret);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -542,6 +549,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"failed to get thermal clk: %d\n", ret);
cpufreq_cooling_unregister(data->cdev);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -556,6 +564,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "failed to enable thermal clk: %d\n", ret);
cpufreq_cooling_unregister(data->cdev);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -571,6 +580,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
"failed to register thermal zone device %d\n", ret);
clk_disable_unprepare(data->thermal_clk);
cpufreq_cooling_unregister(data->cdev);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -599,6 +609,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
clk_disable_unprepare(data->thermal_clk);
thermal_zone_device_unregister(data->tz);
cpufreq_cooling_unregister(data->cdev);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -620,6 +631,7 @@ static int imx_thermal_remove(struct platform_device *pdev)
thermal_zone_device_unregister(data->tz);
cpufreq_cooling_unregister(data->cdev);
+ cpufreq_cpu_put(data->policy);
return 0;
}
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0586bd0f2bab..cfc851d76d4b 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -28,6 +28,7 @@
#include <linux/kernel.h>
#include <linux/workqueue.h>
#include <linux/thermal.h>
+#include <linux/cpufreq.h>
#include <linux/cpumask.h>
#include <linux/cpu_cooling.h>
#include <linux/of.h>
@@ -37,6 +38,7 @@
/* common data structures */
struct ti_thermal_data {
+ struct cpufreq_policy *policy;
struct thermal_zone_device *ti_thermal;
struct thermal_zone_device *pcb_tz;
struct thermal_cooling_device *cool_dev;
@@ -395,15 +397,19 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
if (!data)
return -EINVAL;
+ data->policy = cpufreq_cpu_get(0);
+ if (!data->policy) {
+ pr_debug("%s: CPUFreq policy not found\n", __func__);
+ return -EPROBE_DEFER;
+ }
+
/* Register cooling device */
- data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
+ data->cool_dev = cpufreq_cooling_register(data->policy);
if (IS_ERR(data->cool_dev)) {
int ret = PTR_ERR(data->cool_dev);
-
- if (ret != -EPROBE_DEFER)
- dev_err(bgp->dev,
- "Failed to register cpu cooling device %d\n",
- ret);
+ dev_err(bgp->dev, "Failed to register cpu cooling device %d\n",
+ ret);
+ cpufreq_cpu_put(data->policy);
return ret;
}
@@ -418,8 +424,10 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
data = ti_bandgap_get_sensor_data(bgp, id);
- if (data)
+ if (data) {
cpufreq_cooling_unregister(data->cool_dev);
+ cpufreq_cpu_put(data->policy);
+ }
return 0;
}
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index 96c5e4c2f9c8..d4292ebc5c8b 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -28,47 +28,49 @@
#include <linux/thermal.h>
#include <linux/cpumask.h>
+struct cpufreq_policy;
+
typedef int (*get_static_t)(cpumask_t *cpumask, int interval,
unsigned long voltage, u32 *power);
#ifdef CONFIG_CPU_THERMAL
/**
* cpufreq_cooling_register - function to create cpufreq cooling device.
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen
+ * @policy: cpufreq policy.
*/
struct thermal_cooling_device *
-cpufreq_cooling_register(const struct cpumask *clip_cpus);
+cpufreq_cooling_register(struct cpufreq_policy *policy);
struct thermal_cooling_device *
-cpufreq_power_cooling_register(const struct cpumask *clip_cpus,
+cpufreq_power_cooling_register(struct cpufreq_policy *policy,
u32 capacitance, get_static_t plat_static_func);
/**
* of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
* @np: a valid struct device_node to the cooling device device tree node.
- * @clip_cpus: cpumask of cpus where the frequency constraints will happen
+ * @policy: cpufreq policy.
*/
#ifdef CONFIG_THERMAL_OF
struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus);
+ struct cpufreq_policy *policy);
struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus,
+ struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func);
#else
static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus)
+ struct cpufreq_policy *policy)
{
return ERR_PTR(-ENOSYS);
}
static inline struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus,
+ struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func)
{
@@ -84,12 +86,12 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
#else /* !CONFIG_CPU_THERMAL */
static inline struct thermal_cooling_device *
-cpufreq_cooling_register(const struct cpumask *clip_cpus)
+cpufreq_cooling_register(struct cpufreq_policy *policy)
{
return ERR_PTR(-ENOSYS);
}
static inline struct thermal_cooling_device *
-cpufreq_power_cooling_register(const struct cpumask *clip_cpus,
+cpufreq_power_cooling_register(struct cpufreq_policy *policy,
u32 capacitance, get_static_t plat_static_func)
{
return NULL;
@@ -97,14 +99,14 @@ cpufreq_power_cooling_register(const struct cpumask *clip_cpus,
static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus)
+ struct cpufreq_policy *policy)
{
return ERR_PTR(-ENOSYS);
}
static inline struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
- const struct cpumask *clip_cpus,
+ struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func)
{
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 04/17] thermal: cpu_cooling: replace cool_dev with cdev |
| Message-ID | <tx81l-5DY-63@gated-at.bofh.it> |
| In reply to | #1624559 |
Objects of "struct thermal_cooling_device" are named a bit
inconsistently. Lets use cdev everywhere.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 80a46a80817b..f1e784c22c5a 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -65,7 +65,7 @@ struct power_table {
* struct cpufreq_cooling_device - data for cooling device with cpufreq
* @id: unique integer value corresponding to each cpufreq_cooling_device
* registered.
- * @cool_dev: thermal_cooling_device pointer to keep track of the
+ * @cdev: thermal_cooling_device pointer to keep track of the
* registered cooling device.
* @cpufreq_state: integer value representing the current state of cpufreq
* cooling devices.
@@ -90,7 +90,7 @@ struct power_table {
*/
struct cpufreq_cooling_device {
int id;
- struct thermal_cooling_device *cool_dev;
+ struct thermal_cooling_device *cdev;
unsigned int cpufreq_state;
unsigned int clipped_freq;
unsigned int max_level;
@@ -242,7 +242,7 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_cdev,
for_each_cpu(cpu, &cpufreq_cdev->allowed_cpus) {
dev = get_cpu_device(cpu);
if (!dev) {
- dev_warn(&cpufreq_cdev->cool_dev->device,
+ dev_warn(&cpufreq_cdev->cdev->device,
"No cpu device for cpu %d\n", cpu);
continue;
}
@@ -769,7 +769,7 @@ __cpufreq_cooling_register(struct device_node *np,
get_static_t plat_static_func)
{
struct cpufreq_policy *policy;
- struct thermal_cooling_device *cool_dev;
+ struct thermal_cooling_device *cdev;
struct cpufreq_cooling_device *cpufreq_cdev;
char dev_name[THERMAL_NAME_LENGTH];
struct cpufreq_frequency_table *pos, *table;
@@ -786,20 +786,20 @@ __cpufreq_cooling_register(struct device_node *np,
policy = cpufreq_cpu_get(cpumask_first(temp_mask));
if (!policy) {
pr_debug("%s: CPUFreq policy not found\n", __func__);
- cool_dev = ERR_PTR(-EPROBE_DEFER);
+ cdev = ERR_PTR(-EPROBE_DEFER);
goto free_cpumask;
}
table = policy->freq_table;
if (!table) {
pr_debug("%s: CPUFreq table not found\n", __func__);
- cool_dev = ERR_PTR(-ENODEV);
+ cdev = ERR_PTR(-ENODEV);
goto put_policy;
}
cpufreq_cdev = kzalloc(sizeof(*cpufreq_cdev), GFP_KERNEL);
if (!cpufreq_cdev) {
- cool_dev = ERR_PTR(-ENOMEM);
+ cdev = ERR_PTR(-ENOMEM);
goto put_policy;
}
@@ -808,7 +808,7 @@ __cpufreq_cooling_register(struct device_node *np,
sizeof(*cpufreq_cdev->time_in_idle),
GFP_KERNEL);
if (!cpufreq_cdev->time_in_idle) {
- cool_dev = ERR_PTR(-ENOMEM);
+ cdev = ERR_PTR(-ENOMEM);
goto free_cdev;
}
@@ -816,7 +816,7 @@ __cpufreq_cooling_register(struct device_node *np,
kcalloc(num_cpus, sizeof(*cpufreq_cdev->time_in_idle_timestamp),
GFP_KERNEL);
if (!cpufreq_cdev->time_in_idle_timestamp) {
- cool_dev = ERR_PTR(-ENOMEM);
+ cdev = ERR_PTR(-ENOMEM);
goto free_time_in_idle;
}
@@ -827,7 +827,7 @@ __cpufreq_cooling_register(struct device_node *np,
cpufreq_cdev->freq_table = kmalloc(sizeof(*cpufreq_cdev->freq_table) *
cpufreq_cdev->max_level, GFP_KERNEL);
if (!cpufreq_cdev->freq_table) {
- cool_dev = ERR_PTR(-ENOMEM);
+ cdev = ERR_PTR(-ENOMEM);
goto free_time_in_idle_timestamp;
}
@@ -841,7 +841,7 @@ __cpufreq_cooling_register(struct device_node *np,
ret = build_dyn_power_table(cpufreq_cdev, capacitance);
if (ret) {
- cool_dev = ERR_PTR(ret);
+ cdev = ERR_PTR(ret);
goto free_table;
}
@@ -852,7 +852,7 @@ __cpufreq_cooling_register(struct device_node *np,
ret = ida_simple_get(&cpufreq_ida, 0, 0, GFP_KERNEL);
if (ret < 0) {
- cool_dev = ERR_PTR(ret);
+ cdev = ERR_PTR(ret);
goto free_power_table;
}
cpufreq_cdev->id = ret;
@@ -872,14 +872,13 @@ __cpufreq_cooling_register(struct device_node *np,
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
cpufreq_cdev->id);
- cool_dev = thermal_of_cooling_device_register(np, dev_name,
- cpufreq_cdev,
- cooling_ops);
- if (IS_ERR(cool_dev))
+ cdev = thermal_of_cooling_device_register(np, dev_name, cpufreq_cdev,
+ cooling_ops);
+ if (IS_ERR(cdev))
goto remove_ida;
cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0];
- cpufreq_cdev->cool_dev = cool_dev;
+ cpufreq_cdev->cdev = cdev;
mutex_lock(&cooling_list_lock);
/* Register the notifier for first cpufreq cooling device */
@@ -909,7 +908,7 @@ __cpufreq_cooling_register(struct device_node *np,
cpufreq_cpu_put(policy);
free_cpumask:
free_cpumask_var(temp_mask);
- return cool_dev;
+ return cdev;
}
/**
@@ -1047,7 +1046,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block,
CPUFREQ_POLICY_NOTIFIER);
- thermal_cooling_device_unregister(cpufreq_cdev->cool_dev);
+ thermal_cooling_device_unregister(cpufreq_cdev->cdev);
ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id);
kfree(cpufreq_cdev->dyn_power_table);
kfree(cpufreq_cdev->time_in_idle_timestamp);
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 10/17] thermal: cpu_cooling: OPPs are registered for all CPUs |
| Message-ID | <tx81l-5DY-65@gated-at.bofh.it> |
| In reply to | #1624559 |
The OPPs are registered for all CPUs of a cpufreq policy now and we
don't need to run the loop in build_dyn_power_table(). Just check for
the policy->cpu and we should be fine.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index bc018c628c93..3c6b63e7a257 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -83,7 +83,7 @@ struct power_table {
* @dyn_power_table: array of struct power_table for frequency to power
* conversion, sorted in ascending order.
* @dyn_power_table_entries: number of entries in the @dyn_power_table array
- * @cpu_dev: the first cpu_device from @allowed_cpus that has OPPs registered
+ * @cpu_dev: the cpu_device of policy->cpu.
* @plat_get_static_power: callback to calculate the static power
*
* This structure is required for keeping information of each registered
@@ -207,24 +207,20 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_cdev,
struct power_table *power_table;
struct dev_pm_opp *opp;
struct device *dev = NULL;
- int num_opps = 0, cpu, i, ret = 0;
+ int num_opps = 0, cpu = cpufreq_cdev->policy->cpu, i, ret = 0;
unsigned long freq;
- for_each_cpu(cpu, &cpufreq_cdev->allowed_cpus) {
- dev = get_cpu_device(cpu);
- if (!dev) {
- dev_warn(&cpufreq_cdev->cdev->device,
- "No cpu device for cpu %d\n", cpu);
- continue;
- }
-
- num_opps = dev_pm_opp_get_opp_count(dev);
- if (num_opps > 0)
- break;
- else if (num_opps < 0)
- return num_opps;
+ dev = get_cpu_device(cpu);
+ if (unlikely(!dev)) {
+ dev_warn(&cpufreq_cdev->cdev->device,
+ "No cpu device for cpu %d\n", cpu);
+ return -ENODEV;
}
+ num_opps = dev_pm_opp_get_opp_count(dev);
+ if (num_opps < 0)
+ return num_opps;
+
if (num_opps == 0)
return -EINVAL;
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 02/17] thermal: cpu_cooling: rearrange globals |
| Message-ID | <tx81l-5DY-59@gated-at.bofh.it> |
| In reply to | #1624559 |
Just to make it look better.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index be29489dd247..ce94aafed25d 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -105,8 +105,8 @@ struct cpufreq_cooling_device {
struct device *cpu_dev;
get_static_t plat_get_static_power;
};
-static DEFINE_IDA(cpufreq_ida);
+static DEFINE_IDA(cpufreq_ida);
static DEFINE_MUTEX(cooling_list_lock);
static LIST_HEAD(cpufreq_dev_list);
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-17 08:10 +0200 |
| Subject | [PATCH V2 12/17] thermal: cpu_cooling: merge frequency and power tables |
| Message-ID | <tx81l-5DY-39@gated-at.bofh.it> |
| In reply to | #1624559 |
The cpu_cooling driver keeps two tables:
- freq_table: table of frequencies in descending order, built from
policy->freq_table.
- power_table: table of frequencies and power in ascending order, built
from OPP table.
If the OPPs are used for the CPU device then both these tables are
actually built using the OPP core and should have the same frequency
entries. And there is no need to keep separate tables for this.
Lets merge them both.
Note that the new table is in descending order of frequencies and so the
'for' loops were required to be fixed at few places to make it work.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/thermal/cpu_cooling.c | 123 ++++++++++++++++++------------------------
1 file changed, 52 insertions(+), 71 deletions(-)
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 37a1605a4d7a..4702a9821c1e 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -49,14 +49,14 @@
*/
/**
- * struct power_table - frequency to power conversion
+ * struct freq_table - frequency table along with power entries
* @frequency: frequency in KHz
* @power: power in mW
*
* This structure is built when the cooling device registers and helps
- * in translating frequency to power and viceversa.
+ * in translating frequency to power and vice versa.
*/
-struct power_table {
+struct freq_table {
u32 frequency;
u32 power;
};
@@ -79,9 +79,6 @@ struct power_table {
* @time_in_idle: previous reading of the absolute time that this cpu was idle
* @time_in_idle_timestamp: wall time of the last invocation of
* get_cpu_idle_time_us()
- * @dyn_power_table: array of struct power_table for frequency to power
- * conversion, sorted in ascending order.
- * @dyn_power_table_entries: number of entries in the @dyn_power_table array
* @cpu_dev: the cpu_device of policy->cpu.
* @plat_get_static_power: callback to calculate the static power
*
@@ -95,13 +92,11 @@ struct cpufreq_cooling_device {
unsigned int cpufreq_state;
unsigned int clipped_freq;
unsigned int max_level;
- unsigned int *freq_table; /* In descending order */
+ struct freq_table *freq_table; /* In descending order */
struct list_head node;
u32 last_load;
u64 *time_in_idle;
u64 *time_in_idle_timestamp;
- struct power_table *dyn_power_table;
- int dyn_power_table_entries;
struct device *cpu_dev;
get_static_t plat_get_static_power;
};
@@ -125,10 +120,10 @@ static unsigned long get_level(struct cpufreq_cooling_device *cpufreq_cdev,
unsigned long level;
for (level = 0; level <= cpufreq_cdev->max_level; level++) {
- if (freq == cpufreq_cdev->freq_table[level])
+ if (freq == cpufreq_cdev->freq_table[level].frequency)
return level;
- if (freq > cpufreq_cdev->freq_table[level])
+ if (freq > cpufreq_cdev->freq_table[level].frequency)
break;
}
@@ -185,28 +180,25 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
}
/**
- * build_dyn_power_table() - create a dynamic power to frequency table
- * @cpufreq_cdev: the cpufreq cooling device in which to store the table
+ * update_freq_table() - Update the freq table with power numbers
+ * @cpufreq_cdev: the cpufreq cooling device in which to update the table
* @capacitance: dynamic power coefficient for these cpus
*
- * Build a dynamic power to frequency table for this cpu and store it
- * in @cpufreq_cdev. This table will be used in cpu_power_to_freq() and
- * cpu_freq_to_power() to convert between power and frequency
- * efficiently. Power is stored in mW, frequency in KHz. The
- * resulting table is in ascending order.
+ * Update the freq table with power numbers. This table will be used in
+ * cpu_power_to_freq() and cpu_freq_to_power() to convert between power and
+ * frequency efficiently. Power is stored in mW, frequency in KHz. The
+ * resulting table is in descending order.
*
* Return: 0 on success, -EINVAL if there are no OPPs for any CPUs,
- * -ENOMEM if we run out of memory or -EAGAIN if an OPP was
- * added/enabled while the function was executing.
+ * or -ENOMEM if we run out of memory.
*/
-static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_cdev,
- u32 capacitance)
+static int update_freq_table(struct cpufreq_cooling_device *cpufreq_cdev,
+ u32 capacitance)
{
- struct power_table *power_table;
+ struct freq_table *freq_table = cpufreq_cdev->freq_table;
struct dev_pm_opp *opp;
struct device *dev = NULL;
- int num_opps = 0, cpu = cpufreq_cdev->policy->cpu, i, ret = 0;
- unsigned long freq;
+ int num_opps = 0, cpu = cpufreq_cdev->policy->cpu, i;
dev = get_cpu_device(cpu);
if (unlikely(!dev)) {
@@ -219,25 +211,32 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_cdev,
if (num_opps < 0)
return num_opps;
- if (num_opps == 0)
+ /*
+ * The cpufreq table is also built from the OPP table and so the count
+ * should match.
+ */
+ if (num_opps != cpufreq_cdev->max_level + 1) {
+ dev_warn(dev, "Number of OPPs not matching with max_levels\n");
return -EINVAL;
+ }
- power_table = kcalloc(num_opps, sizeof(*power_table), GFP_KERNEL);
- if (!power_table)
- return -ENOMEM;
-
- for (freq = 0, i = 0;
- opp = dev_pm_opp_find_freq_ceil(dev, &freq), !IS_ERR(opp);
- freq++, i++) {
- u32 freq_mhz, voltage_mv;
+ for (i = 0; i < cpufreq_cdev->max_level; i++) {
+ unsigned long freq = freq_table[i].frequency * 1000;
+ u32 freq_mhz = freq_table[i].frequency / 1000;
u64 power;
+ u32 voltage_mv;
- if (i >= num_opps) {
- ret = -EAGAIN;
- goto free_power_table;
+ /*
+ * Find ceil frequency as 'freq' may be slightly lower than OPP
+ * freq due to truncation while converting to kHz.
+ */
+ opp = dev_pm_opp_find_freq_ceil(dev, &freq);
+ if (IS_ERR(opp)) {
+ dev_err(dev, "failed to get opp for %lu frequency\n",
+ freq);
+ return -EINVAL;
}
- freq_mhz = freq / 1000000;
voltage_mv = dev_pm_opp_get_voltage(opp) / 1000;
dev_pm_opp_put(opp);
@@ -248,54 +247,39 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_cdev,
power = (u64)capacitance * freq_mhz * voltage_mv * voltage_mv;
do_div(power, 1000000000);
- /* frequency is stored in power_table in KHz */
- power_table[i].frequency = freq / 1000;
-
/* power is stored in mW */
- power_table[i].power = power;
- }
-
- if (i != num_opps) {
- ret = PTR_ERR(opp);
- goto free_power_table;
+ freq_table[i].power = power;
}
cpufreq_cdev->cpu_dev = dev;
- cpufreq_cdev->dyn_power_table = power_table;
- cpufreq_cdev->dyn_power_table_entries = i;
return 0;
-
-free_power_table:
- kfree(power_table);
-
- return ret;
}
static u32 cpu_freq_to_power(struct cpufreq_cooling_device *cpufreq_cdev,
u32 freq)
{
int i;
- struct power_table *pt = cpufreq_cdev->dyn_power_table;
+ struct freq_table *freq_table = cpufreq_cdev->freq_table;
- for (i = 1; i < cpufreq_cdev->dyn_power_table_entries; i++)
- if (freq < pt[i].frequency)
+ for (i = 1; i < cpufreq_cdev->max_level; i++)
+ if (freq > freq_table[i].frequency)
break;
- return pt[i - 1].power;
+ return freq_table[i - 1].power;
}
static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev,
u32 power)
{
int i;
- struct power_table *pt = cpufreq_cdev->dyn_power_table;
+ struct freq_table *freq_table = cpufreq_cdev->freq_table;
- for (i = 1; i < cpufreq_cdev->dyn_power_table_entries; i++)
- if (power < pt[i].power)
+ for (i = 1; i < cpufreq_cdev->max_level; i++)
+ if (power > freq_table[i].power)
break;
- return pt[i - 1].frequency;
+ return freq_table[i - 1].frequency;
}
/**
@@ -462,7 +446,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
if (cpufreq_cdev->cpufreq_state == state)
return 0;
- clip_freq = cpufreq_cdev->freq_table[state];
+ clip_freq = cpufreq_cdev->freq_table[state].frequency;
cpufreq_cdev->cpufreq_state = state;
cpufreq_cdev->clipped_freq = clip_freq;
@@ -575,7 +559,7 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
num_cpus = cpumask_weight(cpufreq_cdev->policy->cpus);
- freq = cpufreq_cdev->freq_table[state];
+ freq = cpufreq_cdev->freq_table[state].frequency;
if (!freq)
return -EINVAL;
@@ -750,7 +734,7 @@ __cpufreq_cooling_register(struct device_node *np,
if (capacitance) {
cpufreq_cdev->plat_get_static_power = plat_static_func;
- ret = build_dyn_power_table(cpufreq_cdev, capacitance);
+ ret = update_freq_table(cpufreq_cdev, capacitance);
if (ret) {
cdev = ERR_PTR(ret);
goto free_table;
@@ -764,14 +748,14 @@ __cpufreq_cooling_register(struct device_node *np,
ret = ida_simple_get(&cpufreq_ida, 0, 0, GFP_KERNEL);
if (ret < 0) {
cdev = ERR_PTR(ret);
- goto free_power_table;
+ goto free_table;
}
cpufreq_cdev->id = ret;
/* Fill freq-table in descending order of frequencies */
for (i = 0, freq = -1; i <= cpufreq_cdev->max_level; i++) {
freq = find_next_max(policy->freq_table, freq);
- cpufreq_cdev->freq_table[i] = freq;
+ cpufreq_cdev->freq_table[i].frequency = freq;
/* Warn for duplicate entries */
if (!freq)
@@ -788,7 +772,7 @@ __cpufreq_cooling_register(struct device_node *np,
if (IS_ERR(cdev))
goto remove_ida;
- cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0];
+ cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0].frequency;
cpufreq_cdev->cdev = cdev;
cpufreq_cdev->policy = policy;
@@ -806,8 +790,6 @@ __cpufreq_cooling_register(struct device_node *np,
remove_ida:
ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id);
-free_power_table:
- kfree(cpufreq_cdev->dyn_power_table);
free_table:
kfree(cpufreq_cdev->freq_table);
free_time_in_idle_timestamp:
@@ -956,7 +938,6 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
thermal_cooling_device_unregister(cpufreq_cdev->cdev);
ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id);
- kfree(cpufreq_cdev->dyn_power_table);
kfree(cpufreq_cdev->time_in_idle_timestamp);
kfree(cpufreq_cdev->time_in_idle);
kfree(cpufreq_cdev->freq_table);
--
2.12.0.432.g71c3a4f4ba37
[toc] | [prev] | [next] | [standalone]
| From | Eduardo Valentin <edubezval@gmail.com> |
|---|---|
| Date | 2017-04-17 19:40 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txiN3-3w9-11@gated-at.bofh.it> |
| In reply to | #1624559 |
[Multipart message — attachments visible in raw view] — view raw
Hey, On Mon, Apr 17, 2017 at 11:31:45AM +0530, Viresh Kumar wrote: > Hi Guys, > > The cpu_cooling driver is designed to use CPU frequency scaling to avoid > high thermal states for a platform. But it wasn't glued really well with > cpufreq core. > > This series tries to improve interactions between cpufreq core and > cpu_cooling driver and does some fixes/cleanups to the cpu_cooling > driver. Can you please be more specific of what exactly is not gluing properly/really well? I like refactoring, as long as well justified. Do you see anything broken currently? Or is it more of a optimization in terms of data structures and how things are computed? > > I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have > pushed them for 0-day build bot and kernel CI testing as well. We should > know if something is broken with these. Nice. What governors did you try? Have you checked "power_allocator" by any chance? > > @Javi: It would be good if you can give them a test, specially because > of your work on the "power" specific bits in the driver. > @Javi, are you still around? This needs to be validated in terms of how the cdev states and power models are computed. Just to make sure we are in one piece. Copying the ARM folks too, Punit?. I will see if I have some time later this week to check if IPA is in one piece after this series. > Pushed here as well: > > git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling > > V1->V2: > - Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo). That was just very minor stuff. Overall, I do not see major issues, but I want to spend some more time on this before acking on my side.
[toc] | [prev] | [next] | [standalone]
| From | Eduardo Valentin <edubezval@gmail.com> |
|---|---|
| Date | 2017-04-17 20:00 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txj6p-3CW-1@gated-at.bofh.it> |
| In reply to | #1624770 |
[Multipart message — attachments visible in raw view] — view raw
Hey, On Mon, Apr 17, 2017 at 10:34:34AM -0700, Eduardo Valentin wrote: > Hey, > > On Mon, Apr 17, 2017 at 11:31:45AM +0530, Viresh Kumar wrote: > > Hi Guys, > > > > The cpu_cooling driver is designed to use CPU frequency scaling to avoid > > high thermal states for a platform. But it wasn't glued really well with > > cpufreq core. > > > > This series tries to improve interactions between cpufreq core and > > cpu_cooling driver and does some fixes/cleanups to the cpu_cooling > > driver. > > > Can you please be more specific of what exactly is not gluing > properly/really well? I like refactoring, as long as well justified. > > Do you see anything broken currently? > > Or is it more of a optimization in terms of data structures and how > things are computed? > > > > > > I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have > > pushed them for 0-day build bot and kernel CI testing as well. We should > > know if something is broken with these. > > Nice. What governors did you try? Have you checked "power_allocator" by > any chance? > > > > > @Javi: It would be good if you can give them a test, specially because > > of your work on the "power" specific bits in the driver. > > > > > @Javi, are you still around? This needs to be validated in terms of how > the cdev states and power models are computed. Just to make sure we are > in one piece. Copying the ARM folks too, Punit?. > > I will see if I have some time later this week to check if IPA is in one > piece after this series. Now adding the ARM folks for real. Lukasz, can you please give it a shot on this series to check if IPA is in one piece? > > > Pushed here as well: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling > > > > V1->V2: > > - Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo). > > That was just very minor stuff. Overall, I do not see major issues, but > I want to spend some more time on this before acking on my side. BR, Eduardo
[toc] | [prev] | [next] | [standalone]
| From | Lukasz Luba <lukasz.luba@arm.com> |
|---|---|
| Date | 2017-04-18 09:30 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txvKi-3lc-9@gated-at.bofh.it> |
| In reply to | #1624775 |
Hey, I am sorry for delay, it was a holiday period for me. On 17/04/17 18:51, Eduardo Valentin wrote: > Hey, > > On Mon, Apr 17, 2017 at 10:34:34AM -0700, Eduardo Valentin wrote: >> Hey, >> >> On Mon, Apr 17, 2017 at 11:31:45AM +0530, Viresh Kumar wrote: >>> Hi Guys, >>> >>> The cpu_cooling driver is designed to use CPU frequency scaling to avoid >>> high thermal states for a platform. But it wasn't glued really well with >>> cpufreq core. >>> >>> This series tries to improve interactions between cpufreq core and >>> cpu_cooling driver and does some fixes/cleanups to the cpu_cooling >>> driver. >> >> >> Can you please be more specific of what exactly is not gluing >> properly/really well? I like refactoring, as long as well justified. >> >> Do you see anything broken currently? >> >> Or is it more of a optimization in terms of data structures and how >> things are computed? >> >> >>> >>> I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have >>> pushed them for 0-day build bot and kernel CI testing as well. We should >>> know if something is broken with these. >> >> Nice. What governors did you try? Have you checked "power_allocator" by >> any chance? >> >>> >>> @Javi: It would be good if you can give them a test, specially because >>> of your work on the "power" specific bits in the driver. >>> >> >> >> @Javi, are you still around? This needs to be validated in terms of how >> the cdev states and power models are computed. Just to make sure we are >> in one piece. Copying the ARM folks too, Punit?. >> >> I will see if I have some time later this week to check if IPA is in one >> piece after this series. > > Now adding the ARM folks for real. > > Lukasz, can you please give it a shot on this series to check if IPA is > in one piece? I will run it on my Juno board. I don't know the changes yet, but I will go through them today. > >> >>> Pushed here as well: >>> >>> git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling >>> >>> V1->V2: >>> - Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo). >> >> That was just very minor stuff. Overall, I do not see major issues, but >> I want to spend some more time on this before acking on my side. Regards, Lukasz Luba
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-18 12:40 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txyIa-54q-13@gated-at.bofh.it> |
| In reply to | #1624770 |
On 17-04-17, 10:34, Eduardo Valentin wrote: > Hey, > > On Mon, Apr 17, 2017 at 11:31:45AM +0530, Viresh Kumar wrote: > > Hi Guys, > > > > The cpu_cooling driver is designed to use CPU frequency scaling to avoid > > high thermal states for a platform. But it wasn't glued really well with > > cpufreq core. > > > > This series tries to improve interactions between cpufreq core and > > cpu_cooling driver and does some fixes/cleanups to the cpu_cooling > > driver. > > > Can you please be more specific of what exactly is not gluing > properly/really well? I like refactoring, as long as well justified. > > Do you see anything broken currently? It wasn't broken really but the same information is scattered around and it wasn't clear on which one is the best one refer. For example, clipped-cpus is copied from the policy structure, but the policy->cpus thing can get updated later on, while the clipped-cpus never got updated. It makes more sense to get rid of the copies we are keeping and reuse the real fields, i.e. use the cpufreq policy directly in cpu_cooling. And then it caused lots of cleanups as well.. > > I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have > > pushed them for 0-day build bot and kernel CI testing as well. We should > > know if something is broken with these. > > Nice. What governors did you try? Have you checked "power_allocator" by > any chance? I tried setting all the governors including power_allocator on my exynos board, and didn't see anything broken. My branch also got tested by kernel CI bot for build and boot tests on a wide range of ARM boards and I didn't see any bad reports due to this set. So it should be okay. > > > > @Javi: It would be good if you can give them a test, specially because > > of your work on the "power" specific bits in the driver. > > > > > @Javi, are you still around? This needs to be validated in terms of how > the cdev states and power models are computed. Just to make sure we are > in one piece. Copying the ARM folks too, Punit?. And yes, I specifically wanted Javi (or some other ARM guy) to test this stuff out. Looks like Lukasz will help out now. Thanks to all of you :) -- viresh
[toc] | [prev] | [next] | [standalone]
| From | Lukasz Luba <lukasz.luba@arm.com> |
|---|---|
| Date | 2017-04-18 16:50 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txCC6-7kc-13@gated-at.bofh.it> |
| In reply to | #1625226 |
Hi Viresh, I have checkout your branch at newest commit: 908063832c268f8add94 I have built it and run it on my Juno r2. I have some python tests for IPA and I run one of them. I seen a few issues so I have created a patch just to be able to run IPA. My next email will have the patch so you can see the changes. IPA does not work with this patch set. I have tested two source codes from your repo: 1. your change 908063832c268f8add94 2. your base 8f506e0faf4e2a4a0bde9f9b1 In case 1. IPA does not work - temperature rises to 83degC in case 2. works - temperature is limited to 65degC. On Monday I can allocate more time for it. Regards, Lukasz On 18/04/17 11:38, Viresh Kumar wrote: > On 17-04-17, 10:34, Eduardo Valentin wrote: >> Hey, >> >> On Mon, Apr 17, 2017 at 11:31:45AM +0530, Viresh Kumar wrote: >>> Hi Guys, >>> >>> The cpu_cooling driver is designed to use CPU frequency scaling to avoid >>> high thermal states for a platform. But it wasn't glued really well with >>> cpufreq core. >>> >>> This series tries to improve interactions between cpufreq core and >>> cpu_cooling driver and does some fixes/cleanups to the cpu_cooling >>> driver. >> >> >> Can you please be more specific of what exactly is not gluing >> properly/really well? I like refactoring, as long as well justified. >> >> Do you see anything broken currently? > > It wasn't broken really but the same information is scattered around > and it wasn't clear on which one is the best one refer. For example, > clipped-cpus is copied from the policy structure, but the policy->cpus > thing can get updated later on, while the clipped-cpus never got > updated. It makes more sense to get rid of the copies we are keeping > and reuse the real fields, i.e. use the cpufreq policy directly in > cpu_cooling. > > And then it caused lots of cleanups as well.. > >>> I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have >>> pushed them for 0-day build bot and kernel CI testing as well. We should >>> know if something is broken with these. >> >> Nice. What governors did you try? Have you checked "power_allocator" by >> any chance? > > I tried setting all the governors including power_allocator on my > exynos board, and didn't see anything broken. My branch also got > tested by kernel CI bot for build and boot tests on a wide range of > ARM boards and I didn't see any bad reports due to this set. So it > should be okay. > >>> >>> @Javi: It would be good if you can give them a test, specially because >>> of your work on the "power" specific bits in the driver. >>> >> >> >> @Javi, are you still around? This needs to be validated in terms of how >> the cdev states and power models are computed. Just to make sure we are >> in one piece. Copying the ARM folks too, Punit?. > > And yes, I specifically wanted Javi (or some other ARM guy) to test > this stuff out. Looks like Lukasz will help out now. > > Thanks to all of you :) >
[toc] | [prev] | [next] | [standalone]
| From | Lukasz Luba <lukasz.luba@arm.com> |
|---|---|
| Date | 2017-04-18 17:00 +0200 |
| Subject | [PATCH] thermal: fix cpu cooling initialization |
| Message-ID | <txCLL-7nt-27@gated-at.bofh.it> |
| In reply to | #1625375 |
This patch fixes issues with incorrect initialization
during cpu cooling registration.
The 'policy' and 'freq_table' must be initialized in cpufreq_cooling_device
before usage.
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/thermal/cpu_cooling.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
This patch fixes some issues to the patch set posted by Viresh.
I have tested it on Juno r2.
Regards,
Lukasz
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 99ffd9f..c682e25 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -691,6 +691,9 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
struct thermal_cooling_device_ops *cooling_ops;
bool first;
+ if (WARN_ON(!policy))
+ return ERR_PTR(-EINVAL);
+
i = cpufreq_table_count_valid_entries(policy);
if (!i) {
pr_debug("%s: CPUFreq table not found or has no valid entries\n",
@@ -711,6 +714,7 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
goto free_cdev;
}
+ cpufreq_cdev->policy = policy;
/* max_level is an index, not a counter */
cpufreq_cdev->max_level = i - 1;
@@ -721,6 +725,18 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
goto free_idle_time;
}
+ /* Fill freq-table in descending order of frequencies */
+ for (i = 0, freq = -1; i <= cpufreq_cdev->max_level; i++) {
+ freq = find_next_max(policy->freq_table, freq);
+ cpufreq_cdev->freq_table[i].frequency = freq;
+
+ /* Warn for duplicate entries */
+ if (!freq)
+ pr_warn("%s: table has duplicate entries\n", __func__);
+ else
+ pr_debug("%s: freq:%u KHz\n", __func__, freq);
+ }
+
if (capacitance) {
cpufreq_cdev->plat_get_static_power = plat_static_func;
@@ -742,18 +758,6 @@ static unsigned int find_next_max(struct cpufreq_frequency_table *table,
}
cpufreq_cdev->id = ret;
- /* Fill freq-table in descending order of frequencies */
- for (i = 0, freq = -1; i <= cpufreq_cdev->max_level; i++) {
- freq = find_next_max(policy->freq_table, freq);
- cpufreq_cdev->freq_table[i].frequency = freq;
-
- /* Warn for duplicate entries */
- if (!freq)
- pr_warn("%s: table has duplicate entries\n", __func__);
- else
- pr_debug("%s: freq:%u KHz\n", __func__, freq);
- }
-
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
cpufreq_cdev->id);
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-19 07:30 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <txQlI-7In-7@gated-at.bofh.it> |
| In reply to | #1625375 |
On 18-04-17, 15:40, Lukasz Luba wrote: > Hi Viresh, > > I have checkout your branch at newest commit: > 908063832c268f8add94 > I have built it and run it on my Juno r2. > I have some python tests for IPA and I run one of them. > > I seen a few issues so I have created a patch just > to be able to run IPA. > My next email will have the patch so you can see the changes. > > IPA does not work with this patch set. > I have tested two source codes from your repo: > 1. your change 908063832c268f8add94 > 2. your base 8f506e0faf4e2a4a0bde9f9b1 > > In case 1. IPA does not work - temperature rises to 83degC > in case 2. works - temperature is limited to 65degC. Yeah, there were some cases power specific cases that weren't covered in my tests and thanks a lot for testing it out. I have pushed my branch again and it has all your fixes (a bit refined) in it. > On Monday I can allocate more time for it. My branch should just work now. Please see if you can allocate 10-15 min today to give it a try, so that we can get it in earlier. I will send a V3 today and your Tested-by would be very much appreciated. Thanks Lukasz. -- viresh
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2017-04-24 12:50 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <tzJJ7-5V5-3@gated-at.bofh.it> |
| In reply to | #1625824 |
On 24-04-17, 11:43, Lukasz Luba wrote: > Hi Viresh, > > I was out of office. > I run your v3 (from git) with some basic tests. > IPA does not work, at least v3 does not crash the kernel. > I didn't have time to go through the patches to narrow down > the problem. Did it work with the patch you sent last week ? -- viresh
[toc] | [prev] | [next] | [standalone]
| From | Lukasz Luba <lukasz.luba@arm.com> |
|---|---|
| Date | 2017-04-24 12:50 +0200 |
| Subject | Re: [PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core |
| Message-ID | <tzJJ7-5V5-5@gated-at.bofh.it> |
| In reply to | #1625824 |
Hi Viresh, I was out of office. I run your v3 (from git) with some basic tests. IPA does not work, at least v3 does not crash the kernel. I didn't have time to go through the patches to narrow down the problem. If you would like to run some basic test, you can find it here [1]. I am happy to check v4 when it is ready. Best regards, Lukasz [1] https://github.com/ARM-software/lisa/blob/master/ipynb/thermal/ThermalSensorCharacterisation.ipynb On 19/04/17 06:22, Viresh Kumar wrote: > On 18-04-17, 15:40, Lukasz Luba wrote: >> Hi Viresh, >> >> I have checkout your branch at newest commit: >> 908063832c268f8add94 >> I have built it and run it on my Juno r2. >> I have some python tests for IPA and I run one of them. >> >> I seen a few issues so I have created a patch just >> to be able to run IPA. >> My next email will have the patch so you can see the changes. >> >> IPA does not work with this patch set. >> I have tested two source codes from your repo: >> 1. your change 908063832c268f8add94 >> 2. your base 8f506e0faf4e2a4a0bde9f9b1 >> >> In case 1. IPA does not work - temperature rises to 83degC >> in case 2. works - temperature is limited to 65degC. > > Yeah, there were some cases power specific cases that weren't covered in my > tests and thanks a lot for testing it out. I have pushed my branch again and it > has all your fixes (a bit refined) in it. > >> On Monday I can allocate more time for it. > > My branch should just work now. Please see if you can allocate 10-15 min today > to give it a try, so that we can get it in earlier. I will send a V3 today and > your Tested-by would be very much appreciated. > > Thanks Lukasz. >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web