Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1425524 > unrolled thread

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

Started byHoan Tran <hotran@apm.com>
First post2016-06-18 00:20 +0200
Last post2016-06-22 19:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU Hoan Tran <hotran@apm.com> - 2016-06-18 00:20 +0200
    Re: [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU "Prakash, Prashanth" <pprakash@codeaurora.org> - 2016-06-22 19:10 +0200

#1425524 — [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU

FromHoan Tran <hotran@apm.com>
Date2016-06-18 00:20 +0200
Subject[PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU
Message-ID<rLahk-3W9-13@gated-at.bofh.it>
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: Hoan Tran <hotran@apm.com>
---
 drivers/acpi/cppc_acpi.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 85fd8f7..2e98173 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -299,8 +299,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
 			continue;
 
 		cpc_ptr = per_cpu(cpc_desc_ptr, i);
-		if (!cpc_ptr)
-			continue;
+		if (!cpc_ptr) {
+			retval = -EFAULT;
+			goto err_ret;
+		}
 
 		pdomain = &(cpc_ptr->domain_info);
 		cpumask_set_cpu(i, pr->shared_cpu_map);
@@ -322,8 +324,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
 				continue;
 
 			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
-			if (!match_cpc_ptr)
-				continue;
+			if (!match_cpc_ptr) {
+				retval = -EFAULT;
+				goto err_ret;
+			}
 
 			match_pdomain = &(match_cpc_ptr->domain_info);
 			if (match_pdomain->domain != pdomain->domain)
@@ -353,8 +357,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data)
 				continue;
 
 			match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
-			if (!match_cpc_ptr)
-				continue;
+			if (!match_cpc_ptr) {
+				retval = -EFAULT;
+				goto err_ret;
+			}
 
 			match_pdomain = &(match_cpc_ptr->domain_info);
 			if (match_pdomain->domain != pdomain->domain)
-- 
1.9.1

[toc] | [next] | [standalone]


#1428987

From"Prakash, Prashanth" <pprakash@codeaurora.org>
Date2016-06-22 19:10 +0200
Message-ID<rMTP3-6im-11@gated-at.bofh.it>
In reply to#1425524
Hi Hoan,

On 6/17/2016 4:16 PM, Hoan Tran wrote:
> 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: Hoan Tran <hotran@apm.com>
This patch looks good to me. So,

Reviewed-by: Prashanth Prakash <pprakash@codeaurora.org>

Thanks,
Prashanth

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web