diff mbox

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

Message ID 1466201791-13351-1-git-send-email-hotran@apm.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

hotran June 17, 2016, 10:16 p.m. UTC
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(-)

Comments

Prakash, Prashanth June 22, 2016, 5:01 p.m. UTC | #1
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
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki June 24, 2016, 1:35 p.m. UTC | #2
On Wednesday, June 22, 2016 11:01:42 AM Prakash, Prashanth wrote:
> 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>

Patch applied, thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)