Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 880dc79f authored by Maria Yu's avatar Maria Yu
Browse files

sched: energy: call walt_sched_energy_populated_callback when needed



When there is no energy cost data exist, do not call
walt_sched_energy_populated_callback at all.

Change-Id: I6444f77866ef3ecb526211c6b056f261ab9bf66f
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 8b7300fd
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -150,6 +150,7 @@ static int sched_energy_probe(struct platform_device *pdev)
	int cpu;
	int cpu;
	unsigned long *max_frequencies = NULL;
	unsigned long *max_frequencies = NULL;
	int ret;
	int ret;
	bool is_sge_valid = false;


	if (!sched_is_energy_aware())
	if (!sched_is_energy_aware())
		return 0;
		return 0;
@@ -248,6 +249,7 @@ static int sched_energy_probe(struct platform_device *pdev)
					sge_l0->cap_states[i].power);
					sge_l0->cap_states[i].power);
			}
			}


			is_sge_valid = true;
			dev_info(&pdev->dev,
			dev_info(&pdev->dev,
				"cpu=%d eff=%d [freq=%ld cap=%ld power_d0=%ld] -> [freq=%ld cap=%ld power_d0=%ld]\n",
				"cpu=%d eff=%d [freq=%ld cap=%ld power_d0=%ld] -> [freq=%ld cap=%ld power_d0=%ld]\n",
				cpu, efficiency,
				cpu, efficiency,
@@ -271,6 +273,7 @@ static int sched_energy_probe(struct platform_device *pdev)


	kfree(max_frequencies);
	kfree(max_frequencies);


	if (is_sge_valid)
		walt_sched_energy_populated_callback();
		walt_sched_energy_populated_callback();
	dev_info(&pdev->dev, "Sched-energy-costs capacity updated\n");
	dev_info(&pdev->dev, "Sched-energy-costs capacity updated\n");
	return 0;
	return 0;