Re: [PATCHv3 1/1] thermal: cpu_cooling: check for the readiness of cpufreq layer
On 28 November 2014 at 20:23, Eduardo Valentin edubez...@gmail.com wrote: diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 1ab0018..88d2775 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -440,6 +440,9 @@ __cpufreq_cooling_register(struct device_node *np, int ret = 0, i; struct cpufreq_policy policy; + if (!cpufreq_frequency_get_table(0)) Please add a pr_debug() here, that will be quite useful while debugging. Also, you can't simply pass 0 to get_table() above. We might be registering the cooling device for some other cluster as well.. This is what I have done in my patch earlier. cpufreq_frequency_get_table(cpumask_first(clip_cpus)); And this will work for all cases. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3 1/1] thermal: cpu_cooling: check for the readiness of cpufreq layer
On Fri, Nov 28, 2014 at 10:53:30AM -0400, Eduardo Valentin wrote: diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index 3f5ad25..d4eaa1b 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -371,9 +371,10 @@ int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) th_zone-cool_dev[th_zone-cool_dev_size] = cpufreq_cooling_register(mask_val); if (IS_ERR(th_zone-cool_dev[th_zone-cool_dev_size])) { - dev_err(sensor_conf-dev, - Failed to register cpufreq cooling device\n); - ret = -EINVAL; + ret = PTR_ERR(th_zone-cool_dev[th_zone-cool_dev_size]); + if (ret != -EPROBE_DEFER) + dev_err(sensor_conf-dev, + Failed to register cpufreq cooling device\n); Something which bugs me quite a lot is when there is an error code (which tells you why something didn't work) and you have an error message, and the error message doesn't bother printing the error code. You might as well just print Failed\n and leave it at that, or md5sum the error message and print the sum instead. :) Knowing why something failed allows you to read the source, and find possible reasons for the failure (which could come down to one reason) and allows faster resolution of the problem. -- FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3 1/1] thermal: cpu_cooling: check for the readiness of cpufreq layer
Russel, On Fri, Nov 28, 2014 at 05:10:24PM +, Russell King - ARM Linux wrote: On Fri, Nov 28, 2014 at 10:53:30AM -0400, Eduardo Valentin wrote: diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index 3f5ad25..d4eaa1b 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -371,9 +371,10 @@ int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) th_zone-cool_dev[th_zone-cool_dev_size] = cpufreq_cooling_register(mask_val); if (IS_ERR(th_zone-cool_dev[th_zone-cool_dev_size])) { - dev_err(sensor_conf-dev, - Failed to register cpufreq cooling device\n); - ret = -EINVAL; + ret = PTR_ERR(th_zone-cool_dev[th_zone-cool_dev_size]); + if (ret != -EPROBE_DEFER) + dev_err(sensor_conf-dev, + Failed to register cpufreq cooling device\n); Something which bugs me quite a lot is when there is an error code (which tells you why something didn't work) and you have an error message, and the error message doesn't bother printing the error code. You might as well just print Failed\n and leave it at that, or md5sum the error message and print the sum instead. :) I like the md5sum better! :-) Knowing why something failed allows you to read the source, and find possible reasons for the failure (which could come down to one reason) and allows faster resolution of the problem. Sure. I will resend with the error codes in the error messages. Makes completely sense. Thanks for taking the time and reviewing. Eduardo Valentin -- FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net. signature.asc Description: Digital signature