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

Commit 2a5f5ed0 authored by Xiaocheng Li's avatar Xiaocheng Li
Browse files

msm: thermal: Keep core_control_mask coincident with boot_cpu_mask



Update core_control_mask according to boot_cpu_mask to make sure
the hotplug activities in thermal driver can only happen among the
CPUs under boot_cpu_mask.

Change-Id: Ic8bd319b94b234e913d89b65736ff287706db7c1
Signed-off-by: default avatarXiaocheng Li <lix@codeaurora.org>
parent 19c9d762
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -4573,8 +4573,19 @@ static int probe_cc(struct device_node *node, struct msm_thermal_data *data,

	key = "qcom,core-control-mask";
	ret = of_property_read_u32(node, key, &data->core_control_mask);
	if (ret)
		goto read_node_fail;
	if (ret) {
		/*
		 * Set default mask for all cores except CPU0.
		 * E.g. 0xE for 4 cores and 0xFE for 8 cores.
		 */
		data->core_control_mask = (~1) & (BIT(num_possible_cpus()) - 1);
	}
	/*
	 * Keep core_control_mask coincident with boot_cpu_mask.
	 * cpu_online_mask is the same as boot_cpu_mask until thermal driver
	 * initialization.
	 */
	data->core_control_mask &= *(uint32_t *)cpu_online_mask;

	key = "qcom,hotplug-temp";
	ret = of_property_read_u32(node, key, &data->hotplug_temp_degC);