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

Commit 8343c40d authored by Hoan Tran's avatar Hoan Tran Committed by Rafael J. Wysocki
Browse files

ACPI: CPPC: Return error if _CPC is invalid on a CPU



Based on 8.4.7.1 section of ACPI 6.1 specification, if the platform
supports CPPC, the _CPC object must exist under all processor objects.
If cpc_desc_ptr pointer is invalid on any CPUs, acpi_get_psd_map()
should return error and CPPC cpufreq driver can not be registered.

Signed-off-by: default avatarHoan Tran <hotran@apm.com>
Reviewed-by: default avatarPrashanth Prakash <pprakash@codeaurora.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 33688abb
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -299,8 +299,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
			continue;
			continue;


		cpc_ptr = per_cpu(cpc_desc_ptr, i);
		cpc_ptr = per_cpu(cpc_desc_ptr, i);
		if (!cpc_ptr)
		if (!cpc_ptr) {
			continue;
			retval = -EFAULT;
			goto err_ret;
		}


		pdomain = &(cpc_ptr->domain_info);
		pdomain = &(cpc_ptr->domain_info);
		cpumask_set_cpu(i, pr->shared_cpu_map);
		cpumask_set_cpu(i, pr->shared_cpu_map);
@@ -322,8 +324,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
				continue;
				continue;


			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
			if (!match_cpc_ptr)
			if (!match_cpc_ptr) {
				continue;
				retval = -EFAULT;
				goto err_ret;
			}


			match_pdomain = &(match_cpc_ptr->domain_info);
			match_pdomain = &(match_cpc_ptr->domain_info);
			if (match_pdomain->domain != pdomain->domain)
			if (match_pdomain->domain != pdomain->domain)
@@ -353,8 +357,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
				continue;
				continue;


			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
			if (!match_cpc_ptr)
			if (!match_cpc_ptr) {
				continue;
				retval = -EFAULT;
				goto err_ret;
			}


			match_pdomain = &(match_cpc_ptr->domain_info);
			match_pdomain = &(match_cpc_ptr->domain_info);
			if (match_pdomain->domain != pdomain->domain)
			if (match_pdomain->domain != pdomain->domain)