From patchwork Wed Mar 22 10:22:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 666242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D2FDC6FD1C for ; Wed, 22 Mar 2023 10:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjCVK0c (ORCPT ); Wed, 22 Mar 2023 06:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjCVK0b (ORCPT ); Wed, 22 Mar 2023 06:26:31 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF4335D8A5; Wed, 22 Mar 2023 03:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679480787; x=1711016787; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7zRvA7Uxcl1VdNgMi/XZ56/MUgIfsPqcnnBow1c4txA=; b=RhAmWKKeTJ3XS3/+vd89NYn6YF3Tks+tdvTpzQ9tl66XqWNRcJ2GVvoH MEMFTmw8WNMJz3OOGaHuKqGbAIOHan/OHqAc9e9/t9NRy97g1h3KuNvIh qmW+Ceyhyg3UbBS+uqK0/ZV7EOWgO5Oj9Cz6UONhX8us6UbGC0F4xE3vE ilaGxd4HRr53S4ME/9hEJLe7C1IyFALQqSOgvpcZb6WBCbTWyP5iH1UyW FCNYnunVsvyqtroQor4zwlF5TbociXixlT9H/+65QBw/86RiVVobQafFP f3FuejIS2eH0nAKHCrGMFZmC2rcKl+NvJ+IVagLICjlm/GRCaXSzEcezq A==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="327558080" X-IronPort-AV: E=Sophos;i="5.98,281,1673942400"; d="scan'208";a="327558080" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 03:26:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="750982183" X-IronPort-AV: E=Sophos;i="5.98,281,1673942400"; d="scan'208";a="750982183" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Mar 2023 03:26:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1C2241CC; Wed, 22 Mar 2023 12:26:59 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 1/2] ACPI: SPCR: Prefix error messages with FW_BUG Date: Wed, 22 Mar 2023 12:22:57 +0200 Message-Id: <20230322102258.27390-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The table values that are not defined in the specification are considered non-fatal errors in the code. However, they are for sure the bugs in the firmware. Point this out in the message by prefixing them with FW_BUG. Signed-off-by: Andy Shevchenko --- drivers/acpi/spcr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 1eabfcd122ee..01d29ebdb9c2 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -110,12 +110,12 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) u32 bit_width = table->serial_port.access_width; if (bit_width > ACPI_ACCESS_BIT_MAX) { - pr_err("Unacceptable wide SPCR Access Width. Defaulting to byte size\n"); + pr_err(FW_BUG "Unacceptable wide SPCR Access Width. Defaulting to byte size\n"); bit_width = ACPI_ACCESS_BIT_DEFAULT; } switch (ACPI_ACCESS_BIT_WIDTH((bit_width))) { default: - pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n"); + pr_err(FW_BUG "Unexpected SPCR Access Width. Defaulting to byte size\n"); fallthrough; case 8: iotype = "mmio"; From patchwork Wed Mar 22 10:22:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 665943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B26A9C6FD1F for ; Wed, 22 Mar 2023 10:26:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbjCVK0S (ORCPT ); Wed, 22 Mar 2023 06:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjCVK0R (ORCPT ); Wed, 22 Mar 2023 06:26:17 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0349E5CEF3; Wed, 22 Mar 2023 03:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679480776; x=1711016776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UHHsYT39pGeNMX2oibt0RObI5UboYwFvGeKym4oKDoE=; b=PrjFcoZfYcB/8nqPVKEH5EE67b5T+xE0OYw31TekvHYByMM7Ho6b5R3K OywPyNzyhn2Hd35vCpIkJ8PTt6FvAreJTIwOQGa7+veuGWh78/xXVj0JA Syfoqlk1Oa5FTIhoopN+Itrql5ky7WWCgf7YZQTWVO4CuORpsLzdv8YtX OpD/tBb0RS0WnmB5ZKsiqMkUXd6/vV2TCtjP4faD+W22W/jjN9+q9Valj p+8whFRTLbYXi9TTkKuhZPxVUiqHygQBlC1XV1At73DstXXrkT29dEjUH rbqSY/g5InsmShPfNV4+UV7bO7MifxhAvQ19qW1+W4IYZWLxvMIddCa5D g==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="319570430" X-IronPort-AV: E=Sophos;i="5.98,281,1673942400"; d="scan'208";a="319570430" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 03:26:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="681843642" X-IronPort-AV: E=Sophos;i="5.98,281,1673942400"; d="scan'208";a="681843642" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 22 Mar 2023 03:26:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 267F681; Wed, 22 Mar 2023 12:26:59 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 2/2] ACPI: SPCR: Amend indentation Date: Wed, 22 Mar 2023 12:22:58 +0200 Message-Id: <20230322102258.27390-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230322102258.27390-1-andriy.shevchenko@linux.intel.com> References: <20230322102258.27390-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 1) Remove unnecessary blank lines. 2) Remove double spaces for consistency. 3) Reformat one comment for consistency. Signed-off-by: Andy Shevchenko --- drivers/acpi/spcr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 01d29ebdb9c2..3d242c746d10 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -71,18 +71,16 @@ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) /** * acpi_parse_spcr() - parse ACPI SPCR table and add preferred console - * * @enable_earlycon: set up earlycon for the console specified by the table * @enable_console: setup the console specified by the table. * * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be - * defined to parse ACPI SPCR table. As a result of the parsing preferred + * defined to parse ACPI SPCR table. As a result of the parsing preferred * console is registered and if @enable_earlycon is true, earlycon is set up. * If @enable_console is true the system console is also configured. * * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called * from arch initialization code as soon as the DT/ACPI decision is made. - * */ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) { @@ -97,9 +95,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) if (acpi_disabled) return -ENODEV; - status = acpi_get_table(ACPI_SIG_SPCR, 0, - (struct acpi_table_header **)&table); - + status = acpi_get_table(ACPI_SIG_SPCR, 0, (struct acpi_table_header **)&table); if (ACPI_FAILURE(status)) return -ENOENT; @@ -184,10 +180,10 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) * * If the user specifies "traditional" earlycon, the qdf2400_e44 * console name matches the EARLYCON_DECLARE() statement, and - * SPCR is not used. Parameter "earlycon" is false. + * SPCR is not used. Parameter "earlycon" is false. * * If the user specifies "SPCR" earlycon, then we need to update - * the console name so that it also says "qdf2400_e44". Parameter + * the console name so that it also says "qdf2400_e44". Parameter * "earlycon" is true. * * For consistency, if we change the console name, then we do it @@ -202,7 +198,8 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) if (xgene_8250_erratum_present(table)) { iotype = "mmio32"; - /* for xgene v1 and v2 we don't know the clock rate of the + /* + * For xgene v1 and v2 we don't know the clock rate of the * UART so don't attempt to change to the baud rate state * in the table because driver cannot calculate the dividers */