mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Linux 5.4-rc5
-----BEGIN PGP SIGNATURE----- iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl210Z8eHHRvcnZhbGRz QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGv+kIAKRpO7EuDokQL4qp hxEEaCMJA1T055EMlNU6FVAq/ZbmapzreUyNYiRMpPWKGTWNMkhIcZQfysYeGZz5 y/KRxAiVxlcB+3v3yRmoZd/XoQmhgvJmqD4zhaGI2Utonow4f/SGSEFFZqqs9WND 4HJROjZHgQ4JBxg9Z+QMo0FxbV/DCZpEOUq51N9WJywyyDRb18zotE83stpU+pE2 fjqT7mk0NLrnYXuDRAbFC1Aau9ed4H6LlwLmxaqxq/Pt5Rz7wIKwKL9HIT4Dm/0a qpani6phhHWL7MwUpa2wkEonFCD03rJFl3DUVJo64Ijh4up5D/jyXQ+GKV2P4WKJ 275Rb5Q= =WiZZ -----END PGP SIGNATURE----- Merge 5.4-rc5 into android-common Linux 5.4-rc5 Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: Ib61881c64a2725c6229c26d2ce63f107b7215c47
This commit is contained in:
commit
444da424c1
245 changed files with 2189 additions and 1402 deletions
|
|
@ -728,7 +728,7 @@ static ssize_t store_##file_name \
|
|||
if (ret != 1) \
|
||||
return -EINVAL; \
|
||||
\
|
||||
ret = dev_pm_qos_update_request(policy->object##_freq_req, val);\
|
||||
ret = freq_qos_update_request(policy->object##_freq_req, val);\
|
||||
return ret >= 0 ? count : ret; \
|
||||
}
|
||||
|
||||
|
|
@ -1210,19 +1210,21 @@ static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu)
|
|||
goto err_free_real_cpus;
|
||||
}
|
||||
|
||||
freq_constraints_init(&policy->constraints);
|
||||
|
||||
policy->nb_min.notifier_call = cpufreq_notifier_min;
|
||||
policy->nb_max.notifier_call = cpufreq_notifier_max;
|
||||
|
||||
ret = dev_pm_qos_add_notifier(dev, &policy->nb_min,
|
||||
DEV_PM_QOS_MIN_FREQUENCY);
|
||||
ret = freq_qos_add_notifier(&policy->constraints, FREQ_QOS_MIN,
|
||||
&policy->nb_min);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to register MIN QoS notifier: %d (%*pbl)\n",
|
||||
ret, cpumask_pr_args(policy->cpus));
|
||||
goto err_kobj_remove;
|
||||
}
|
||||
|
||||
ret = dev_pm_qos_add_notifier(dev, &policy->nb_max,
|
||||
DEV_PM_QOS_MAX_FREQUENCY);
|
||||
ret = freq_qos_add_notifier(&policy->constraints, FREQ_QOS_MAX,
|
||||
&policy->nb_max);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to register MAX QoS notifier: %d (%*pbl)\n",
|
||||
ret, cpumask_pr_args(policy->cpus));
|
||||
|
|
@ -1240,8 +1242,8 @@ static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu)
|
|||
return policy;
|
||||
|
||||
err_min_qos_notifier:
|
||||
dev_pm_qos_remove_notifier(dev, &policy->nb_min,
|
||||
DEV_PM_QOS_MIN_FREQUENCY);
|
||||
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MIN,
|
||||
&policy->nb_min);
|
||||
err_kobj_remove:
|
||||
cpufreq_policy_put_kobj(policy);
|
||||
err_free_real_cpus:
|
||||
|
|
@ -1258,7 +1260,6 @@ err_free_policy:
|
|||
|
||||
static void cpufreq_policy_free(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct device *dev = get_cpu_device(policy->cpu);
|
||||
unsigned long flags;
|
||||
int cpu;
|
||||
|
||||
|
|
@ -1270,10 +1271,13 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
|
|||
per_cpu(cpufreq_cpu_data, cpu) = NULL;
|
||||
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
|
||||
|
||||
dev_pm_qos_remove_notifier(dev, &policy->nb_max,
|
||||
DEV_PM_QOS_MAX_FREQUENCY);
|
||||
dev_pm_qos_remove_notifier(dev, &policy->nb_min,
|
||||
DEV_PM_QOS_MIN_FREQUENCY);
|
||||
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MAX,
|
||||
&policy->nb_max);
|
||||
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MIN,
|
||||
&policy->nb_min);
|
||||
|
||||
/* Cancel any pending policy->update work before freeing the policy. */
|
||||
cancel_work_sync(&policy->update);
|
||||
|
||||
if (policy->max_freq_req) {
|
||||
/*
|
||||
|
|
@ -1282,10 +1286,10 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
|
|||
*/
|
||||
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
|
||||
CPUFREQ_REMOVE_POLICY, policy);
|
||||
dev_pm_qos_remove_request(policy->max_freq_req);
|
||||
freq_qos_remove_request(policy->max_freq_req);
|
||||
}
|
||||
|
||||
dev_pm_qos_remove_request(policy->min_freq_req);
|
||||
freq_qos_remove_request(policy->min_freq_req);
|
||||
kfree(policy->min_freq_req);
|
||||
|
||||
cpufreq_policy_put_kobj(policy);
|
||||
|
|
@ -1365,8 +1369,6 @@ static int cpufreq_online(unsigned int cpu)
|
|||
cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
|
||||
|
||||
if (new_policy) {
|
||||
struct device *dev = get_cpu_device(cpu);
|
||||
|
||||
for_each_cpu(j, policy->related_cpus) {
|
||||
per_cpu(cpufreq_cpu_data, j) = policy;
|
||||
add_cpu_dev_symlink(policy, j);
|
||||
|
|
@ -1377,36 +1379,31 @@ static int cpufreq_online(unsigned int cpu)
|
|||
if (!policy->min_freq_req)
|
||||
goto out_destroy_policy;
|
||||
|
||||
ret = dev_pm_qos_add_request(dev, policy->min_freq_req,
|
||||
DEV_PM_QOS_MIN_FREQUENCY,
|
||||
policy->min);
|
||||
ret = freq_qos_add_request(&policy->constraints,
|
||||
policy->min_freq_req, FREQ_QOS_MIN,
|
||||
policy->min);
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* So we don't call dev_pm_qos_remove_request() for an
|
||||
* So we don't call freq_qos_remove_request() for an
|
||||
* uninitialized request.
|
||||
*/
|
||||
kfree(policy->min_freq_req);
|
||||
policy->min_freq_req = NULL;
|
||||
|
||||
dev_err(dev, "Failed to add min-freq constraint (%d)\n",
|
||||
ret);
|
||||
goto out_destroy_policy;
|
||||
}
|
||||
|
||||
/*
|
||||
* This must be initialized right here to avoid calling
|
||||
* dev_pm_qos_remove_request() on uninitialized request in case
|
||||
* freq_qos_remove_request() on uninitialized request in case
|
||||
* of errors.
|
||||
*/
|
||||
policy->max_freq_req = policy->min_freq_req + 1;
|
||||
|
||||
ret = dev_pm_qos_add_request(dev, policy->max_freq_req,
|
||||
DEV_PM_QOS_MAX_FREQUENCY,
|
||||
policy->max);
|
||||
ret = freq_qos_add_request(&policy->constraints,
|
||||
policy->max_freq_req, FREQ_QOS_MAX,
|
||||
policy->max);
|
||||
if (ret < 0) {
|
||||
policy->max_freq_req = NULL;
|
||||
dev_err(dev, "Failed to add max-freq constraint (%d)\n",
|
||||
ret);
|
||||
goto out_destroy_policy;
|
||||
}
|
||||
|
||||
|
|
@ -2389,7 +2386,6 @@ int cpufreq_set_policy(struct cpufreq_policy *policy,
|
|||
struct cpufreq_policy *new_policy)
|
||||
{
|
||||
struct cpufreq_governor *old_gov;
|
||||
struct device *cpu_dev = get_cpu_device(policy->cpu);
|
||||
int ret;
|
||||
|
||||
pr_debug("setting new policy for CPU %u: %u - %u kHz\n",
|
||||
|
|
@ -2401,8 +2397,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy,
|
|||
* PM QoS framework collects all the requests from users and provide us
|
||||
* the final aggregated value here.
|
||||
*/
|
||||
new_policy->min = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MIN_FREQUENCY);
|
||||
new_policy->max = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MAX_FREQUENCY);
|
||||
new_policy->min = freq_qos_read_value(&policy->constraints, FREQ_QOS_MIN);
|
||||
new_policy->max = freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX);
|
||||
|
||||
/* verify the cpu speed can be set within this limit */
|
||||
ret = cpufreq_driver->verify(new_policy);
|
||||
|
|
@ -2535,7 +2531,7 @@ static int cpufreq_boost_set_sw(int state)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = dev_pm_qos_update_request(policy->max_freq_req, policy->max);
|
||||
ret = freq_qos_update_request(policy->max_freq_req, policy->max);
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1088,10 +1088,10 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
|
|||
|
||||
static struct cpufreq_driver intel_pstate;
|
||||
|
||||
static void update_qos_request(enum dev_pm_qos_req_type type)
|
||||
static void update_qos_request(enum freq_qos_req_type type)
|
||||
{
|
||||
int max_state, turbo_max, freq, i, perf_pct;
|
||||
struct dev_pm_qos_request *req;
|
||||
struct freq_qos_request *req;
|
||||
struct cpufreq_policy *policy;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
|
|
@ -1112,7 +1112,7 @@ static void update_qos_request(enum dev_pm_qos_req_type type)
|
|||
else
|
||||
turbo_max = cpu->pstate.turbo_pstate;
|
||||
|
||||
if (type == DEV_PM_QOS_MIN_FREQUENCY) {
|
||||
if (type == FREQ_QOS_MIN) {
|
||||
perf_pct = global.min_perf_pct;
|
||||
} else {
|
||||
req++;
|
||||
|
|
@ -1122,7 +1122,7 @@ static void update_qos_request(enum dev_pm_qos_req_type type)
|
|||
freq = DIV_ROUND_UP(turbo_max * perf_pct, 100);
|
||||
freq *= cpu->pstate.scaling;
|
||||
|
||||
if (dev_pm_qos_update_request(req, freq) < 0)
|
||||
if (freq_qos_update_request(req, freq) < 0)
|
||||
pr_warn("Failed to update freq constraint: CPU%d\n", i);
|
||||
}
|
||||
}
|
||||
|
|
@ -1153,7 +1153,7 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct kobj_attribute *b,
|
|||
if (intel_pstate_driver == &intel_pstate)
|
||||
intel_pstate_update_policies();
|
||||
else
|
||||
update_qos_request(DEV_PM_QOS_MAX_FREQUENCY);
|
||||
update_qos_request(FREQ_QOS_MAX);
|
||||
|
||||
mutex_unlock(&intel_pstate_driver_lock);
|
||||
|
||||
|
|
@ -1187,7 +1187,7 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct kobj_attribute *b,
|
|||
if (intel_pstate_driver == &intel_pstate)
|
||||
intel_pstate_update_policies();
|
||||
else
|
||||
update_qos_request(DEV_PM_QOS_MIN_FREQUENCY);
|
||||
update_qos_request(FREQ_QOS_MIN);
|
||||
|
||||
mutex_unlock(&intel_pstate_driver_lock);
|
||||
|
||||
|
|
@ -2381,7 +2381,7 @@ static unsigned int intel_cpufreq_fast_switch(struct cpufreq_policy *policy,
|
|||
static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int max_state, turbo_max, min_freq, max_freq, ret;
|
||||
struct dev_pm_qos_request *req;
|
||||
struct freq_qos_request *req;
|
||||
struct cpudata *cpu;
|
||||
struct device *dev;
|
||||
|
||||
|
|
@ -2416,15 +2416,15 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
|||
max_freq = DIV_ROUND_UP(turbo_max * global.max_perf_pct, 100);
|
||||
max_freq *= cpu->pstate.scaling;
|
||||
|
||||
ret = dev_pm_qos_add_request(dev, req, DEV_PM_QOS_MIN_FREQUENCY,
|
||||
min_freq);
|
||||
ret = freq_qos_add_request(&policy->constraints, req, FREQ_QOS_MIN,
|
||||
min_freq);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret);
|
||||
goto free_req;
|
||||
}
|
||||
|
||||
ret = dev_pm_qos_add_request(dev, req + 1, DEV_PM_QOS_MAX_FREQUENCY,
|
||||
max_freq);
|
||||
ret = freq_qos_add_request(&policy->constraints, req + 1, FREQ_QOS_MAX,
|
||||
max_freq);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to add max-freq constraint (%d)\n", ret);
|
||||
goto remove_min_req;
|
||||
|
|
@ -2435,7 +2435,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)
|
|||
return 0;
|
||||
|
||||
remove_min_req:
|
||||
dev_pm_qos_remove_request(req);
|
||||
freq_qos_remove_request(req);
|
||||
free_req:
|
||||
kfree(req);
|
||||
pstate_exit:
|
||||
|
|
@ -2446,12 +2446,12 @@ pstate_exit:
|
|||
|
||||
static int intel_cpufreq_cpu_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct dev_pm_qos_request *req;
|
||||
struct freq_qos_request *req;
|
||||
|
||||
req = policy->driver_data;
|
||||
|
||||
dev_pm_qos_remove_request(req + 1);
|
||||
dev_pm_qos_remove_request(req);
|
||||
freq_qos_remove_request(req + 1);
|
||||
freq_qos_remove_request(req);
|
||||
kfree(req);
|
||||
|
||||
return intel_pstate_cpu_exit(policy);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ EXPORT_SYMBOL_GPL(cbe_cpufreq_set_pmode_pmi);
|
|||
static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
|
||||
{
|
||||
struct cpufreq_policy *policy;
|
||||
struct dev_pm_qos_request *req;
|
||||
struct freq_qos_request *req;
|
||||
u8 node, slow_mode;
|
||||
int cpu, ret;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
|
|||
|
||||
req = policy->driver_data;
|
||||
|
||||
ret = dev_pm_qos_update_request(req,
|
||||
ret = freq_qos_update_request(req,
|
||||
policy->freq_table[slow_mode].frequency);
|
||||
if (ret < 0)
|
||||
pr_warn("Failed to update freq constraint: %d\n", ret);
|
||||
|
|
@ -103,7 +103,7 @@ static struct pmi_handler cbe_pmi_handler = {
|
|||
|
||||
void cbe_cpufreq_pmi_policy_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct dev_pm_qos_request *req;
|
||||
struct freq_qos_request *req;
|
||||
int ret;
|
||||
|
||||
if (!cbe_cpufreq_has_pmi)
|
||||
|
|
@ -113,9 +113,8 @@ void cbe_cpufreq_pmi_policy_init(struct cpufreq_policy *policy)
|
|||
if (!req)
|
||||
return;
|
||||
|
||||
ret = dev_pm_qos_add_request(get_cpu_device(policy->cpu), req,
|
||||
DEV_PM_QOS_MAX_FREQUENCY,
|
||||
policy->freq_table[0].frequency);
|
||||
ret = freq_qos_add_request(&policy->constraints, req, FREQ_QOS_MAX,
|
||||
policy->freq_table[0].frequency);
|
||||
if (ret < 0) {
|
||||
pr_err("Failed to add freq constraint (%d)\n", ret);
|
||||
kfree(req);
|
||||
|
|
@ -128,10 +127,10 @@ EXPORT_SYMBOL_GPL(cbe_cpufreq_pmi_policy_init);
|
|||
|
||||
void cbe_cpufreq_pmi_policy_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct dev_pm_qos_request *req = policy->driver_data;
|
||||
struct freq_qos_request *req = policy->driver_data;
|
||||
|
||||
if (cbe_cpufreq_has_pmi) {
|
||||
dev_pm_qos_remove_request(req);
|
||||
freq_qos_remove_request(req);
|
||||
kfree(req);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue