[PATCH V2 03/17] thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdev

2017-04-17 Thread Viresh Kumar
Objects of "struct cpufreq_cooling_device" are named a bit inconsistently. Lets use cpufreq_cdev everywhere. Also note that the lists containing such devices is renamed similarly too. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 248

[PATCH V2 03/17] thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdev

2017-04-17 Thread Viresh Kumar
Objects of "struct cpufreq_cooling_device" are named a bit inconsistently. Lets use cpufreq_cdev everywhere. Also note that the lists containing such devices is renamed similarly too. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 248 +-

[PATCH V2 08/17] cpufreq: create cpufreq_table_count_valid_entries()

2017-04-17 Thread Viresh Kumar
We need such a routine at two places already, lets create one. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_stats.c | 13 - drivers/thermal/cpu_cooling.c | 22 +- include/linux/cpufreq.h | 14 ++ 3 files

[PATCH V2 06/17] thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()

2017-04-17 Thread Viresh Kumar
'cpu' is used at only one place and there is no need to keep a separate variable for it. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c

[PATCH V2 06/17] thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()

2017-04-17 Thread Viresh Kumar
'cpu' is used at only one place and there is no need to keep a separate variable for it. Signed-off-by: Viresh Kumar --- 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

[PATCH V2 08/17] cpufreq: create cpufreq_table_count_valid_entries()

2017-04-17 Thread Viresh Kumar
We need such a routine at two places already, lets create one. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_stats.c | 13 - drivers/thermal/cpu_cooling.c | 22 +- include/linux/cpufreq.h | 14 ++ 3 files changed, 27 insertions(+),

[PATCH V2 11/17] thermal: cpu_cooling: get rid of 'allowed_cpus'

2017-04-17 Thread Viresh Kumar
'allowed_cpus' is a copy of policy->related_cpus and can be replaced by it directly. At some places we are only concerned about online CPUs and policy->cpus can be used there. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 77

[PATCH V2 10/17] thermal: cpu_cooling: OPPs are registered for all CPUs

2017-04-17 Thread Viresh Kumar
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 --- drivers/thermal/cpu_cooling.c | 26 +++---

[PATCH V2 11/17] thermal: cpu_cooling: get rid of 'allowed_cpus'

2017-04-17 Thread Viresh Kumar
'allowed_cpus' is a copy of policy->related_cpus and can be replaced by it directly. At some places we are only concerned about online CPUs and policy->cpus can be used there. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 77 --- 1 file

[PATCH V2 10/17] thermal: cpu_cooling: OPPs are registered for all CPUs

2017-04-17 Thread Viresh Kumar
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 --- drivers/thermal/cpu_cooling.c | 26 +++--- 1 file changed, 11

[PATCH V2 13/17] thermal: cpu_cooling: create structure for idle time stats

2017-04-17 Thread Viresh Kumar
We keep two arrays for idle time stats and allocate memory for them separately. It would be much easier to follow if we create an array of idle stats structure instead and allocate it once. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 53

[PATCH V2 09/17] thermal: cpu_cooling: store cpufreq policy

2017-04-17 Thread Viresh Kumar
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 --- drivers/thermal/cpu_cooling.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/cpu_cooling.c

[PATCH V2 14/17] thermal: cpu_cooling: get_level() can't fail

2017-04-17 Thread Viresh Kumar
The frequency passed to get_level() is returned by cpu_power_to_freq() and it is guaranteed that get_level() can't fail. Get rid of error code. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 20 +--- 1 file changed, 5 insertions(+), 15

[PATCH V2 13/17] thermal: cpu_cooling: create structure for idle time stats

2017-04-17 Thread Viresh Kumar
We keep two arrays for idle time stats and allocate memory for them separately. It would be much easier to follow if we create an array of idle stats structure instead and allocate it once. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 53

[PATCH V2 09/17] thermal: cpu_cooling: store cpufreq policy

2017-04-17 Thread Viresh Kumar
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 --- 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

[PATCH V2 14/17] thermal: cpu_cooling: get_level() can't fail

2017-04-17 Thread Viresh Kumar
The frequency passed to get_level() is returned by cpu_power_to_freq() and it is guaranteed that get_level() can't fail. Get rid of error code. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git

[PATCH V2 17/17] thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device

2017-04-17 Thread Viresh Kumar
This shrinks the size of the structure on arm64 by 8 bytes by avoiding padding of 4 bytes at two places. Also add missing doc comment for freq_table Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 15 --- 1 file changed, 8 insertions(+), 7

[PATCH V2 15/17] thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdev

2017-04-17 Thread Viresh Kumar
'cpu_dev' is used by only one function, get_static_power(), and it wouldn't be time consuming to get the cpu device structure within it. This would help removing cpu_dev from struct cpufreq_cooling_device. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c |

[PATCH V2 12/17] thermal: cpu_cooling: merge frequency and power tables

2017-04-17 Thread Viresh Kumar
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

[PATCH V2 16/17] thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power()

2017-04-17 Thread Viresh Kumar
The frequency table shouldn't have any zero frequency entries and so such a check isn't required. Though it would be better to make sure 'state' is within limits. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 7 --- 1 file changed, 4 insertions(+),

[PATCH V2 17/17] thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device

2017-04-17 Thread Viresh Kumar
This shrinks the size of the structure on arm64 by 8 bytes by avoiding padding of 4 bytes at two places. Also add missing doc comment for freq_table Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git

[PATCH V2 15/17] thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdev

2017-04-17 Thread Viresh Kumar
'cpu_dev' is used by only one function, get_static_power(), and it wouldn't be time consuming to get the cpu device structure within it. This would help removing cpu_dev from struct cpufreq_cooling_device. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 22 ++

[PATCH V2 12/17] thermal: cpu_cooling: merge frequency and power tables

2017-04-17 Thread Viresh Kumar
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

[PATCH V2 16/17] thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power()

2017-04-17 Thread Viresh Kumar
The frequency table shouldn't have any zero frequency entries and so such a check isn't required. Though it would be better to make sure 'state' is within limits. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH V2 07/17] thermal: cpu_cooling: use cpufreq_policy to register cooling device

2017-04-17 Thread Viresh Kumar
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

[PATCH V2 05/17] thermal: cpu_cooling: remove cpufreq_cooling_get_level()

2017-04-17 Thread Viresh Kumar
There is only one user of cpufreq_cooling_get_level() and that already has pointer to the cpufreq_cdev structure. It can directly call get_level() instead and we can get rid of cpufreq_cooling_get_level(). Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c |

[PATCH V2 05/17] thermal: cpu_cooling: remove cpufreq_cooling_get_level()

2017-04-17 Thread Viresh Kumar
There is only one user of cpufreq_cooling_get_level() and that already has pointer to the cpufreq_cdev structure. It can directly call get_level() instead and we can get rid of cpufreq_cooling_get_level(). Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 33

[PATCH V2 07/17] thermal: cpu_cooling: use cpufreq_policy to register cooling device

2017-04-17 Thread Viresh Kumar
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

[PATCH V2 04/17] thermal: cpu_cooling: replace cool_dev with cdev

2017-04-17 Thread Viresh Kumar
Objects of "struct thermal_cooling_device" are named a bit inconsistently. Lets use cdev everywhere. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git

[PATCH V2 04/17] thermal: cpu_cooling: replace cool_dev with cdev

2017-04-17 Thread Viresh Kumar
Objects of "struct thermal_cooling_device" are named a bit inconsistently. Lets use cdev everywhere. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git

[PATCH V2 01/17] thermal: cpu_cooling: Avoid accessing potentially freed structures

2017-04-17 Thread Viresh Kumar
After the lock is dropped, it is possible that the cpufreq_dev gets freed before we call get_level() and that can cause kernel to crash. Drop the lock after we are done using the structure. Cc: 4.2+ # 4.2+ Fixes: 02373d7c69b4 ("thermal: cpu_cooling: fix lockdep problems

[PATCH v2 1/3] dt-bindings: Add support for samsung s6e3hf2 panel

2017-04-17 Thread Hoegeun Kwon
The samsung s6e3hf2 panel is a 5.65" 1600x2560 AMOLED panel connected using MIPI-DSI interfaces. The s6e3hf2 is add to samsung,s6e3ha2.txt binding because it is a panel similar to the s6e3ha2. So add the compatible string and comments. Signed-off-by: Hoegeun Kwon ---

[PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core

2017-04-17 Thread Viresh Kumar
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

[PATCH v2 1/3] dt-bindings: Add support for samsung s6e3hf2 panel

2017-04-17 Thread Hoegeun Kwon
The samsung s6e3hf2 panel is a 5.65" 1600x2560 AMOLED panel connected using MIPI-DSI interfaces. The s6e3hf2 is add to samsung,s6e3ha2.txt binding because it is a panel similar to the s6e3ha2. So add the compatible string and comments. Signed-off-by: Hoegeun Kwon ---

[PATCH V2 00/17] thermal: cpu_cooling: improve interaction with cpufreq core

2017-04-17 Thread Viresh Kumar
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

[PATCH V2 01/17] thermal: cpu_cooling: Avoid accessing potentially freed structures

2017-04-17 Thread Viresh Kumar
After the lock is dropped, it is possible that the cpufreq_dev gets freed before we call get_level() and that can cause kernel to crash. Drop the lock after we are done using the structure. Cc: 4.2+ # 4.2+ Fixes: 02373d7c69b4 ("thermal: cpu_cooling: fix lockdep problems in cpu_cooling")

[PATCH v2 2/3] drm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board

2017-04-17 Thread Hoegeun Kwon
This patch supports TM2e panel and the panel has 1600x2560 resolution in 5.65" physical. This identify panel type with compatibility string, also invoke display mode that matches the type. So add the check code for s6e3ha2 compatibility and s6e3hf2 type and select the drm_display_mode of default

[PATCH v2 0/3] Add support for the S6E3HF2 panel on TM2e board

2017-04-17 Thread Hoegeun Kwon
Hi all, First, thanks for Andrzej review. The purpose of this patch is add support for s6e3hf2 AMOLED panel on the TM2e board. The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. The s6e3hf2 panel(5.65") is simliar to the previous s6e3ha2 panel(5.7"), but resolution

[PATCH v2 0/3] Add support for the S6E3HF2 panel on TM2e board

2017-04-17 Thread Hoegeun Kwon
Hi all, First, thanks for Andrzej review. The purpose of this patch is add support for s6e3hf2 AMOLED panel on the TM2e board. The panel has 1600x2560 resolution in 5.65" physical panel in the TM2e device. The s6e3hf2 panel(5.65") is simliar to the previous s6e3ha2 panel(5.7"), but resolution

[PATCH v2 2/3] drm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board

2017-04-17 Thread Hoegeun Kwon
This patch supports TM2e panel and the panel has 1600x2560 resolution in 5.65" physical. This identify panel type with compatibility string, also invoke display mode that matches the type. So add the check code for s6e3ha2 compatibility and s6e3hf2 type and select the drm_display_mode of default

<    6   7   8   9   10   11