Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp901547rwe; Wed, 24 Aug 2022 10:56:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4iUTDhVeCYl0wPdsI3HmtDPgftKvN3N9jG4jXeXndcb6mlJ+dXC7quC15O2gigM/D39Brk X-Received: by 2002:a17:907:a412:b0:731:6cc2:adfe with SMTP id sg18-20020a170907a41200b007316cc2adfemr94706ejc.74.1661363764948; Wed, 24 Aug 2022 10:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661363764; cv=none; d=google.com; s=arc-20160816; b=YI2Ya0k+WkLhhc3tVVJgwWJRRHYq6HF537XY0eWARi6FLWanxxzXcT0BiWhCJ8ZyYP 2sh7ZlJuW5Z9NyfI5ar89cby8xpIi5UU+jvGmpnVfryi2KoHzq1OhmAvGlnFwOkoclz7 FTdfT18VOnWkYnHKgaVK348HCkW4o9OxL88lZ3cdsvXVWB9ZV9vqPujH4HfK9qhsMMmq 4xwCUFA54v2c2oRyYKc+WoFcCJo72VkufJ+mRFVXrxTtL4vhThpOtFnWH4s/OAD8rw6H Hg3rA357jmgG+NWdY2VTOmMHdl72NZ1p+JaQzV5wAP8jt0riI9UuN8Js/+suDH5sLdIN w2KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=0tLkUlh1FHeGe/QNVVGQy+C756gxwW0g8+oCASu74sg=; b=a/kisSmfjHu+MrGkyCqdOVxW6o8b7hYPYwpBq0nz3jnVJ7wy9z9H6jI5uHtLIo6sAK z39iF79M29vn/3JGZTwDgoNRUVw6p0BF+/zB+kgMgZgAZsMJ/4V/xgX/aDsIA4SLDXZA bQg/ewZI8PNU/VFjUDZf2Ye1dZYNcu8Kbebg+tj1sWBRLzTwL5SzB4rJVD3b6mvY8/1v 0SRUnSchn1Yv19jCr52Wlk5qN/zbY+4nXFwBuZ1gLI8+vv810QP/+lj/pyh/nLaesPQb 9yeJWmdTip+wyfCTRASjhVjbDC8L/yw0SQd7S3QqIC/Ftzf43ENOIt7PKOVDGVUrpuBy TqEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm2-20020a170907948200b0073d9f42a3a9si2535651ejc.757.2022.08.24.10.55.39; Wed, 24 Aug 2022 10:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240099AbiHXRc1 (ORCPT + 99 others); Wed, 24 Aug 2022 13:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239329AbiHXRc0 (ORCPT ); Wed, 24 Aug 2022 13:32:26 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E744B7D798; Wed, 24 Aug 2022 10:32:24 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id caaf97ed744133c6; Wed, 24 Aug 2022 19:32:23 +0200 Received: from kreacher.localnet (unknown [213.134.169.54]) (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) by v370.home.net.pl (Postfix) with ESMTPSA id 075BF66D192; Wed, 24 Aug 2022 19:32:21 +0200 (CEST) From: "Rafael J. Wysocki" To: Alex Deucher Cc: Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, LKML , Linux ACPI , Linux PM , Mario Limonciello Subject: [PATCH] drm: amd: amdgpu: ACPI: Add comment about ACPI_FADT_LOW_POWER_S0 Date: Wed, 24 Aug 2022 19:32:21 +0200 Message-ID: <1831630.tdWV9SEqCh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.169.54 X-CLIENT-HOSTNAME: 213.134.169.54 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejuddgudduiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeevtdehuddvteduffejgeegueehheekfedtgeevkeeuffffudeffefgheevkeelgfenucffohhmrghinhepuhgvfhhirdhorhhgnecukfhppedvudefrddufeegrdduieelrdehgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieelrdehgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepledprhgtphhtthhopegrlhgvgigrnhguvghrrdguvghutghhvghrsegrmhgurdgtohhmpdhrtghpthhtoheptghhrhhishhtihgrnhdrkhhovghnihhgsegrmhgurdgtohhmpdhrtghpthhtohepighinhhhuhhirdfrrghnsegrmhgurdgtohhmpdhrtghpthhtoheprghmugdqghhfgieslhhishhtshdrfhhrvggvuggvshhk thhophdrohhrghdprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgrrhhiohdrlhhimhhonhgtihgvlhhlohesrghmugdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=9 Fuz1=9 Fuz2=9 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki According to the ACPI specification [1], the ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space). However, on some systems that flag is used to indicate whether or not to enable special firmware mechanics allowing the system to save more energy when suspended to idle. If that flag is unset, doing so is generally risky. Accordingly, add a comment to explain the ACPI_FADT_LOW_POWER_S0 check in amdgpu_acpi_is_s0ix_active(), the purpose of which is otherwise somewhat unclear. Link: https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt # [1] Signed-off-by: Rafael J. Wysocki --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: linux-pm/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c =================================================================== --- linux-pm.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ linux-pm/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1066,6 +1066,12 @@ bool amdgpu_acpi_is_s0ix_active(struct a (pm_suspend_target_state != PM_SUSPEND_TO_IDLE)) return false; + /* + * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally + * risky to do any special firmware-related preparations for entering + * S0ix even though the system is suspending to idle, so return false + * in that case. + */ if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) { dev_warn_once(adev->dev, "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"