mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
Merge "soc: qcom: hyp_core_ctl: Catch uninitialized freq QOS object"
This commit is contained in:
commit
bbc10f107e
1 changed files with 30 additions and 22 deletions
|
|
@ -81,6 +81,7 @@ static struct hyp_core_ctl_cpu_map hh_cpumap[NR_CPUS];
|
|||
static bool is_vcpu_info_populated;
|
||||
static bool init_done;
|
||||
static int nr_vcpus;
|
||||
static bool freq_qos_init_done;
|
||||
|
||||
static inline void hyp_core_ctl_print_status(char *msg)
|
||||
{
|
||||
|
|
@ -111,12 +112,14 @@ static void hyp_core_ctl_undo_reservation(struct hyp_core_ctl_data *hcd)
|
|||
|
||||
cpumask_clear_cpu(cpu, &hcd->our_isolated_cpus);
|
||||
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
FREQ_QOS_MIN_DEFAULT_VALUE);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
if (freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
FREQ_QOS_MIN_DEFAULT_VALUE);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
cpu, ret);
|
||||
}
|
||||
}
|
||||
|
||||
hyp_core_ctl_print_status("undo_reservation_end");
|
||||
|
|
@ -279,9 +282,9 @@ static void hyp_core_ctl_do_reservation(struct hyp_core_ctl_data *hcd)
|
|||
|
||||
cpumask_set_cpu(i, &hcd->our_isolated_cpus);
|
||||
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
min_freq = per_cpu(qos_min_freq, i);
|
||||
if (min_freq) {
|
||||
if (min_freq && freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
ret = freq_qos_update_request(qos_req, min_freq);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
|
|
@ -339,9 +342,9 @@ static void hyp_core_ctl_do_reservation(struct hyp_core_ctl_data *hcd)
|
|||
|
||||
cpumask_set_cpu(i, &hcd->our_isolated_cpus);
|
||||
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
min_freq = per_cpu(qos_min_freq, i);
|
||||
if (min_freq) {
|
||||
if (min_freq && freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
min_freq);
|
||||
if (ret < 0)
|
||||
|
|
@ -386,12 +389,14 @@ static void hyp_core_ctl_do_reservation(struct hyp_core_ctl_data *hcd)
|
|||
|
||||
cpumask_clear_cpu(i, &hcd->our_isolated_cpus);
|
||||
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
if (freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, i);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
FREQ_QOS_MIN_DEFAULT_VALUE);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
i, ret);
|
||||
}
|
||||
|
||||
if (--unisolate_need == 0)
|
||||
break;
|
||||
|
|
@ -532,12 +537,14 @@ static int hyp_core_ctl_cpu_cooling_cb(struct notifier_block *nb,
|
|||
if (cpumask_test_cpu(cpu, &the_hcd->our_isolated_cpus)) {
|
||||
sched_unisolate_cpu(cpu);
|
||||
cpumask_clear_cpu(cpu, &the_hcd->our_isolated_cpus);
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
if (freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
FREQ_QOS_MIN_DEFAULT_VALUE);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
cpu, ret);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
|
@ -597,12 +604,14 @@ static int hyp_core_ctl_hp_offline(unsigned int cpu)
|
|||
*/
|
||||
if (cpumask_test_and_clear_cpu(cpu, &the_hcd->our_isolated_cpus)) {
|
||||
sched_unisolate_cpu_unlocked(cpu);
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
if (freq_qos_init_done) {
|
||||
qos_req = &per_cpu(qos_min_req, cpu);
|
||||
ret = freq_qos_update_request(qos_req,
|
||||
FREQ_QOS_MIN_DEFAULT_VALUE);
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
if (ret < 0)
|
||||
pr_err("fail to update min freq for CPU%d ret=%d\n",
|
||||
cpu, ret);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -799,7 +808,6 @@ static ssize_t status_show(struct device *dev, struct device_attribute *attr,
|
|||
|
||||
static DEVICE_ATTR_RO(status);
|
||||
|
||||
static bool freq_qos_init_done;
|
||||
static int init_freq_qos_req(void)
|
||||
{
|
||||
int cpu, ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue