From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD1CFC433FE for ; Tue, 7 Sep 2021 03:27:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE5D16069E for ; Tue, 7 Sep 2021 03:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232845AbhIGD2d (ORCPT ); Mon, 6 Sep 2021 23:28:33 -0400 Received: from mga04.intel.com ([192.55.52.120]:34706 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbhIGD2c (ORCPT ); Mon, 6 Sep 2021 23:28:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="218223060" X-IronPort-AV: E=Sophos;i="5.85,273,1624345200"; d="scan'208";a="218223060" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 20:27:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,273,1624345200"; d="scan'208";a="502739730" Received: from aubrey-app.sh.intel.com (HELO [10.239.53.25]) ([10.239.53.25]) by fmsmga008.fm.intel.com with ESMTP; 06 Sep 2021 20:27:23 -0700 Subject: Re: New warning: PRMT not found To: Paul Menzel , "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , LKML References: <64150c95-3f7d-d21f-d6fb-b9d478ed6798@molgen.mpg.de> <766862fc-80fa-775b-6e63-6d9422d1d258@molgen.mpg.de> From: Aubrey Li Message-ID: <54b6f8cb-4714-587c-b2d0-98134473293d@linux.intel.com> Date: Tue, 7 Sep 2021 11:26:22 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On 9/6/21 10:15 PM, Paul Menzel wrote: > Dear Rafael, dear Aubrey, > > > Thank you for replying. > > > Am 06.09.21 um 14:02 schrieb Rafael J. Wysocki: >> >> This should be addressed by commit 2bbfa0addd63 "ACPI: PRM: Deal with >> table not present or no module found", or yet another fix is needed. > > Linux still warns on my systems with Linux 5.14 and Linus’ master in QEMU i440fx and an Asus F2A85-M PRO. Does the following patch address your problem? Thanks, -Aubrey ---------------------------------------------------------------------- >From 52fda76410fcb7a3661687e960634d34fa44fb5f Mon Sep 17 00:00:00 2001 From: Aubrey Li Date: Tue, 7 Sep 2021 11:06:59 +0800 Subject: [PATCH] ACPI/RPM: Find PRMT table before parse it Find and verify PRMT table before parse it, this eliminates a warning on machines without PRMT table. Signed-off-by: Aubrey Li --- drivers/acpi/prmt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index 1f6007a..89c22bc 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -288,10 +288,18 @@ static acpi_status acpi_platformrt_space_handler(u32 function, void __init init_prmt(void) { + struct acpi_table_header *tbl; acpi_status status; - int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) + + int mc; + + status = acpi_get_table(ACPI_SIG_PRMT, 0, &tbl); + if (ACPI_FAILURE(status)) + return; + + mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) + sizeof (struct acpi_table_prmt_header), 0, acpi_parse_prmt, 0); + acpi_put_table(tbl); /* * Return immediately if PRMT table is not present or no PRM module found. */ -- 2.7.4