All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU
@ 2016-06-17 22:16 Hoan Tran
  2016-06-22 17:01 ` Prakash, Prashanth
  0 siblings, 1 reply; 4+ messages in thread
From: Hoan Tran @ 2016-06-17 22:16 UTC (permalink / raw)
  To: Ashwin Chaugule, Rafael J. Wysocki, Len Brown, pprakash
  Cc: linux-acpi, linux-kernel, lho, Duc Dang, Hoan Tran

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU
  2016-06-17 22:16 [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU Hoan Tran
@ 2016-06-22 17:01 ` Prakash, Prashanth
  2016-06-24 13:35   ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Prakash, Prashanth @ 2016-06-22 17:01 UTC (permalink / raw)
  To: Hoan Tran, Ashwin Chaugule, Rafael J. Wysocki, Len Brown
  Cc: linux-acpi, linux-kernel, lho, Duc Dang

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU
  2016-06-22 17:01 ` Prakash, Prashanth
@ 2016-06-24 13:35   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-06-24 13:35 UTC (permalink / raw)
  To: Prakash, Prashanth, Hoan Tran
  Cc: Ashwin Chaugule, Len Brown, linux-acpi, linux-kernel, lho, Duc Dang

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!


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU
       [not found] <CAFHUOYxU=WvQToekrYTxgUaNnmaiMwANACnnwBN6BycU7UMjoQ@mail.gmail.com>
@ 2016-09-02 13:33 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-09-02 13:33 UTC (permalink / raw)
  To: Hoan Tran
  Cc: stable, Peter Robinson, Itaru Kitayama, Laura Abbott,
	Rafael J. Wysocki, Loc Ho, Duc Dang

On Thu, Sep 01, 2016 at 10:23:09PM -0700, Hoan Tran wrote:
> Commit 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 ("ACPI: CPPC: Return
> error if _CPC is invalid on a CPU")
> 
> This patch and "2324d15447a9db168b1f85e3feac635b1ff8edb8 (ACPI / CPPC:
> Prevent cpc_desc_ptr points to the invalid data)" intend to fix the
> crash issue reported in
> https://bugzilla.redhat.com/show_bug.cgi?id=1361039
> 
> Hope to apply this patch to kernel 4.7.
> 
> Thanks Itaru for testing these patches with kernel 4.7 and Fedora.

Both now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-02 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 22:16 [PATCH] ACPI: CPPC: Return error if _CPC is invalid on a CPU Hoan Tran
2016-06-22 17:01 ` Prakash, Prashanth
2016-06-24 13:35   ` Rafael J. Wysocki
     [not found] <CAFHUOYxU=WvQToekrYTxgUaNnmaiMwANACnnwBN6BycU7UMjoQ@mail.gmail.com>
2016-09-02 13:33 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.