提交 92cceebb 编写于 作者: J John Garry 提交者: Shile Zhang

ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs

to #25688970

commit 6cafe700b08cfd261a279b9e5ed99f3a346fe3b0 upstream

For a system using ACPI-based FW without a PPTT, we may get many warnings
about the lack of a PPTT, as shown:

root@(none)$ dmesg | grep -i pptt
[    0.010125] ACPI PPTT: No PPTT table found, cpu topology may be inaccurate
[    7.138339] ACPI PPTT: No PPTT table found, cache topology may be inaccurate
[    7.145368] ACPI PPTT: No PPTT table found, cache topology may be inaccurate

These logs are generated with pr_warn_once(), so the intention was for a
single log, but the logs overlap, so consolidate them.
Signed-off-by: NJohn Garry <john.garry@huawei.com>
Reviewed-by: NJeremy Linton <jeremy.linton@arm.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Nluanshi <zhangliguang@linux.alibaba.com>
Acked-by: Nzou cao <zoucao@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 d3dc53f4
...@@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta ...@@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta
return cpu; return cpu;
} }
static void acpi_pptt_warn_missing(void)
{
pr_warn_once("No PPTT table found, cpu and cache topology may be inaccurate\n");
}
/** /**
* topology_get_acpi_cpu_tag() - Find a unique topology value for a feature * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
* @table: Pointer to the head of the PPTT table * @table: Pointer to the head of the PPTT table
...@@ -498,7 +503,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag) ...@@ -498,7 +503,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cpu topology may be inaccurate\n"); acpi_pptt_warn_missing();
return -ENOENT; return -ENOENT;
} }
retval = topology_get_acpi_cpu_tag(table, cpu, level, flag); retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
...@@ -569,7 +574,7 @@ int acpi_find_last_cache_level(unsigned int cpu) ...@@ -569,7 +574,7 @@ int acpi_find_last_cache_level(unsigned int cpu)
acpi_cpu_id = get_acpi_id_for_cpu(cpu); acpi_cpu_id = get_acpi_id_for_cpu(cpu);
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n"); acpi_pptt_warn_missing();
} else { } else {
number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id); number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
acpi_put_table(table); acpi_put_table(table);
...@@ -601,7 +606,7 @@ int cache_setup_acpi(unsigned int cpu) ...@@ -601,7 +606,7 @@ int cache_setup_acpi(unsigned int cpu)
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n"); acpi_pptt_warn_missing();
return -ENOENT; return -ENOENT;
} }
...@@ -669,7 +674,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level) ...@@ -669,7 +674,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, topology may be inaccurate\n"); acpi_pptt_warn_missing();
return -ENOENT; return -ENOENT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册