Skip to content

Thermal: cpufreq cooling fix

Zhang Rui linux-pm 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 0 repliesSuperseded
  3. v15 patches 3 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Thermal: cpufreq cooling: fix parsing per_cpu cpufreq_frequency_tabledrivers/thermal/cpu_cooling.c+93 -500 replies
2/2Thermal: exynos: fix cooling state translationdrivers/thermal/cpu_cooling.c drivers/thermal/exynos_thermal.c include/linux/cpu_cooling.h +1 more+24 -230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH V3 0/2] Thermal: cpufreq cooling fix

cpufreq cooling uses different frequencies as different cooling states.

But the per_cpu cpufreq_frequency_table may contain duplicate, invalid entries, and it may be in either ascending or descending order. And currently, code for parsing the per_cpu cpufreq_frequency_table is used in several places and inconsistent.

To fix this,
New code is introduce in Patch 1/2, which contains the logic of parsing per_cpu cpufreq_frequency_table, and this piece of code can be used to:
1. get the maximum cooling states
2. translate cpu frequency to cooling state
3. translate cooling state to cpu frequency

Patch 2/2 converts exynos_thermal driver to use the new code introduced in Patch 1/2.

History:
V3: fix wrong return value of get_cpu_frequency().
fix wrong return value of get_property() when property equals GET_MAXL.

V2: remove cpu cooling table to avoid extra memory allocation.

V1: introduce code to convert per_cpu cpufreq_frequency_table
to clean cpu cooling table (no invalid entry, no duplicate entry, in descending order).

I just run build test here. It would be great that some of you can test it on exynos.
any comments?

thanks,
rui