mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
More power management updates for v4.16-rc1
- Drop the at32ap-cpufreq driver which is useless after the
removal of the corresponding arch (Corentin LABBE).
- Fix a regression from the 4.14 cycle in the APM idle driver by
making it initialize the polling state properly (Rafael Wysocki).
- Fix a crash on failing system suspend due to a missing check in
the cpufreq core (Bo Yan).
- Make the intel_pstate driver initialize the hardware-managed
P-state control (HWP) feature on CPU0 upon resume from system
suspend if HWP had been enabled before the system was suspended
(Chen Yu).
- Fix up the SCPI cpufreq driver after recent changes (Sudeep Holla,
Wei Yongjun).
- Avoid pointer subtractions during frequency table walks in cpufreq
(Dominik Brodowski).
- Avoid the check for ProcFeedback in ST/CZ in the cpufreq driver
for AMD processors and add a MODULE_ALIAS for cpufreq on ARM IMX
(Akshu Agrawal, Nicolas Chauvet).
- Fix the prototype of swsusp_arch_resume() on x86 (Arnd Bergmann).
- Fix up the parsing of power domains DT data (Ulf Hansson).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJafGscAAoJEILEb/54YlRx1b0QAI4U8tlNoHSlopF/dSANCelJ
urar53+rSYQWZ7DJB2XNTpAADaLEkB3qHbO/HhXEtgOT9J/vktQ+OfxC0aTx/7VI
blf1XZ67rlR/qeqW7zV0C3txFwK+VZNBEsJdbFNwCbb8bg8mUlE/CcLw2gZfpxW4
X08wDB0QR7l7InEuffjhXa1JwIxi11lzQkaVdsoXIQu+A0P8vEKZNL2lM2Oukz0c
s/yYnNIKGfXjLnm0h+WJnRjHettcuVY7stuyv8VXpw1UU5uSdk9U+aLjnoq9Hb/a
6rklE0XDPGM+ggVLkCM3oSZGqpCQkKAuM2EKzxaYB7gIjlkOn0WCi8bQlQoKVh7Q
oPSDqby2upjWTEUjH0WSiOAIhjIa0lRP0MRXA0MS4q+x7xh/q+f643zpi6m7iUwq
KXAv7+vnJrgfPKRJstLVLu/UmRFedxAZYsICbZISJPIr7tSpg2Ux2yr4GljXl1a5
NW/72tENKSKfR+oWKanWv3fg/5E8s4CzZjYrADnsKfQXlyPrLUZ8KY+83eTJba2A
2P/YuUx4eQZb05iNtBbtvhqN4FszDmdKdE7usg38u0uIGOXgJdjvKQTd/47Ea6TZ
ATOTAwsyRa4qhJvve35MjU6cVIQZGqLaDUOoPGM1Es6rmdE5G5zs5toJWnQt3gd/
suizJ/veKK6OtQabglDT
=xKgy
-----END PGP SIGNATURE-----
Merge tag 'pm-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management updates from Rafael Wysocki:
"These are mostly fixes and cleanups and removal of the no longer
needed at32ap-cpufreq driver.
Specifics:
- Drop the at32ap-cpufreq driver which is useless after the removal
of the corresponding arch (Corentin LABBE).
- Fix a regression from the 4.14 cycle in the APM idle driver by
making it initialize the polling state properly (Rafael Wysocki).
- Fix a crash on failing system suspend due to a missing check in the
cpufreq core (Bo Yan).
- Make the intel_pstate driver initialize the hardware-managed
P-state control (HWP) feature on CPU0 upon resume from system
suspend if HWP had been enabled before the system was suspended
(Chen Yu).
- Fix up the SCPI cpufreq driver after recent changes (Sudeep Holla,
Wei Yongjun).
- Avoid pointer subtractions during frequency table walks in cpufreq
(Dominik Brodowski).
- Avoid the check for ProcFeedback in ST/CZ in the cpufreq driver for
AMD processors and add a MODULE_ALIAS for cpufreq on ARM IMX (Akshu
Agrawal, Nicolas Chauvet).
- Fix the prototype of swsusp_arch_resume() on x86 (Arnd Bergmann).
- Fix up the parsing of power domains DT data (Ulf Hansson)"
* tag 'pm-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
arm: imx: Add MODULE_ALIAS for cpufreq
cpufreq: Add and use cpufreq_for_each_{valid_,}entry_idx()
cpufreq: intel_pstate: Enable HWP during system resume on CPU0
cpufreq: scpi: fix error return code in scpi_cpufreq_init()
x86: hibernate: fix swsusp_arch_resume() prototype
PM / domains: Fix up domain-idle-states OF parsing
cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR
cpufreq: remove at32ap-cpufreq
cpufreq: AMD: Ignore the check for ProcFeedback in ST/CZ
x86: PM: Make APM idle driver initialize polling state
cpufreq: Skip cpufreq resume if it's not suspended
This commit is contained in:
commit
a051c14b8d
18 changed files with 166 additions and 238 deletions
|
|
@ -628,6 +628,18 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
|
|||
#define cpufreq_for_each_entry(pos, table) \
|
||||
for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++)
|
||||
|
||||
/*
|
||||
* cpufreq_for_each_entry_idx - iterate over a cpufreq_frequency_table
|
||||
* with index
|
||||
* @pos: the cpufreq_frequency_table * to use as a loop cursor.
|
||||
* @table: the cpufreq_frequency_table * to iterate over.
|
||||
* @idx: the table entry currently being processed
|
||||
*/
|
||||
|
||||
#define cpufreq_for_each_entry_idx(pos, table, idx) \
|
||||
for (pos = table, idx = 0; pos->frequency != CPUFREQ_TABLE_END; \
|
||||
pos++, idx++)
|
||||
|
||||
/*
|
||||
* cpufreq_for_each_valid_entry - iterate over a cpufreq_frequency_table
|
||||
* excluding CPUFREQ_ENTRY_INVALID frequencies.
|
||||
|
|
@ -641,6 +653,21 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
|
|||
continue; \
|
||||
else
|
||||
|
||||
/*
|
||||
* cpufreq_for_each_valid_entry_idx - iterate with index over a cpufreq
|
||||
* frequency_table excluding CPUFREQ_ENTRY_INVALID frequencies.
|
||||
* @pos: the cpufreq_frequency_table * to use as a loop cursor.
|
||||
* @table: the cpufreq_frequency_table * to iterate over.
|
||||
* @idx: the table entry currently being processed
|
||||
*/
|
||||
|
||||
#define cpufreq_for_each_valid_entry_idx(pos, table, idx) \
|
||||
cpufreq_for_each_entry_idx(pos, table, idx) \
|
||||
if (pos->frequency == CPUFREQ_ENTRY_INVALID) \
|
||||
continue; \
|
||||
else
|
||||
|
||||
|
||||
int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table);
|
||||
|
||||
|
|
@ -667,19 +694,20 @@ static inline int cpufreq_table_find_index_al(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq >= target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
best = pos;
|
||||
best = idx;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Find lowest freq at or above target in a table in descending order */
|
||||
|
|
@ -687,28 +715,29 @@ static inline int cpufreq_table_find_index_dl(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq == target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
if (freq > target_freq) {
|
||||
best = pos;
|
||||
best = idx;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* No freq found above target_freq */
|
||||
if (best == table - 1)
|
||||
return pos - table;
|
||||
if (best == -1)
|
||||
return idx;
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Works only on sorted freq-tables */
|
||||
|
|
@ -728,28 +757,29 @@ static inline int cpufreq_table_find_index_ah(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq == target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
if (freq < target_freq) {
|
||||
best = pos;
|
||||
best = idx;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* No freq found below target_freq */
|
||||
if (best == table - 1)
|
||||
return pos - table;
|
||||
if (best == -1)
|
||||
return idx;
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Find highest freq at or below target in a table in descending order */
|
||||
|
|
@ -757,19 +787,20 @@ static inline int cpufreq_table_find_index_dh(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq <= target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
best = pos;
|
||||
best = idx;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Works only on sorted freq-tables */
|
||||
|
|
@ -789,32 +820,33 @@ static inline int cpufreq_table_find_index_ac(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq == target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
if (freq < target_freq) {
|
||||
best = pos;
|
||||
best = idx;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* No freq found below target_freq */
|
||||
if (best == table - 1)
|
||||
return pos - table;
|
||||
if (best == -1)
|
||||
return idx;
|
||||
|
||||
/* Choose the closest freq */
|
||||
if (target_freq - best->frequency > freq - target_freq)
|
||||
return pos - table;
|
||||
if (target_freq - table[best].frequency > freq - target_freq)
|
||||
return idx;
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Find closest freq to target in a table in descending order */
|
||||
|
|
@ -822,32 +854,33 @@ static inline int cpufreq_table_find_index_dc(struct cpufreq_policy *policy,
|
|||
unsigned int target_freq)
|
||||
{
|
||||
struct cpufreq_frequency_table *table = policy->freq_table;
|
||||
struct cpufreq_frequency_table *pos, *best = table - 1;
|
||||
struct cpufreq_frequency_table *pos;
|
||||
unsigned int freq;
|
||||
int idx, best = -1;
|
||||
|
||||
cpufreq_for_each_valid_entry(pos, table) {
|
||||
cpufreq_for_each_valid_entry_idx(pos, table, idx) {
|
||||
freq = pos->frequency;
|
||||
|
||||
if (freq == target_freq)
|
||||
return pos - table;
|
||||
return idx;
|
||||
|
||||
if (freq > target_freq) {
|
||||
best = pos;
|
||||
best = idx;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* No freq found above target_freq */
|
||||
if (best == table - 1)
|
||||
return pos - table;
|
||||
if (best == -1)
|
||||
return idx;
|
||||
|
||||
/* Choose the closest freq */
|
||||
if (best->frequency - target_freq > target_freq - freq)
|
||||
return pos - table;
|
||||
if (table[best].frequency - target_freq > target_freq - freq)
|
||||
return idx;
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
return best - table;
|
||||
return best;
|
||||
}
|
||||
|
||||
/* Works only on sorted freq-tables */
|
||||
|
|
|
|||
Loading…
Reference in a new issue