From patchwork Thu Feb 7 16:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 157762 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp845382jaa; Thu, 7 Feb 2019 08:14:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZu1Z86OF6vbqmIBtFTl0kMCDiTha4APiI0N5PKdyCKlUQ7fzU1KlYmZ+wrCMDSbDUblx5v X-Received: by 2002:a65:64c8:: with SMTP id t8mr5110126pgv.31.1549556049057; Thu, 07 Feb 2019 08:14:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549556049; cv=none; d=google.com; s=arc-20160816; b=QoSvdpb1qQHRm5TBu0UBkvKn9qVtqEiZjdqXqAuizDMfJ+G8ratXzx3qwKh0EGq0Uh Qi1pBWcx+95ksgFf/rSlnW/79GmJJVm7M8co7vIYxPU8Jr7XMnP2jkp4SGbfUT4saDJ9 bYktQF9bnXydnoW/sZI9LxPOXIADKVbZt80nneKp+FuYN/iOfq/oeKCq4aIWXy8r+VRA jHnNf6ImQooac85GWuaZCvyJ6YE2VyZ44UYIfYwjsZLItKGPHnK6eCf65dzhocyb0EVl Y+LGE9oQ5BLmx1APxLXgsigI/LrXDrNoUNQ4w5r/31mFsa0MxLVLAD3rtKEvg0M2Syy+ b2ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=AAsCYkuQc/TYs2nNNWW+GoOG3HXVX+CY4jxQnGc3SMw=; b=EX9wK0sSK6hjms33EMLDLSzifSN5BKlQLRL7RxSPJ5YgA/JCLfteYQ9EZe9xr+wxjc Pvw7L1Dm51fWSYrUC0rrthRskRIBWVuCDNC7FWBjW1U04z626R7YXwITa3uiXF2Ol6OJ ILSfc6Eb4pYHLv+uwOVHbHCXrLbboL17EeAksDAA0Ih1sbQkhwnPxvW47wedfPO7hWyZ /5z6YErwdxoVbk2WrjDhxN/BvScSmSU7eglbTk98E7l/Y5ZPYgwzgKwwA12ynw99W3Sf TEJfb0lTP5Q2hyBp2J9IL9XYVkuDEzeWE+dePRwWPcUfoWwwT+RBsLzru+s+7VWP7HH7 qgXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75si987023pfi.193.2019.02.07.08.14.08; Thu, 07 Feb 2019 08:14:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbfBGQOI (ORCPT + 9 others); Thu, 7 Feb 2019 11:14:08 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:50366 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726196AbfBGQOI (ORCPT ); Thu, 7 Feb 2019 11:14:08 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 571F8A1F3AA1B816CC6A; Fri, 8 Feb 2019 00:14:05 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Fri, 8 Feb 2019 00:13:56 +0800 From: John Garry To: , CC: , , , , John Garry Subject: [PATCH] ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs Date: Fri, 8 Feb 2019 00:14:21 +0800 Message-ID: <1549556061-107418-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 -- 2.17.1 Reviewed-by: Jeremy Linton diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index da031b1df6f5..ad31c50de3be 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -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 @@ -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); @@ -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); @@ -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; } @@ -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; }