Repository navigation
Fix clock change in waiti for multicore access - #3113
Conversation
ea2f1fc to
8f93ad4
Compare
1e15c0b to
0f792e2
Compare
b7e55b3 to
3af0bd4
Compare
|
@ktrzcinx Some checkpatch issues regarding typos and comment misalignment are valid. |
3af0bd4 to
9767f55
Compare
There was a problem hiding this comment.
We should return the old value not the new value. See https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html. This also needs fixed in atomic_add and atomic_dec.
There was a problem hiding this comment.
This is really runtime PM.
pm_runtime_get(PM_HP_CLOCK, cpu_get_id());Which nicely abstracts the clocking PM. Likewise
pm_runtime_put(PM_HP_CLOCK, cpu_get_id());will cjheck if mask is 0 and switch off HP clock.
There was a problem hiding this comment.
But to maintain this from pm_runtime, I will need to change clock API ( implementation dedicated function for temporary clock frequency reduction - set_freq() will need new parameter defining if clock change is temporary or persistentclock_low_power_mode())
9767f55 to
db2a7a9
Compare
db2a7a9 to
8aae9f5
Compare
b1edc00 to
d568160
Compare
In situation with two or more active cores, saving active frequency index in platform_clock_on_waiti suffer from race condition. Changing state in *set_cpu_freq() method is much more safe. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
|
Blocking on #3151. |
lgirdwood
left a comment
There was a problem hiding this comment.
Are we missing the atomic OR / AND ? or are these no longer needed ?
OR / AND operations are already inside spin_lock / unlock block, so I guess that there atomic operations are not needed (but it wouldn't be also not an error to use it) |
It was needed to call two functions and update one global variable to change clock frequency, what is quite error prone solution. After merging it to one function, it is easier to keep clock description synchronized. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Set bit for PLATFORM_MASTER_CORE_ID and remove exception handlind from arch_cpu_is_core_enabled. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Core enable/disable is related with power management and maintenance of clock trees, so such an mask should be possible to read. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This function will be called from power manager to change current clock value for sleep time. Detailed implemnentation may be clock instance dependednt. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Clock manegement is important part for power consumption optimization, what is a task of this module. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
d568160 to
50b9cc4
Compare
|
CI jenkins known issues. |
There was race condition in situation with multicore environment:
current_freq_idxtoactive_freq_idx(HPRO) and then changecurrent_freq_idxto LPROcurrent_freq_idxtoactive_freq_idx(LPRO) and then changecurrent_freq_idxto LPROactive_freq_idx- LPRO instead HPROMoreover
sleep_core_maskmust be introduced because in a case with multiple cores connected to single clock source, then clock rate may be reduced only when each of them is in wait state.