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

Commit d61c2f58 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: cpuidle: lpm-levels: check for valid LPM stats"

parents be405495 34c44ee4
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1203,6 +1203,7 @@ static void cluster_prepare(struct lpm_cluster *cluster,
	if (cluster_configure(cluster, i, from_idle, predicted))
		goto failed;

	if (!IS_ERR_OR_NULL(cluster->stats))
		cluster->stats->sleep_time = start_time;
	cluster_prepare(cluster->parent, &cluster->num_children_in_sync, i,
			from_idle, start_time);
@@ -1211,6 +1212,7 @@ static void cluster_prepare(struct lpm_cluster *cluster,
	return;
failed:
	spin_unlock(&cluster->sync_lock);
	if (!IS_ERR_OR_NULL(cluster->stats))
		cluster->stats->sleep_time = 0;
}

@@ -1250,7 +1252,7 @@ static void cluster_unprepare(struct lpm_cluster *cluster,
	if (!first_cpu || cluster->last_level == cluster->default_level)
		goto unlock_return;

	if (cluster->stats->sleep_time)
	if (!IS_ERR_OR_NULL(cluster->stats) && cluster->stats->sleep_time)
		cluster->stats->sleep_time = end_time -
			cluster->stats->sleep_time;
	lpm_stats_cluster_exit(cluster->stats, cluster->last_level, success);
@@ -1689,6 +1691,9 @@ static void register_cluster_lpm_stats(struct lpm_cluster *cl,

	cl->stats = lpm_stats_config_level(cl->cluster_name, level_name,
			cl->nlevels, parent ? parent->stats : NULL, NULL);
	if (IS_ERR_OR_NULL(cl->stats))
		pr_info("Cluster (%s) stats not registered\n",
			cl->cluster_name);

	kfree(level_name);