From patchwork Thu Feb 24 11:38:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 545645 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 69FF2C433F5 for ; Thu, 24 Feb 2022 11:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234062AbiBXLjG (ORCPT ); Thu, 24 Feb 2022 06:39:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234032AbiBXLjD (ORCPT ); Thu, 24 Feb 2022 06:39:03 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 659391A6143; Thu, 24 Feb 2022 03:38:32 -0800 (PST) Received: from localhost.localdomain (ip5f5aee05.dynamic.kabel-deutschland.de [95.90.238.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 10DF461EA1939; Thu, 24 Feb 2022 12:38:29 +0100 (CET) From: Paul Menzel To: Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: Paul Menzel , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] acpi: exsystem: Add units to time variable names Date: Thu, 24 Feb 2022 12:38:03 +0100 Message-Id: <20220224113807.91771-1-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org `how_long` uses different units in both functions, so make it more clear, what unit they expect. Signed-off-by: Paul Menzel --- drivers/acpi/acpica/exsystem.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index 1281c07112de..6bc5b46e6927 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c @@ -107,7 +107,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) * * FUNCTION: acpi_ex_system_do_stall * - * PARAMETERS: how_long - The amount of time to stall, + * PARAMETERS: how_long_us - The amount of time to stall, * in microseconds * * RETURN: Status @@ -120,13 +120,13 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) * ******************************************************************************/ -acpi_status acpi_ex_system_do_stall(u32 how_long) +acpi_status acpi_ex_system_do_stall(u32 how_long_us) { acpi_status status = AE_OK; ACPI_FUNCTION_ENTRY(); - if (how_long > 255) { /* 255 microseconds */ + if (how_long_us > 255) { /* 255 microseconds */ /* * Longer than 255 usec, this is an error * @@ -134,10 +134,10 @@ acpi_status acpi_ex_system_do_stall(u32 how_long) * order to support existing BIOSs) */ ACPI_ERROR((AE_INFO, - "Time parameter is too large (%u)", how_long)); + "Time parameter is too large (%u)", how_long_us)); status = AE_AML_OPERAND_VALUE; } else { - acpi_os_stall(how_long); + acpi_os_stall(how_long_us); } return (status); @@ -147,7 +147,7 @@ acpi_status acpi_ex_system_do_stall(u32 how_long) * * FUNCTION: acpi_ex_system_do_sleep * - * PARAMETERS: how_long - The amount of time to sleep, + * PARAMETERS: how_long_ms - The amount of time to sleep, * in milliseconds * * RETURN: None @@ -156,7 +156,7 @@ acpi_status acpi_ex_system_do_stall(u32 how_long) * ******************************************************************************/ -acpi_status acpi_ex_system_do_sleep(u64 how_long) +acpi_status acpi_ex_system_do_sleep(u64 how_long_ms) { ACPI_FUNCTION_ENTRY(); @@ -168,11 +168,11 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long) * For compatibility with other ACPI implementations and to prevent * accidental deep sleeps, limit the sleep time to something reasonable. */ - if (how_long > ACPI_MAX_SLEEP) { - how_long = ACPI_MAX_SLEEP; + if (how_long_ms > ACPI_MAX_SLEEP) { + how_long_ms = ACPI_MAX_SLEEP; } - acpi_os_sleep(how_long); + acpi_os_sleep(how_long_ms); /* And now we must get the interpreter again */ From patchwork Thu Feb 24 11:38:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 547633 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 1383FC433EF for ; Thu, 24 Feb 2022 11:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234048AbiBXLjH (ORCPT ); Thu, 24 Feb 2022 06:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234042AbiBXLjD (ORCPT ); Thu, 24 Feb 2022 06:39:03 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605541A58EA; Thu, 24 Feb 2022 03:38:33 -0800 (PST) Received: from localhost.localdomain (ip5f5aee05.dynamic.kabel-deutschland.de [95.90.238.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id CD58161EA193A; Thu, 24 Feb 2022 12:38:31 +0100 (CET) From: Paul Menzel To: Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: Paul Menzel , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] acpi: exsystem: Inform users about ACPI spec violation Date: Thu, 24 Feb 2022 12:38:04 +0100 Message-Id: <20220224113807.91771-2-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220224113807.91771-1-pmenzel@molgen.mpg.de> References: <20220224113807.91771-1-pmenzel@molgen.mpg.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Inform users if firmware violates the ACPI specification. Signed-off-by: Paul Menzel --- drivers/acpi/acpica/exsystem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index 6bc5b46e6927..00f66af31ffa 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c @@ -137,6 +137,9 @@ acpi_status acpi_ex_system_do_stall(u32 how_long_us) "Time parameter is too large (%u)", how_long_us)); status = AE_AML_OPERAND_VALUE; } else { + if (how_long_us > 100) /* 100 microseconds */ + ACPI_WARNING((AE_INFO, + "Time parameter %u us > 100 us violating ACPI spec, please fix the firmware.", how_long_us)); acpi_os_stall(how_long_us); } From patchwork Thu Feb 24 11:38:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 545644 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 A375AC433F5 for ; Thu, 24 Feb 2022 11:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234089AbiBXLjI (ORCPT ); Thu, 24 Feb 2022 06:39:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234055AbiBXLjE (ORCPT ); Thu, 24 Feb 2022 06:39:04 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9576E1B0C59; Thu, 24 Feb 2022 03:38:34 -0800 (PST) Received: from localhost.localdomain (ip5f5aee05.dynamic.kabel-deutschland.de [95.90.238.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 1990A61EA193F; Thu, 24 Feb 2022 12:38:33 +0100 (CET) From: Paul Menzel To: Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: Paul Menzel , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] acpi: exsystem: Warn about sleeps greater than 50 ms Date: Thu, 24 Feb 2022 12:38:05 +0100 Message-Id: <20220224113807.91771-3-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220224113807.91771-1-pmenzel@molgen.mpg.de> References: <20220224113807.91771-1-pmenzel@molgen.mpg.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Quick boottime is important, so warn about sleeps greater than 50 ms in ACPI. 50 ms is still long compared to distribution Linux kernels reaching initrd in 350 ms, so should probably changed to 10 ms, so people are aware about this. Signed-off-by: Paul Menzel Signed-off-by: Paul Menzel --- drivers/acpi/acpica/exsystem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index 00f66af31ffa..bdffb8aac05c 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c @@ -167,6 +167,11 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long_ms) acpi_ex_exit_interpreter(); + if (how_long_ms > 50) { + ACPI_WARNING((AE_INFO, + "Time parameter %llu > 50 ms. Please contact firmware vendor for more responsive system.", how_long_ms)); + } + /* * For compatibility with other ACPI implementations and to prevent * accidental deep sleeps, limit the sleep time to something reasonable. From patchwork Thu Feb 24 11:38:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 547632 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 3E149C4332F for ; Thu, 24 Feb 2022 11:38:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234092AbiBXLjJ (ORCPT ); Thu, 24 Feb 2022 06:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbiBXLjF (ORCPT ); Thu, 24 Feb 2022 06:39:05 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF42C1B0C7C; Thu, 24 Feb 2022 03:38:35 -0800 (PST) Received: from localhost.localdomain (ip5f5aee05.dynamic.kabel-deutschland.de [95.90.238.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 3F2C561EA193D; Thu, 24 Feb 2022 12:38:34 +0100 (CET) From: Paul Menzel To: Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: Paul Menzel , linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] acpi: exsystem: Decrease sleep warning threshold to 10 ms Date: Thu, 24 Feb 2022 12:38:06 +0100 Message-Id: <20220224113807.91771-4-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220224113807.91771-1-pmenzel@molgen.mpg.de> References: <20220224113807.91771-1-pmenzel@molgen.mpg.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 50 ms is quite long for todays systems and requirements. 10 ms seems like a more appropriate limit, and everything else needing more should be rewritten to use polling. Signed-off-by: Paul Menzel --- drivers/acpi/acpica/exsystem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index bdffb8aac05c..676459ccc8d7 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c @@ -167,9 +167,9 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long_ms) acpi_ex_exit_interpreter(); - if (how_long_ms > 50) { + if (how_long_ms > 10) { ACPI_WARNING((AE_INFO, - "Time parameter %llu > 50 ms. Please contact firmware vendor for more responsive system.", how_long_ms)); + "Time parameter %llu > 10 ms. Please contact firmware vendor for more responsive system.", how_long_ms)); } /*