Skip to content

Commit 6cafe70

Browse files
John Garryrafaeljw
authored andcommitted
ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs
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>
1 parent 98a455d commit 6cafe70

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/acpi/pptt.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta
451451
return cpu;
452452
}
453453

454+
static void acpi_pptt_warn_missing(void)
455+
{
456+
pr_warn_once("No PPTT table found, cpu and cache topology may be inaccurate\n");
457+
}
458+
454459
/**
455460
* topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
456461
* @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)
498503

499504
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
500505
if (ACPI_FAILURE(status)) {
501-
pr_warn_once("No PPTT table found, cpu topology may be inaccurate\n");
506+
acpi_pptt_warn_missing();
502507
return -ENOENT;
503508
}
504509
retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
@@ -531,7 +536,7 @@ int acpi_find_last_cache_level(unsigned int cpu)
531536
acpi_cpu_id = get_acpi_id_for_cpu(cpu);
532537
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
533538
if (ACPI_FAILURE(status)) {
534-
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
539+
acpi_pptt_warn_missing();
535540
} else {
536541
number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
537542
acpi_put_table(table);
@@ -563,7 +568,7 @@ int cache_setup_acpi(unsigned int cpu)
563568

564569
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
565570
if (ACPI_FAILURE(status)) {
566-
pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
571+
acpi_pptt_warn_missing();
567572
return -ENOENT;
568573
}
569574

@@ -617,7 +622,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
617622

618623
status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
619624
if (ACPI_FAILURE(status)) {
620-
pr_warn_once("No PPTT table found, topology may be inaccurate\n");
625+
acpi_pptt_warn_missing();
621626
return -ENOENT;
622627
}
623628

0 commit comments

Comments
 (0)