All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround
@ 2019-12-24  1:56 Hanjun Guo
  2019-12-24  1:56 ` [PATCH 2/2] cpufreq: cppc: put the acpi table after successfully get it Hanjun Guo
  2019-12-29 22:47 ` [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-12-24  1:56 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: linux-acpi, linux-pm, Xiongfeng Wang, Hanjun Guo

Bail out if we match the OEM information, to save some possible
extra iteration. And update the code to fix minor coding style issue.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 8d8da76..d0ca300 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -39,7 +39,7 @@
 static struct cppc_cpudata **all_cpu_data;
 
 struct cppc_workaround_oem_info {
-	char oem_id[ACPI_OEM_ID_SIZE +1];
+	char oem_id[ACPI_OEM_ID_SIZE + 1];
 	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
 	u32 oem_revision;
 };
@@ -93,8 +93,10 @@ static void cppc_check_hisi_workaround(void)
 	for (i = 0; i < ARRAY_SIZE(wa_info); i++) {
 		if (!memcmp(wa_info[i].oem_id, tbl->oem_id, ACPI_OEM_ID_SIZE) &&
 		    !memcmp(wa_info[i].oem_table_id, tbl->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) &&
-		    wa_info[i].oem_revision == tbl->oem_revision)
+		    wa_info[i].oem_revision == tbl->oem_revision) {
 			apply_hisi_workaround = true;
+			break;
+		}
 	}
 }
 
-- 
1.7.12.4


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

* [PATCH 2/2] cpufreq: cppc: put the acpi table after successfully get it
  2019-12-24  1:56 [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Hanjun Guo
@ 2019-12-24  1:56 ` Hanjun Guo
  2019-12-29 22:47 ` [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-12-24  1:56 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: linux-acpi, linux-pm, Xiongfeng Wang, Hanjun Guo

We need to put the ACPI table to release the table mapping
after we successfully get it.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index d0ca300..a06777c 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -98,6 +98,8 @@ static void cppc_check_hisi_workaround(void)
 			break;
 		}
 	}
+
+	acpi_put_table(tbl);
 }
 
 /* Callback function used to retrieve the max frequency from DMI */
-- 
1.7.12.4


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

* Re: [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround
  2019-12-24  1:56 [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Hanjun Guo
  2019-12-24  1:56 ` [PATCH 2/2] cpufreq: cppc: put the acpi table after successfully get it Hanjun Guo
@ 2019-12-29 22:47 ` Rafael J. Wysocki
  2019-12-30 12:10   ` Hanjun Guo
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2019-12-29 22:47 UTC (permalink / raw)
  To: Hanjun Guo
  Cc: Rafael J. Wysocki, Viresh Kumar, linux-acpi, linux-pm, Xiongfeng Wang

On Tuesday, December 24, 2019 2:56:29 AM CET Hanjun Guo wrote:
> Bail out if we match the OEM information, to save some possible
> extra iteration. And update the code to fix minor coding style issue.
> 
> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 8d8da76..d0ca300 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -39,7 +39,7 @@
>  static struct cppc_cpudata **all_cpu_data;
>  
>  struct cppc_workaround_oem_info {
> -	char oem_id[ACPI_OEM_ID_SIZE +1];
> +	char oem_id[ACPI_OEM_ID_SIZE + 1];
>  	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
>  	u32 oem_revision;
>  };
> @@ -93,8 +93,10 @@ static void cppc_check_hisi_workaround(void)
>  	for (i = 0; i < ARRAY_SIZE(wa_info); i++) {
>  		if (!memcmp(wa_info[i].oem_id, tbl->oem_id, ACPI_OEM_ID_SIZE) &&
>  		    !memcmp(wa_info[i].oem_table_id, tbl->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) &&
> -		    wa_info[i].oem_revision == tbl->oem_revision)
> +		    wa_info[i].oem_revision == tbl->oem_revision) {
>  			apply_hisi_workaround = true;
> +			break;
> +		}
>  	}
>  }
>  
> 

Both this and the [2/2] applies as 5.6 material with reworked
subjects and changelog changes.  Thanks!





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

* Re: [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround
  2019-12-29 22:47 ` [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Rafael J. Wysocki
@ 2019-12-30 12:10   ` Hanjun Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-12-30 12:10 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Viresh Kumar, linux-acpi, linux-pm, Xiongfeng Wang

On 2019/12/30 6:47, Rafael J. Wysocki wrote:
> On Tuesday, December 24, 2019 2:56:29 AM CET Hanjun Guo wrote:
>> Bail out if we match the OEM information, to save some possible
>> extra iteration. And update the code to fix minor coding style issue.
>>
>> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
>> ---
>>  drivers/cpufreq/cppc_cpufreq.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
>> index 8d8da76..d0ca300 100644
>> --- a/drivers/cpufreq/cppc_cpufreq.c
>> +++ b/drivers/cpufreq/cppc_cpufreq.c
>> @@ -39,7 +39,7 @@
>>  static struct cppc_cpudata **all_cpu_data;
>>  
>>  struct cppc_workaround_oem_info {
>> -	char oem_id[ACPI_OEM_ID_SIZE +1];
>> +	char oem_id[ACPI_OEM_ID_SIZE + 1];
>>  	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
>>  	u32 oem_revision;
>>  };
>> @@ -93,8 +93,10 @@ static void cppc_check_hisi_workaround(void)
>>  	for (i = 0; i < ARRAY_SIZE(wa_info); i++) {
>>  		if (!memcmp(wa_info[i].oem_id, tbl->oem_id, ACPI_OEM_ID_SIZE) &&
>>  		    !memcmp(wa_info[i].oem_table_id, tbl->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) &&
>> -		    wa_info[i].oem_revision == tbl->oem_revision)
>> +		    wa_info[i].oem_revision == tbl->oem_revision) {
>>  			apply_hisi_workaround = true;
>> +			break;
>> +		}
>>  	}
>>  }
>>  
>>
> 
> Both this and the [2/2] applies as 5.6 material with reworked
> subjects and changelog changes.  Thanks!

Much better for the reworked subject and changelog, thank
you very much!

Hanjun


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

end of thread, other threads:[~2019-12-30 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24  1:56 [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Hanjun Guo
2019-12-24  1:56 ` [PATCH 2/2] cpufreq: cppc: put the acpi table after successfully get it Hanjun Guo
2019-12-29 22:47 ` [PATCH 1/2] cpufreq : cppc: Break out if we match the HiSilicon cppc workaround Rafael J. Wysocki
2019-12-30 12:10   ` Hanjun Guo

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.