linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI/CPC: Don't try to clean up uninitialized CPC data
@ 2016-12-16 18:35 Boris Ostrovsky
  2016-12-16 21:52 ` Prakash, Prashanth
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Ostrovsky @ 2016-12-16 18:35 UTC (permalink / raw)
  To: rjw, lenb; +Cc: linux-acpi, linux-kernel, Boris Ostrovsky

If acpi_cppc_processor_probe() had not executed successfully (for
example, if _CPC object was not found) then cpc_desc_ptr for that
processor will be invalid.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 drivers/acpi/cppc_acpi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index d0d0504..5bba26e 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -824,6 +824,8 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
 	void __iomem *addr;
 
 	cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);
+	if (!cpc_ptr)
+		return;
 
 	/* Free all the mapped sys mem areas for this CPU */
 	for (i = 2; i < cpc_ptr->num_entries; i++) {
-- 
1.8.3.1

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

* Re: [PATCH] ACPI/CPC: Don't try to clean up uninitialized CPC data
  2016-12-16 18:35 [PATCH] ACPI/CPC: Don't try to clean up uninitialized CPC data Boris Ostrovsky
@ 2016-12-16 21:52 ` Prakash, Prashanth
  2016-12-16 22:02   ` Boris Ostrovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Prakash, Prashanth @ 2016-12-16 21:52 UTC (permalink / raw)
  To: Boris Ostrovsky, rjw, lenb; +Cc: linux-acpi, linux-kernel

Hi Boris,

On 12/16/2016 11:35 AM, Boris Ostrovsky wrote:
> If acpi_cppc_processor_probe() had not executed successfully (for
> example, if _CPC object was not found) then cpc_desc_ptr for that
> processor will be invalid.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> ---
>  drivers/acpi/cppc_acpi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index d0d0504..5bba26e 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -824,6 +824,8 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
>  	void __iomem *addr;
>  
>  	cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);
> +	if (!cpc_ptr)
> +		return;
>  
>  	/* Free all the mapped sys mem areas for this CPU */
>  	for (i = 2; i < cpc_ptr->num_entries; i++) {
I think a recent patch from Sebastian fixed the same issue.
https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=9e9d68dad58c70f40f50adfeabd2fdaa39a743fd

--
Thanks,
Prashanth

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

* Re: [PATCH] ACPI/CPC: Don't try to clean up uninitialized CPC data
  2016-12-16 21:52 ` Prakash, Prashanth
@ 2016-12-16 22:02   ` Boris Ostrovsky
  0 siblings, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2016-12-16 22:02 UTC (permalink / raw)
  To: Prakash, Prashanth, rjw, lenb; +Cc: linux-acpi, linux-kernel

On 12/16/2016 04:52 PM, Prakash, Prashanth wrote:
> Hi Boris,
>
> On 12/16/2016 11:35 AM, Boris Ostrovsky wrote:
>> If acpi_cppc_processor_probe() had not executed successfully (for
>> example, if _CPC object was not found) then cpc_desc_ptr for that
>> processor will be invalid.
>>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> ---
>>  drivers/acpi/cppc_acpi.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
>> index d0d0504..5bba26e 100644
>> --- a/drivers/acpi/cppc_acpi.c
>> +++ b/drivers/acpi/cppc_acpi.c
>> @@ -824,6 +824,8 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
>>  	void __iomem *addr;
>>  
>>  	cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);
>> +	if (!cpc_ptr)
>> +		return;
>>  
>>  	/* Free all the mapped sys mem areas for this CPU */
>>  	for (i = 2; i < cpc_ptr->num_entries; i++) {
> I think a recent patch from Sebastian fixed the same issue.
> https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=9e9d68dad58c70f40f50adfeabd2fdaa39a743fd

Ah, excellent! Thanks.

-boris

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

end of thread, other threads:[~2016-12-16 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16 18:35 [PATCH] ACPI/CPC: Don't try to clean up uninitialized CPC data Boris Ostrovsky
2016-12-16 21:52 ` Prakash, Prashanth
2016-12-16 22:02   ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).