Skip to content

Commit

Permalink
ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs
Browse files Browse the repository at this point in the history
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: John Garry <john.garry@huawei.com>
Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
John Garry authored and Rafael J. Wysocki committed Feb 7, 2019
1 parent 98a455d commit 6cafe70
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/acpi/pptt.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta
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
* @table: Pointer to the head of the PPTT table
Expand Down Expand Up @@ -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);
if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cpu topology may be inaccurate\n");
acpi_pptt_warn_missing();
return -ENOENT;
}
retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
Expand Down Expand Up @@ -531,7 +536,7 @@ int acpi_find_last_cache_level(unsigned int cpu)
acpi_cpu_id = get_acpi_id_for_cpu(cpu);
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
acpi_pptt_warn_missing();
} else {
number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
acpi_put_table(table);
Expand Down Expand Up @@ -563,7 +568,7 @@ int cache_setup_acpi(unsigned int cpu)

status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
acpi_pptt_warn_missing();
return -ENOENT;
}

Expand Down Expand Up @@ -617,7 +622,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level)

status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
if (ACPI_FAILURE(status)) {
pr_warn_once("No PPTT table found, topology may be inaccurate\n");
acpi_pptt_warn_missing();
return -ENOENT;
}

Expand Down

0 comments on commit 6cafe70

Please sign in to comment.